Commit 494de48b authored by Romain Courteaud's avatar Romain Courteaud

Change indentation.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13410 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8a11ed75
############################################################################## ##############################################################################
# #
# Copyright (c) 2002-2003 Nexedi SARL and Contributors. All Rights Reserved. # Copyright (c) 2002-2007 Nexedi SARL and Contributors. All Rights Reserved.
# Jean-Paul Smets-Solanes <jp@nexedi.com> # Jean-Paul Smets-Solanes <jp@nexedi.com>
# #
# WARNING: This program as such is intended to be used by professional # WARNING: This program as such is intended to be used by professional
...@@ -51,7 +51,8 @@ class DefaultGetter(Method): ...@@ -51,7 +51,8 @@ class DefaultGetter(Method):
def __call__(self, instance, *args, **kw): def __call__(self, instance, *args, **kw):
if self._warning: if self._warning:
LOG("ERP5Type Deprecated Getter Id:",0, self._id) LOG("ERP5Type Deprecated Getter Id:",0, self._id)
return instance._getDefaultRelatedProperty(self._key, 'relative_url', return instance._getDefaultRelatedProperty(
self._key, 'relative_url',
spec=kw.get('spec',()), spec=kw.get('spec',()),
filter=kw.get('filter', None), filter=kw.get('filter', None),
portal_type=kw.get('portal_type',())) portal_type=kw.get('portal_type',()))
...@@ -82,7 +83,8 @@ class ListGetter(Method): ...@@ -82,7 +83,8 @@ class ListGetter(Method):
def __call__(self, instance, *args, **kw): def __call__(self, instance, *args, **kw):
if self._warning: if self._warning:
LOG("ERP5Type Deprecated Getter Id:",0, self._id) LOG("ERP5Type Deprecated Getter Id:",0, self._id)
return instance._getRelatedPropertyList(self._key, 'relative_url', return instance._getRelatedPropertyList(
self._key, 'relative_url',
spec=kw.get('spec',()), spec=kw.get('spec',()),
filter=kw.get('filter', None), filter=kw.get('filter', None),
portal_type=kw.get('portal_type',())) portal_type=kw.get('portal_type',()))
...@@ -97,4 +99,3 @@ class SetGetter(ListGetter): ...@@ -97,4 +99,3 @@ class SetGetter(ListGetter):
result_list = ListGetter.__call__(self, instance, *args, **kw) result_list = ListGetter.__call__(self, instance, *args, **kw)
result_set = dict([(x, 0) for x in result_list]).keys() result_set = dict([(x, 0) for x in result_list]).keys()
return result_set return result_set
############################################################################## ##############################################################################
# #
# Copyright (c) 2002-2003 Nexedi SARL and Contributors. All Rights Reserved. # Copyright (c) 2002-2007 Nexedi SARL and Contributors. All Rights Reserved.
# Jean-Paul Smets-Solanes <jp@nexedi.com> # Jean-Paul Smets-Solanes <jp@nexedi.com>
# #
# WARNING: This program as such is intended to be used by professional # WARNING: This program as such is intended to be used by professional
...@@ -43,8 +43,10 @@ class DefaultGetter(Method): ...@@ -43,8 +43,10 @@ class DefaultGetter(Method):
func_defaults = () func_defaults = ()
def __init__(self, id, key, warning=0): def __init__(self, id, key, warning=0):
""" 'warning' argument means that this category is deprecated in the """
property sheet, so the generated method will also be deprecated """ 'warning' argument means that this category is deprecated in the
property sheet, so the generated method will also be deprecated
"""
self._id = id self._id = id
self.__name__ = id self.__name__ = id
self._key = key self._key = key
...@@ -53,7 +55,8 @@ class DefaultGetter(Method): ...@@ -53,7 +55,8 @@ class DefaultGetter(Method):
def __call__(self, instance, *args, **kw): def __call__(self, instance, *args, **kw):
if self._warning: if self._warning:
LOG("ERP5Type Deprecated Getter Id:",0, self._id) LOG("ERP5Type Deprecated Getter Id:",0, self._id)
return instance._getDefaultRelatedValue(self._key, return instance._getDefaultRelatedValue(
self._key,
spec=kw.get('spec',()), spec=kw.get('spec',()),
filter=kw.get('filter', None), filter=kw.get('filter', None),
portal_type=kw.get('portal_type',()), portal_type=kw.get('portal_type',()),
...@@ -78,8 +81,10 @@ class ListGetter(Method): ...@@ -78,8 +81,10 @@ class ListGetter(Method):
func_defaults = () func_defaults = ()
def __init__(self, id, key, warning=0): def __init__(self, id, key, warning=0):
""" 'warning' argument means that this category is deprecated in the """
property sheet, so the generated method will also be deprecated """ 'warning' argument means that this category is deprecated in the
property sheet, so the generated method will also be deprecated
"""
self._id = id self._id = id
self.__name__ = id self.__name__ = id
self._key = key self._key = key
...@@ -88,7 +93,8 @@ class ListGetter(Method): ...@@ -88,7 +93,8 @@ class ListGetter(Method):
def __call__(self, instance, *args, **kw): def __call__(self, instance, *args, **kw):
if self._warning: if self._warning:
LOG("ERP5Type Deprecated Getter Id:",0, self._id) LOG("ERP5Type Deprecated Getter Id:",0, self._id)
return instance._getRelatedValueList(self._key, return instance._getRelatedValueList(
self._key,
spec=kw.get('spec',()), spec=kw.get('spec',()),
filter=kw.get('filter', None), filter=kw.get('filter', None),
portal_type=kw.get('portal_type',()), portal_type=kw.get('portal_type',()),
...@@ -106,7 +112,6 @@ class SetGetter(ListGetter): ...@@ -106,7 +112,6 @@ class SetGetter(ListGetter):
result_set = dict([(x, 0) for x in result_list]).keys() result_set = dict([(x, 0) for x in result_list]).keys()
return result_set return result_set
class DefaultIdGetter(Method): class DefaultIdGetter(Method):
""" """
Gets a default reference object Gets a default reference object
...@@ -129,7 +134,8 @@ class DefaultIdGetter(Method): ...@@ -129,7 +134,8 @@ class DefaultIdGetter(Method):
def __call__(self, instance, *args, **kw): def __call__(self, instance, *args, **kw):
if self._warning: if self._warning:
LOG("ERP5Type Deprecated Getter Id:",0, self._id) LOG("ERP5Type Deprecated Getter Id:",0, self._id)
return instance._getDefaultRelatedProperty(self._key, 'id', return instance._getDefaultRelatedProperty(
self._key, 'id',
spec=kw.get('spec',()), spec=kw.get('spec',()),
filter=kw.get('filter', None), filter=kw.get('filter', None),
portal_type=kw.get('portal_type',()), portal_type=kw.get('portal_type',()),
...@@ -163,7 +169,8 @@ class IdListGetter(Method): ...@@ -163,7 +169,8 @@ class IdListGetter(Method):
def __call__(self, instance, *args, **kw): def __call__(self, instance, *args, **kw):
if self._warning: if self._warning:
LOG("ERP5Type Deprecated Getter Id:",0, self._id) LOG("ERP5Type Deprecated Getter Id:",0, self._id)
return instance._getRelatedPropertyList(self._key, 'id', return instance._getRelatedPropertyList(
self._key, 'id',
spec=kw.get('spec',()), spec=kw.get('spec',()),
filter=kw.get('filter', None), filter=kw.get('filter', None),
portal_type=kw.get('portal_type',()), portal_type=kw.get('portal_type',()),
...@@ -203,7 +210,8 @@ class DefaultTitleGetter(Method): ...@@ -203,7 +210,8 @@ class DefaultTitleGetter(Method):
def __call__(self, instance, *args, **kw): def __call__(self, instance, *args, **kw):
if self._warning: if self._warning:
LOG("ERP5Type Deprecated Getter Id:",0, self._id) LOG("ERP5Type Deprecated Getter Id:",0, self._id)
return instance._getDefaultRelatedProperty(self._key, 'title', return instance._getDefaultRelatedProperty(
self._key, 'title',
spec=kw.get('spec',()), spec=kw.get('spec',()),
filter=kw.get('filter', None), filter=kw.get('filter', None),
portal_type=kw.get('portal_type',()), portal_type=kw.get('portal_type',()),
...@@ -236,7 +244,8 @@ class TitleListGetter(Method): ...@@ -236,7 +244,8 @@ class TitleListGetter(Method):
def __call__(self, instance, *args, **kw): def __call__(self, instance, *args, **kw):
if self._warning: if self._warning:
LOG("ERP5Type Deprecated Getter Id:",0, self._id) LOG("ERP5Type Deprecated Getter Id:",0, self._id)
return instance._getRelatedPropertyList(self._key, 'title', return instance._getRelatedPropertyList(
self._key, 'title',
spec=kw.get('spec',()), spec=kw.get('spec',()),
filter=kw.get('filter', None), filter=kw.get('filter', None),
portal_type=kw.get('portal_type',()), portal_type=kw.get('portal_type',()),
...@@ -253,7 +262,6 @@ class TitleSetGetter(TitleListGetter): ...@@ -253,7 +262,6 @@ class TitleSetGetter(TitleListGetter):
result_set = dict([(x, 0) for x in result_list]).keys() result_set = dict([(x, 0) for x in result_list]).keys()
return result_set return result_set
class DefaultPropertyGetter(Method): class DefaultPropertyGetter(Method):
""" """
Gets a default reference object Gets a default reference object
...@@ -276,7 +284,8 @@ class DefaultPropertyGetter(Method): ...@@ -276,7 +284,8 @@ class DefaultPropertyGetter(Method):
def __call__(self, instance, key, *args, **kw): def __call__(self, instance, key, *args, **kw):
if self._warning: if self._warning:
LOG("ERP5Type Deprecated Getter Id:",0, self._id) LOG("ERP5Type Deprecated Getter Id:",0, self._id)
return instance._getDefaultRelatedProperty(self._key, key, return instance._getDefaultRelatedProperty(
self._key, key,
spec=kw.get('spec',()), spec=kw.get('spec',()),
filter=kw.get('filter', None), filter=kw.get('filter', None),
portal_type=kw.get('portal_type',()), portal_type=kw.get('portal_type',()),
...@@ -308,7 +317,8 @@ class PropertyListGetter(Method): ...@@ -308,7 +317,8 @@ class PropertyListGetter(Method):
def __call__(self, instance, key, *args, **kw): def __call__(self, instance, key, *args, **kw):
if self._warning: if self._warning:
LOG("ERP5Type Deprecated Getter Id:",0, self._id) LOG("ERP5Type Deprecated Getter Id:",0, self._id)
return instance._getRelatedPropertyList(self._key, key, return instance._getRelatedPropertyList(
self._key, key,
spec=kw.get('spec',()), spec=kw.get('spec',()),
filter=kw.get('filter', None), filter=kw.get('filter', None),
portal_type=kw.get('portal_type',()), portal_type=kw.get('portal_type',()),
......
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