From cb019befe9b4827d36e2ff8f7c3fb4eb8b016bc9 Mon Sep 17 00:00:00 2001 From: Vincent Pelletier <vincent@nexedi.com> Date: Mon, 24 Apr 2006 08:43:04 +0000 Subject: [PATCH] Improve coding style. Improve docstrings. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6868 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/Interface/Coordinate.py | 42 ++--- product/ERP5/Interface/Entity.py | 131 ++++++++------- product/ERP5/Interface/Variated.py | 235 ++++++++++++++------------- 3 files changed, 205 insertions(+), 203 deletions(-) diff --git a/product/ERP5/Interface/Coordinate.py b/product/ERP5/Interface/Coordinate.py index 093e25c6ff..2a4f2eaeb9 100644 --- a/product/ERP5/Interface/Coordinate.py +++ b/product/ERP5/Interface/Coordinate.py @@ -27,31 +27,31 @@ ############################################################################## try: - from Interface import Interface + from Interface import Interface except ImportError: - # for Zope versions before 2.6.0 - from Interface import Base as Interface + # for Zope versions before 2.6.0 + from Interface import Base as Interface class Coordinate(Interface): + """ + Common Interface for all Coordinate objects + """ + + def asText(): """ - Common Interface for all Coordinate objects + returns the coordinate as a text string """ + pass - def asText(): - """ - returns the coordinate as a text string - """ - pass - - def fromText(coordinate_text): - """ - modifies the coordinate according to the input text - """ - pass + def fromText(coordinate_text): + """ + modifies the coordinate according to the input text + """ + pass - def standardTextFormat(): - """ - returns a string which defines the standard - string format for that coordinate - """ - pass + def standardTextFormat(): + """ + returns a string which defines the standard + string format for that coordinate + """ + pass diff --git a/product/ERP5/Interface/Entity.py b/product/ERP5/Interface/Entity.py index 8198681033..8498db6623 100644 --- a/product/ERP5/Interface/Entity.py +++ b/product/ERP5/Interface/Entity.py @@ -27,86 +27,85 @@ ############################################################################## try: - from Interface import Interface + from Interface import Interface except ImportError: - # for Zope versions before 2.6.0 - from Interface import Base as Interface + # for Zope versions before 2.6.0 + from Interface import Base as Interface class Entity(Interface): + """ + Common Interface for Entity objects + """ + + def getDefaultAddress(): """ - Common Interface for Entity objects + Returns the default address as a text string """ + pass - def getDefaultAddress(): - """ - Returns the default address as a text string - """ - pass - - def getDefaultAddressStreetAddress(): - """ - Returns the default address street as a text string - """ - pass - - def getDefaultAddressCity(): - """ - Returns the default address city as a text string - """ - pass + def getDefaultAddressStreetAddress(): + """ + Returns the default address street as a text string + """ + pass - def getDefaultAddressRegion(): - """ - Returns the default address region as a text string - """ - pass + def getDefaultAddressCity(): + """ + Returns the default address city as a text string + """ + pass - def getDefaultAddressZipCode(): - """ - Returns the default address zip code as a text string - """ - pass + def getDefaultAddressRegion(): + """ + Returns the default address region as a text string + """ + pass - def getDefaultTelephone(): - """ - Returns the default telephone as a text string - """ - pass + def getDefaultAddressZipCode(): + """ + Returns the default address zip code as a text string + """ + pass - def getDefaultFax(): - """ - Returns the default fax as a text string - """ - pass + def getDefaultTelephone(): + """ + Returns the default telephone as a text string + """ + pass - def getDefaultEmail(): - """ - Returns the default email as a text string - """ - pass + def getDefaultFax(): + """ + Returns the default fax as a text string + """ + pass - def setDefaultAddress(coordinate): - """ - Updates the default address from a standard text string - """ - pass + def getDefaultEmail(): + """ + Returns the default email as a text string + """ + pass - def setDefaultTelephone(coordinate): - """ - Updates the default telephone from a standard text string - """ - pass + def setDefaultAddress(coordinate): + """ + Updates the default address from a standard text string + """ + pass - def setDefaultFax(coordinate): - """ - Updates the default fax from a standard text string - """ - pass + def setDefaultTelephone(coordinate): + """ + Updates the default telephone from a standard text string + """ + pass - def setDefaultEmail(coordinate): - """ - Updates the default email from a standard text string - """ - pass + def setDefaultFax(coordinate): + """ + Updates the default fax from a standard text string + """ + pass + def setDefaultEmail(coordinate): + """ + Updates the default email from a standard text string + """ + pass diff --git a/product/ERP5/Interface/Variated.py b/product/ERP5/Interface/Variated.py index 1632c8954c..3906e45ecc 100644 --- a/product/ERP5/Interface/Variated.py +++ b/product/ERP5/Interface/Variated.py @@ -27,123 +27,126 @@ ############################################################################## try: - from Interface import Interface + from Interface import Interface except ImportError: - # for Zope versions before 2.6.0 - from Interface import Base as Interface + # for Zope versions before 2.6.0 + from Interface import Base as Interface class Variated(Interface): + """ + Common Interface for all objects which can be + variated. + """ + + # The following methods are intended to access to the + # variation value of a variated object. Discrete variations + # are based on categories. General variations are encapsulated + # into VariationValue instances. + + # Discrete Variation accessors + def getVariationCategoryList(): """ - Common Interface for all objects which can be - variated. - """ - - # The following methods are intended to access to the - # variation value of a variated object. Discrete variations - # are based on categories. General variations are encapsulated - # into VariationValue instances. - - # Discrete Variation accessors - def getVariationCategoryList(): - """ - returns a list or relative URLs which defines - a discrete variation (ie. a list of category - memberships) - """ - pass - - def _setVariationCategoryList(node_list): - """ - modifies the discrete variation of an - variated instance by providing a list - of relative URLs - """ - pass - - def setVariationCategoryList(node_list): - """ - modifies the discrete variation of an - variated instance by providing a list - of relative URLs - - reindexes the object - """ - pass - - def getVariationBaseCategoryList(node_list): - """ - returns a list of base category ids - which are used to define discrete variations - for this instance - """ - pass - - def _setVariationBaseCategoryList(node_list): - """ - modifies the list of base category ids - which are used to define discrete variations - for this instance - """ - pass - - def setVariationBaseCategoryList(node_list): - """ - modifies the list of base category ids - which are used to define discrete variations - for this instance - """ - pass - - # General Variation accessors - def getVariationValue(): - """ - """ - pass - - def _setVariationValue(value): - """ - """ - pass - - def setVariationValue(value): - """ - """ - pass - - - # The following methods are intended to access the - # variation range of a variated object. A Variation range can - # be defined in a Resource instance or in any object - # which has a relation with a Resource (Amount, Transformation) - - # Discrete Variation Range accessors - - def getVariationRangeCategoryList(base_category_list=(), base=1): - """ - returns a list of categories which are acceptable - as discrete variation values - """ - pass - - def getVariationRangeCategoryItemList(base_category_list=(), - display_id='getTitle', base=1, current_category=None): - """ - returns a list of (category.id, category.display_id()) which are acceptable - as discrete variation values - """ - pass - - def getVariationRangeBaseCategoryList(base_category_list=(), base=1): - """ - returns a list of base categories which are acceptable - as discrete variation values - """ - pass - - def getVariationRangeBaseCategoryItemList(base_category_list=(), - display_id='getTitle', base=1, current_category=None): - """ - returns a list of base category items which are acceptable - as discrete variation values - """ - pass + returns a list or relative URLs which defines + a discrete variation (ie. a list of category + memberships) + """ + pass + + def _setVariationCategoryList(node_list): + """ + modifies the discrete variation of an + variated instance by providing a list + of relative URLs + """ + pass + + def setVariationCategoryList(node_list): + """ + modifies the discrete variation of an + variated instance by providing a list + of relative URLs + + reindexes the object + """ + pass + + def getVariationBaseCategoryList(node_list): + """ + returns a list of base category ids + which are used to define discrete variations + for this instance + """ + pass + + def _setVariationBaseCategoryList(node_list): + """ + modifies the list of base category ids + which are used to define discrete variations + for this instance + """ + pass + + def setVariationBaseCategoryList(node_list): + """ + modifies the list of base category ids + which are used to define discrete variations + for this instance + """ + pass + + # General Variation accessors + def getVariationValue(): + """ + Returns a VariationValue object. + """ + pass + + def _setVariationValue(value): + """ + Private setter for VariationValue. + """ + pass + + def setVariationValue(value): + """ + Sets the VariationValue. + """ + pass + + + # The following methods are intended to access the + # variation range of a variated object. A Variation range can + # be defined in a Resource instance or in any object + # which has a relation with a Resource (Amount, Transformation) + + # Discrete Variation Range accessors + + def getVariationRangeCategoryList(base_category_list=(), base=1): + """ + returns a list of categories which are acceptable + as discrete variation values + """ + pass + + def getVariationRangeCategoryItemList(base_category_list=(), + display_id='getTitle', base=1, current_category=None): + """ + returns a list of (category.id, category.display_id()) which are acceptable + as discrete variation values + """ + pass + + def getVariationRangeBaseCategoryList(base_category_list=(), base=1): + """ + returns a list of base categories which are acceptable + as discrete variation values + """ + pass + + def getVariationRangeBaseCategoryItemList(base_category_list=(), + display_id='getTitle', base=1, current_category=None): + """ + returns a list of base category items which are acceptable + as discrete variation values + """ + pass -- 2.30.9