AW: [Checkins] SVN: z3c.zrtresource/trunk/src/z3c/zrtresource/zrtresource.pyz3c.zrtresource is made to work in Zope2. A docstring wasadded as the zope2 publisher won't publish otherwise. Added aconditional import on Five's FileResource. Only oneconditiona

Roger Ineichen dev at projekt01.ch
Fri Mar 28 10:53:44 EDT 2008


Hi Tim

[...]

> Log message for revision 84995:
>   z3c.zrtresource is made to work in Zope2. A docstring was 
> added as the zope2 publisher won't publish otherwise. Added a 
> conditional import on Five's FileResource. Only one 
> conditional import on Five was necessary - I don't think that 
> justifies a new branch so it's added to the trunk.
>   
> 
> Changed:
>   U   z3c.zrtresource/trunk/src/z3c/zrtresource/zrtresource.py
> 
> -=-
> Modified: z3c.zrtresource/trunk/src/z3c/zrtresource/zrtresource.py
> ===================================================================
> --- z3c.zrtresource/trunk/src/z3c/zrtresource/zrtresource.py	
> 2008-03-28 11:36:07 UTC (rev 84994)
> +++ z3c.zrtresource/trunk/src/z3c/zrtresource/zrtresource.py	
> 2008-03-28 14:34:51 UTC (rev 84995)
> @@ -18,14 +18,19 @@
>  __docformat__='restructuredtext'
>  from zope.app.component.hooks import getSite  from 
> zope.app.publisher.fileresource import File -from 
> zope.app.publisher.browser.fileresource import FileResource
>  
>  from z3c.zrtresource import processor, replace
>  
> +try:
> +    from Products.Five.browser.resource import FileResource
> +except:
> +    from zope.app.publisher.browser.fileresource import FileResource
>  
> +
>  class ZRTFileResource(FileResource):
>  
>      def GET(self):
> +        """ Process original file resource and return a 
> modified one.  """
>          data = super(ZRTFileResource, self).GET()
>          # Process the file
>          p = processor.ZRTProcessor(data, 
> commands={'replace': replace.Replace})

This package doesn't depend on Products.Five.

Please revert this changes. That's not possible anymore with
egg the based concept. Or at least only if you don't test 
the code.

Please subclass what you need in a own Five package and
then you can add tests too.

Probably this is not much important enough for that 
*import* usecase, but if we start with that, can you tell
me wheres the border with mixin code into Zope3 packages
and what is Ok and where do we stop?

Regards
Roger Ineichen
_____________________________
END OF MESSAGE 



More information about the Checkins mailing list