Commit e742659e authored by Arnaud Fontaine's avatar Arnaud Fontaine

zope4: ZPublisher.mapply uses `__code__` instead of `func_code` (Zope: 740eb601).

Also, `__code__` has been introduced in Python 2.6 (for forwards compatibility
with Python 3) as an alias to func_code which has been completely removed in
Python 3.

This fixes testFunctionalCore failures:
  [...]
    Module ZPublisher.mapply, line 53, in mapply
      code = f.__code__
  AttributeError: 'DefaultGetter' object has no attribute '__code__'
parent a1580754
Pipeline #19936 failed with stage
in 0 seconds
...@@ -56,10 +56,10 @@ class func_code: pass ...@@ -56,10 +56,10 @@ class func_code: pass
class PreferenceMethod(Method): class PreferenceMethod(Method):
""" A method object that lookup the attribute on preferences. """ """ A method object that lookup the attribute on preferences. """
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self', ) __code__.co_varnames = ('self', )
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, attribute, default): def __init__(self, attribute, default):
self.__name__ = self._preference_getter = attribute self.__name__ = self._preference_getter = attribute
......
...@@ -64,7 +64,7 @@ _USE_ORIGINAL_GET_VALUE_MARKER = [] ...@@ -64,7 +64,7 @@ _USE_ORIGINAL_GET_VALUE_MARKER = []
class WidgetDelegatedMethod(Method): class WidgetDelegatedMethod(Method):
"""Method delegated to the proxied field's widget. """Method delegated to the proxied field's widget.
""" """
func_code = None __code__ = func_code = None
def __init__(self, method_id, default=''): def __init__(self, method_id, default=''):
self._method_id = method_id self._method_id = method_id
...@@ -78,7 +78,7 @@ class WidgetDelegatedMethod(Method): ...@@ -78,7 +78,7 @@ class WidgetDelegatedMethod(Method):
try: try:
return proxied_method(field, *args, **kw) return proxied_method(field, *args, **kw)
finally: finally:
self.func_code = getattr(proxied_method, 'func_code', None) self.__code__ = self.func_code = getattr(proxied_method, '__code__', None)
return self._default return self._default
......
...@@ -38,10 +38,10 @@ class DefaultGetter(BaseGetter): ...@@ -38,10 +38,10 @@ class DefaultGetter(BaseGetter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self',) __code__.co_varnames = ('self',)
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, property_type, default, def __init__(self, id, key, property_type, default,
acquisition_base_category, acquisition_base_category,
...@@ -125,10 +125,10 @@ class ListGetter(BaseGetter): ...@@ -125,10 +125,10 @@ class ListGetter(BaseGetter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self',) __code__.co_varnames = ('self',)
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, property_type, default, def __init__(self, id, key, property_type, default,
acquisition_base_category, acquisition_base_category,
......
...@@ -41,10 +41,10 @@ class Getter(BaseGetter): ...@@ -41,10 +41,10 @@ class Getter(BaseGetter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self', 'args', 'kw') __code__.co_varnames = ('self', 'args', 'kw')
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = None __defaults__ = func_defaults = None
def __init__(self, id, key, property_type, portal_type, acquired_property, def __init__(self, id, key, property_type, portal_type, acquired_property,
acquisition_base_category, acquisition_base_category,
...@@ -127,10 +127,10 @@ class Setter(BaseSetter): ...@@ -127,10 +127,10 @@ class Setter(BaseSetter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self', 'value', 'args', 'kw') __code__.co_varnames = ('self', 'value', 'args', 'kw')
func_code.co_argcount = 2 __code__.co_argcount = 2
func_defaults = None __defaults__ = func_defaults = None
def __init__(self, id, key, property_type, portal_type, acquired_property, def __init__(self, id, key, property_type, portal_type, acquired_property,
acquisition_base_category, acquisition_base_category,
...@@ -209,10 +209,10 @@ class Tester(BaseTester): ...@@ -209,10 +209,10 @@ class Tester(BaseTester):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self',) __code__.co_varnames = ('self',)
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, property_type, portal_type, acquired_property, def __init__(self, id, key, property_type, portal_type, acquired_property,
acquisition_base_category, acquisition_base_category,
......
...@@ -43,10 +43,10 @@ class Reindex(Setter): ...@@ -43,10 +43,10 @@ class Reindex(Setter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
# More information at http://www.zope.org/Members/htrd/howto/FunctionTemplate # More information at http://www.zope.org/Members/htrd/howto/FunctionTemplate
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self', 'value') # XXX - This part should be configurable at instanciation __code__.co_varnames = ('self', 'value') # XXX - This part should be configurable at instanciation
func_code.co_argcount = 2 __code__.co_argcount = 2
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, accessor_id): def __init__(self, id, accessor_id):
self._id = id self._id = id
...@@ -73,16 +73,16 @@ class Dummy(Reindex): ...@@ -73,16 +73,16 @@ class Dummy(Reindex):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
# More information at http://www.zope.org/Members/htrd/howto/FunctionTemplate # More information at http://www.zope.org/Members/htrd/howto/FunctionTemplate
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self',) __code__.co_varnames = ('self',)
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, accessor_id): def __init__(self, id, accessor_id):
self._id = id self._id = id
self.__name__ = id self.__name__ = id
self._accessor_id = accessor_id self._accessor_id = accessor_id
# self.func_code = getattr(instance, self._accessor_id).func_code # self.__code__ = func_code = getattr(instance, self._accessor_id).func_code
def __call__(self, instance, *args, **kw): def __call__(self, instance, *args, **kw):
method = getattr(instance, self._accessor_id) method = getattr(instance, self._accessor_id)
......
...@@ -52,10 +52,10 @@ class Setter(Method): ...@@ -52,10 +52,10 @@ class Setter(Method):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
# More information at http://www.zope.org/Members/htrd/howto/FunctionTemplate # More information at http://www.zope.org/Members/htrd/howto/FunctionTemplate
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self', 'value') __code__.co_varnames = ('self', 'value')
func_code.co_argcount = 2 __code__.co_argcount = 2
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, property_type, storage_id=None): def __init__(self, id, key, property_type, storage_id=None):
self._id = id self._id = id
...@@ -149,10 +149,10 @@ class Getter(Method): ...@@ -149,10 +149,10 @@ class Getter(Method):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self',) __code__.co_varnames = ('self',)
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, property_type, default=None, storage_id=None): def __init__(self, id, key, property_type, default=None, storage_id=None):
self._id = id self._id = id
...@@ -211,10 +211,10 @@ class Tester(Method): ...@@ -211,10 +211,10 @@ class Tester(Method):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self',) __code__.co_varnames = ('self',)
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, property_type, storage_id=None): def __init__(self, id, key, property_type, storage_id=None):
self._id = id self._id = id
......
...@@ -41,10 +41,10 @@ class ListSetter(BaseSetter): ...@@ -41,10 +41,10 @@ class ListSetter(BaseSetter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self', 'category') __code__.co_varnames = ('self', 'category')
func_code.co_argcount = 2 __code__.co_argcount = 2
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key): def __init__(self, id, key):
self._id = id self._id = id
...@@ -71,10 +71,10 @@ class DefaultSetter(BaseSetter): ...@@ -71,10 +71,10 @@ class DefaultSetter(BaseSetter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self', 'category') __code__.co_varnames = ('self', 'category')
func_code.co_argcount = 2 __code__.co_argcount = 2
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key): def __init__(self, id, key):
self._id = id self._id = id
...@@ -119,10 +119,10 @@ class DefaultGetter(BaseGetter): ...@@ -119,10 +119,10 @@ class DefaultGetter(BaseGetter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self',) __code__.co_varnames = ('self',)
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key): def __init__(self, id, key):
self._id = id self._id = id
...@@ -143,10 +143,10 @@ class ListGetter(BaseGetter): ...@@ -143,10 +143,10 @@ class ListGetter(BaseGetter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self',) __code__.co_varnames = ('self',)
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key): def __init__(self, id, key):
self._id = id self._id = id
...@@ -178,10 +178,10 @@ class ItemListGetter(BaseGetter): ...@@ -178,10 +178,10 @@ class ItemListGetter(BaseGetter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self', 'args', 'kw',) __code__.co_varnames = ('self', 'args', 'kw',)
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key): def __init__(self, id, key):
self._id = id self._id = id
......
...@@ -39,10 +39,10 @@ class PropertyGetter: ...@@ -39,10 +39,10 @@ class PropertyGetter:
issues when we wish to make a property a method. For instance, issues when we wish to make a property a method. For instance,
we would like to change from isIndexable=1 to a method isIndexable(). we would like to change from isIndexable=1 to a method isIndexable().
""" """
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = () __code__.co_varnames = ()
func_code.co_argcount = 0 __code__.co_argcount = 0
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, value=None): def __init__(self, id, value=None):
self._id = id self._id = id
...@@ -84,10 +84,10 @@ class Getter(Accessor): ...@@ -84,10 +84,10 @@ class Getter(Accessor):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
# More information at http://www.zope.org/Members/htrd/howto/FunctionTemplate # More information at http://www.zope.org/Members/htrd/howto/FunctionTemplate
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self', ) __code__.co_varnames = ('self', )
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, value=None): def __init__(self, id, key, value=None):
self._id = id self._id = id
......
...@@ -47,10 +47,10 @@ class ValueGetter(Base.Getter): ...@@ -47,10 +47,10 @@ class ValueGetter(Base.Getter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self',) __code__.co_varnames = ('self',)
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, property_type, portal_type=None, storage_id=None, default=None): def __init__(self, id, key, property_type, portal_type=None, storage_id=None, default=None):
self._id = id self._id = id
...@@ -97,10 +97,10 @@ class ValueListGetter(Base.Getter): ...@@ -97,10 +97,10 @@ class ValueListGetter(Base.Getter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self',) __code__.co_varnames = ('self',)
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, property_type, portal_type=None, storage_id=None, default=None): def __init__(self, id, key, property_type, portal_type=None, storage_id=None, default=None):
self._id = id self._id = id
...@@ -134,10 +134,10 @@ class Getter(Base.Getter): ...@@ -134,10 +134,10 @@ class Getter(Base.Getter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self',) __code__.co_varnames = ('self',)
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, property_type, portal_type=None, storage_id=None, default=None): def __init__(self, id, key, property_type, portal_type=None, storage_id=None, default=None):
self._id = id self._id = id
...@@ -180,10 +180,10 @@ class ListGetter(Base.Getter): ...@@ -180,10 +180,10 @@ class ListGetter(Base.Getter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self',) __code__.co_varnames = ('self',)
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, property_type, portal_type=None, storage_id=None): def __init__(self, id, key, property_type, portal_type=None, storage_id=None):
self._id = id self._id = id
...@@ -216,10 +216,10 @@ class Tester(Method): ...@@ -216,10 +216,10 @@ class Tester(Method):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self',) __code__.co_varnames = ('self',)
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, property_type, storage_id=None): def __init__(self, id, key, property_type, storage_id=None):
self._id = id self._id = id
......
...@@ -50,10 +50,10 @@ class ValueGetter(Base.Getter): ...@@ -50,10 +50,10 @@ class ValueGetter(Base.Getter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self',) __code__.co_varnames = ('self',)
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, property_type, acquired_property, def __init__(self, id, key, property_type, acquired_property,
portal_type=None, storage_id=None, default=None): portal_type=None, storage_id=None, default=None):
...@@ -93,10 +93,10 @@ class ValueListGetter(Base.Getter): ...@@ -93,10 +93,10 @@ class ValueListGetter(Base.Getter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self',) __code__.co_varnames = ('self',)
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, property_type, acquired_property, def __init__(self, id, key, property_type, acquired_property,
portal_type=None, storage_id=None, default=None): portal_type=None, storage_id=None, default=None):
...@@ -132,10 +132,10 @@ class Getter(Base.Getter): ...@@ -132,10 +132,10 @@ class Getter(Base.Getter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self', 'args', 'kw') __code__.co_varnames = ('self', 'args', 'kw')
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, property_type, acquired_property, def __init__(self, id, key, property_type, acquired_property,
portal_type=None, storage_id=None, default=None): portal_type=None, storage_id=None, default=None):
...@@ -175,10 +175,10 @@ class Setter(Base.Setter): ...@@ -175,10 +175,10 @@ class Setter(Base.Setter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self', 'value', 'args', 'kw') __code__.co_varnames = ('self', 'value', 'args', 'kw')
func_code.co_argcount = 2 __code__.co_argcount = 2
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, property_type, acquired_property, def __init__(self, id, key, property_type, acquired_property,
portal_type=None, storage_id=None): portal_type=None, storage_id=None):
...@@ -237,10 +237,10 @@ class ListGetter(Base.Getter): ...@@ -237,10 +237,10 @@ class ListGetter(Base.Getter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self',) __code__.co_varnames = ('self',)
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, property_type, acquired_property, def __init__(self, id, key, property_type, acquired_property,
portal_type=None, storage_id=None): portal_type=None, storage_id=None):
...@@ -275,10 +275,10 @@ class Tester(Method): ...@@ -275,10 +275,10 @@ class Tester(Method):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self',) __code__.co_varnames = ('self',)
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, property_type, acquired_property, def __init__(self, id, key, property_type, acquired_property,
portal_type=None, storage_id=None): portal_type=None, storage_id=None):
......
...@@ -47,10 +47,10 @@ class DefaultSetter(Base.Setter): ...@@ -47,10 +47,10 @@ class DefaultSetter(Base.Setter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
# More information at http://www.zope.org/Members/htrd/howto/FunctionTemplate # More information at http://www.zope.org/Members/htrd/howto/FunctionTemplate
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self','value') __code__.co_varnames = ('self','value')
func_code.co_argcount = 2 __code__.co_argcount = 2
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, property_type, storage_id=None): def __init__(self, id, key, property_type, storage_id=None):
self._id = id self._id = id
...@@ -111,10 +111,10 @@ class SetSetter(Base.Setter): ...@@ -111,10 +111,10 @@ class SetSetter(Base.Setter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
# More information at http://www.zope.org/Members/htrd/howto/FunctionTemplate # More information at http://www.zope.org/Members/htrd/howto/FunctionTemplate
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self','value') __code__.co_varnames = ('self','value')
func_code.co_argcount = 2 __code__.co_argcount = 2
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, property_type, storage_id=None): def __init__(self, id, key, property_type, storage_id=None):
self._id = id self._id = id
...@@ -166,10 +166,10 @@ class DefaultGetter(Base.Getter): ...@@ -166,10 +166,10 @@ class DefaultGetter(Base.Getter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self',) __code__.co_varnames = ('self',)
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, property_type, default=None, storage_id=None): def __init__(self, id, key, property_type, default=None, storage_id=None):
self._id = id self._id = id
...@@ -219,10 +219,10 @@ class ListGetter(Base.Getter): ...@@ -219,10 +219,10 @@ class ListGetter(Base.Getter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self',) __code__.co_varnames = ('self',)
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
_list_type_list = tuple, list, set _list_type_list = tuple, list, set
......
...@@ -41,10 +41,10 @@ class DefaultGetter(BaseGetter): ...@@ -41,10 +41,10 @@ class DefaultGetter(BaseGetter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self', ) __code__.co_varnames = ('self', )
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, warning=0): def __init__(self, id, key, warning=0):
self._id = id self._id = id
...@@ -76,10 +76,10 @@ class ListGetter(BaseGetter): ...@@ -76,10 +76,10 @@ class ListGetter(BaseGetter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self', ) __code__.co_varnames = ('self', )
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, warning=0): def __init__(self, id, key, warning=0):
self._id = id self._id = id
......
...@@ -41,10 +41,10 @@ class DefaultGetter(BaseGetter): ...@@ -41,10 +41,10 @@ class DefaultGetter(BaseGetter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self', ) __code__.co_varnames = ('self', )
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, warning=0): def __init__(self, id, key, warning=0):
""" """
...@@ -83,10 +83,10 @@ class ListGetter(BaseGetter): ...@@ -83,10 +83,10 @@ class ListGetter(BaseGetter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self', ) __code__.co_varnames = ('self', )
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, warning=0): def __init__(self, id, key, warning=0):
""" """
...@@ -123,10 +123,10 @@ class DefaultPropertyGetter(BaseGetter): ...@@ -123,10 +123,10 @@ class DefaultPropertyGetter(BaseGetter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self', ) __code__.co_varnames = ('self', )
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, warning=0): def __init__(self, id, key, warning=0):
self._id = id self._id = id
...@@ -160,10 +160,10 @@ class PropertyListGetter(BaseGetter): ...@@ -160,10 +160,10 @@ class PropertyListGetter(BaseGetter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self', ) __code__.co_varnames = ('self', )
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, warning=0): def __init__(self, id, key, warning=0):
self._id = id self._id = id
......
...@@ -43,10 +43,10 @@ class TranslatedPropertyGetter(BaseGetter): ...@@ -43,10 +43,10 @@ class TranslatedPropertyGetter(BaseGetter):
Get the translated property Get the translated property
""" """
# This can be called from the Web # This can be called from the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self',) __code__.co_varnames = ('self',)
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, property_id, property_type, language, default=None, warning=0): def __init__(self, id, key, property_id, property_type, language, default=None, warning=0):
self._id = id self._id = id
...@@ -99,10 +99,10 @@ class PropertyTranslationDomainGetter(BaseGetter): ...@@ -99,10 +99,10 @@ class PropertyTranslationDomainGetter(BaseGetter):
_need__name__=1 _need__name__=1
# This can be called from the Web # This can be called from the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self', ) __code__.co_varnames = ('self', )
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, property_type, default=None, storage_id=None): def __init__(self, id, key, property_type, default=None, storage_id=None):
self._id = id self._id = id
...@@ -160,10 +160,10 @@ class TranslationPropertySetter(Accessor.Accessor): ...@@ -160,10 +160,10 @@ class TranslationPropertySetter(Accessor.Accessor):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
# More information at http://www.zope.org/Members/htrd/howto/FunctionTemplate # More information at http://www.zope.org/Members/htrd/howto/FunctionTemplate
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self', 'value') __code__.co_varnames = ('self', 'value')
func_code.co_argcount = 2 __code__.co_argcount = 2
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, property_id, property_type, language): def __init__(self, id, key, property_id, property_type, language):
self._id = id self._id = id
...@@ -223,10 +223,10 @@ class TranslatedPropertyTester(Method): ...@@ -223,10 +223,10 @@ class TranslatedPropertyTester(Method):
_need__name__=1 _need__name__=1
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self',) __code__.co_varnames = ('self',)
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, property_id, property_type, language, warning=0): def __init__(self, id, key, property_id, property_type, language, warning=0):
self._id = id self._id = id
......
...@@ -109,10 +109,10 @@ class DefaultGetter(BaseGetter): ...@@ -109,10 +109,10 @@ class DefaultGetter(BaseGetter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self', 'args', 'kw' ) __code__.co_varnames = ('self', 'args', 'kw' )
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, warning=0): def __init__(self, id, key, warning=0):
self._id = id self._id = id
...@@ -140,10 +140,10 @@ class ListGetter(BaseGetter): ...@@ -140,10 +140,10 @@ class ListGetter(BaseGetter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
# XXX This does not work yet completely in URL mode # XXX This does not work yet completely in URL mode
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self', 'args', 'kw' ) __code__.co_varnames = ('self', 'args', 'kw' )
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key, warning=0): def __init__(self, id, key, warning=0):
self._id = id self._id = id
......
...@@ -44,10 +44,10 @@ class Getter(BaseGetter): ...@@ -44,10 +44,10 @@ class Getter(BaseGetter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self',) __code__.co_varnames = ('self',)
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key): def __init__(self, id, key):
self._id = id self._id = id
...@@ -69,10 +69,10 @@ class TitleGetter(BaseGetter): ...@@ -69,10 +69,10 @@ class TitleGetter(BaseGetter):
# Generic Definition of Method Object # Generic Definition of Method Object
# This is required to call the method form the Web # This is required to call the method form the Web
func_code = func_code() __code__ = func_code = func_code()
func_code.co_varnames = ('self',) __code__.co_varnames = ('self',)
func_code.co_argcount = 1 __code__.co_argcount = 1
func_defaults = () __defaults__ = func_defaults = ()
def __init__(self, id, key): def __init__(self, id, key):
self._id = id self._id = id
......
...@@ -71,8 +71,8 @@ class InteractorMethod(Method): ...@@ -71,8 +71,8 @@ class InteractorMethod(Method):
self.after_action_list = [] self.after_action_list = []
self.before_action_list = [] self.before_action_list = []
self.method = method self.method = method
self.func_code = method.func_code self.__code__ = self.func_code = method.func_code
self.func_defaults = method.func_defaults self.__defaults__ = self.func_defaults = method.func_defaults
self.__name__ = method.__name__ self.__name__ = method.__name__
def registerBeforeAction(self, action, args, kw): def registerBeforeAction(self, action, args, kw):
......
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