Small cleanup

parent 849b2fb6
...@@ -16,17 +16,16 @@ ...@@ -16,17 +16,16 @@
$Id$ $Id$
""" """
import os import os
from zope.viewlet import viewlet as orig_viewlet import zope.viewlet.viewlet
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile class ViewletBase(zope.viewlet.viewlet.ViewletBase):
class ViewletBase(orig_viewlet.ViewletBase):
pass pass
class SimpleAttributeViewlet(orig_viewlet.SimpleAttributeViewlet): class SimpleAttributeViewlet(zope.viewlet.viewlet.SimpleAttributeViewlet):
pass pass
class simple(orig_viewlet.simple): class simple(zope.viewlet.viewlet.simple):
# We need to ensure that the proper __init__ is called. # We need to ensure that the proper __init__ is called.
__init__ = ViewletBase.__init__.im_func __init__ = ViewletBase.__init__.im_func
...@@ -39,7 +38,7 @@ def SimpleViewletClass(template, bases=(), attributes=None, ...@@ -39,7 +38,7 @@ def SimpleViewletClass(template, bases=(), attributes=None,
# Create the base class hierarchy # Create the base class hierarchy
bases += (simple, ViewletBase) bases += (simple, ViewletBase)
attrs = {'index' : ZopeTwoPageTemplateFile(template), attrs = {'index' : ViewPageTemplateFile(template),
'__name__' : name} '__name__' : name}
if attributes: if attributes:
attrs.update(attributes) attrs.update(attributes)
...@@ -50,7 +49,7 @@ def SimpleViewletClass(template, bases=(), attributes=None, ...@@ -50,7 +49,7 @@ def SimpleViewletClass(template, bases=(), attributes=None,
return class_ return class_
class ResourceViewletBase(orig_viewlet.ResourceViewletBase): class ResourceViewletBase(zope.viewlet.viewlet.ResourceViewletBase):
pass pass
def JavaScriptViewlet(path): def JavaScriptViewlet(path):
...@@ -59,13 +58,13 @@ def JavaScriptViewlet(path): ...@@ -59,13 +58,13 @@ def JavaScriptViewlet(path):
klass = type('JavaScriptViewlet', klass = type('JavaScriptViewlet',
(ResourceViewletBase, ViewletBase), (ResourceViewletBase, ViewletBase),
{'index': ZopeTwoPageTemplateFile(src), {'index': ViewPageTemplateFile(src),
'_path': path}) '_path': path})
return klass return klass
class CSSResourceViewletBase(orig_viewlet.CSSResourceViewletBase): class CSSResourceViewletBase(zope.viewlet.viewlet.CSSResourceViewletBase):
pass pass
def CSSViewlet(path, media="all", rel="stylesheet"): def CSSViewlet(path, media="all", rel="stylesheet"):
...@@ -74,7 +73,7 @@ def CSSViewlet(path, media="all", rel="stylesheet"): ...@@ -74,7 +73,7 @@ def CSSViewlet(path, media="all", rel="stylesheet"):
klass = type('CSSViewlet', klass = type('CSSViewlet',
(CSSResourceViewletBase, ViewletBase), (CSSResourceViewletBase, ViewletBase),
{'index': ZopeTwoPageTemplateFile(src), {'index': ViewPageTemplateFile(src),
'_path': path, '_path': path,
'_media':media, '_media':media,
'_rel':rel}) '_rel':rel})
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment