Commit cb019bef authored by Vincent Pelletier's avatar Vincent Pelletier

Improve coding style.

Improve docstrings.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6868 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 339339d4
...@@ -27,31 +27,31 @@ ...@@ -27,31 +27,31 @@
############################################################################## ##############################################################################
try: try:
from Interface import Interface from Interface import Interface
except ImportError: except ImportError:
# for Zope versions before 2.6.0 # for Zope versions before 2.6.0
from Interface import Base as Interface from Interface import Base as Interface
class Coordinate(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(): def fromText(coordinate_text):
""" """
returns the coordinate as a text string modifies the coordinate according to the input text
""" """
pass pass
def fromText(coordinate_text):
"""
modifies the coordinate according to the input text
"""
pass
def standardTextFormat(): def standardTextFormat():
""" """
returns a string which defines the standard returns a string which defines the standard
string format for that coordinate string format for that coordinate
""" """
pass pass
...@@ -27,86 +27,85 @@ ...@@ -27,86 +27,85 @@
############################################################################## ##############################################################################
try: try:
from Interface import Interface from Interface import Interface
except ImportError: except ImportError:
# for Zope versions before 2.6.0 # for Zope versions before 2.6.0
from Interface import Base as Interface from Interface import Base as Interface
class Entity(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(): def getDefaultAddressStreetAddress():
""" """
Returns the default address as a text string Returns the default address street as a text string
""" """
pass 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 getDefaultAddressRegion(): def getDefaultAddressCity():
""" """
Returns the default address region as a text string Returns the default address city as a text string
""" """
pass pass
def getDefaultAddressZipCode(): def getDefaultAddressRegion():
""" """
Returns the default address zip code as a text string Returns the default address region as a text string
""" """
pass pass
def getDefaultTelephone(): def getDefaultAddressZipCode():
""" """
Returns the default telephone as a text string Returns the default address zip code as a text string
""" """
pass pass
def getDefaultFax(): def getDefaultTelephone():
""" """
Returns the default fax as a text string Returns the default telephone as a text string
""" """
pass pass
def getDefaultEmail(): def getDefaultFax():
""" """
Returns the default email as a text string Returns the default fax as a text string
""" """
pass pass
def setDefaultAddress(coordinate): def getDefaultEmail():
""" """
Updates the default address from a standard text string Returns the default email as a text string
""" """
pass pass
def setDefaultTelephone(coordinate): def setDefaultAddress(coordinate):
""" """
Updates the default telephone from a standard text string Updates the default address from a standard text string
""" """
pass pass
def setDefaultFax(coordinate): def setDefaultTelephone(coordinate):
""" """
Updates the default fax from a standard text string Updates the default telephone from a standard text string
""" """
pass pass
def setDefaultEmail(coordinate): def setDefaultFax(coordinate):
""" """
Updates the default email from a standard text string Updates the default fax from a standard text string
""" """
pass pass
def setDefaultEmail(coordinate):
"""
Updates the default email from a standard text string
"""
pass
...@@ -27,123 +27,126 @@ ...@@ -27,123 +27,126 @@
############################################################################## ##############################################################################
try: try:
from Interface import Interface from Interface import Interface
except ImportError: except ImportError:
# for Zope versions before 2.6.0 # for Zope versions before 2.6.0
from Interface import Base as Interface from Interface import Base as Interface
class Variated(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 returns a list or relative URLs which defines
variated. a discrete variation (ie. a list of category
""" memberships)
"""
# The following methods are intended to access to the pass
# variation value of a variated object. Discrete variations
# are based on categories. General variations are encapsulated def _setVariationCategoryList(node_list):
# into VariationValue instances. """
modifies the discrete variation of an
# Discrete Variation accessors variated instance by providing a list
def getVariationCategoryList(): of relative URLs
""" """
returns a list or relative URLs which defines pass
a discrete variation (ie. a list of category
memberships) def setVariationCategoryList(node_list):
""" """
pass modifies the discrete variation of an
variated instance by providing a list
def _setVariationCategoryList(node_list): of relative URLs
"""
modifies the discrete variation of an reindexes the object
variated instance by providing a list """
of relative URLs pass
"""
pass def getVariationBaseCategoryList(node_list):
"""
def setVariationCategoryList(node_list): returns a list of base category ids
""" which are used to define discrete variations
modifies the discrete variation of an for this instance
variated instance by providing a list """
of relative URLs pass
reindexes the object def _setVariationBaseCategoryList(node_list):
""" """
pass modifies the list of base category ids
which are used to define discrete variations
def getVariationBaseCategoryList(node_list): for this instance
""" """
returns a list of base category ids pass
which are used to define discrete variations
for this instance def setVariationBaseCategoryList(node_list):
""" """
pass modifies the list of base category ids
which are used to define discrete variations
def _setVariationBaseCategoryList(node_list): for this instance
""" """
modifies the list of base category ids pass
which are used to define discrete variations
for this instance # General Variation accessors
""" def getVariationValue():
pass """
Returns a VariationValue object.
def setVariationBaseCategoryList(node_list): """
""" pass
modifies the list of base category ids
which are used to define discrete variations def _setVariationValue(value):
for this instance """
""" Private setter for VariationValue.
pass """
pass
# General Variation accessors
def getVariationValue(): def setVariationValue(value):
""" """
""" Sets the VariationValue.
pass """
pass
def _setVariationValue(value):
"""
""" # The following methods are intended to access the
pass # variation range of a variated object. A Variation range can
# be defined in a Resource instance or in any object
def setVariationValue(value): # which has a relation with a Resource (Amount, Transformation)
"""
""" # Discrete Variation Range accessors
pass
def getVariationRangeCategoryList(base_category_list=(), base=1):
"""
# The following methods are intended to access the returns a list of categories which are acceptable
# variation range of a variated object. A Variation range can as discrete variation values
# be defined in a Resource instance or in any object """
# which has a relation with a Resource (Amount, Transformation) pass
# Discrete Variation Range accessors def getVariationRangeCategoryItemList(base_category_list=(),
display_id='getTitle', base=1, current_category=None):
def getVariationRangeCategoryList(base_category_list=(), base=1): """
""" returns a list of (category.id, category.display_id()) which are acceptable
returns a list of categories which are acceptable as discrete variation values
as discrete variation values """
""" pass
pass
def getVariationRangeBaseCategoryList(base_category_list=(), base=1):
def getVariationRangeCategoryItemList(base_category_list=(), """
display_id='getTitle', base=1, current_category=None): returns a list of base categories which are acceptable
""" as discrete variation values
returns a list of (category.id, category.display_id()) which are acceptable """
as discrete variation values pass
"""
pass def getVariationRangeBaseCategoryItemList(base_category_list=(),
display_id='getTitle', base=1, current_category=None):
def getVariationRangeBaseCategoryList(base_category_list=(), base=1): """
""" returns a list of base category items which are acceptable
returns a list of base categories which are acceptable as discrete variation values
as discrete variation values """
""" pass
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
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