Commit f7b9498d authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

fixing typos and cosmetic changes only.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21500 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cd2f5333
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
# Romain Courteaud <romain@nexedi.com> # Romain Courteaud <romain@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
# programmers who take the whole responsability of assessing all potential # programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs # consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial # End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software # guarantees and support are strongly adviced to contract a Free Software
# Service Company # Service Company
# #
# This program is Free Software; you can redistribute it and/or # This program is Free Software; you can redistribute it and/or
...@@ -95,7 +95,7 @@ class RootMovementGroup: ...@@ -95,7 +95,7 @@ class RootMovementGroup:
# We are on a node group # We are on a node group
movement_list = self.getMovementList() movement_list = self.getMovementList()
if len(movement_list) > 0: if len(movement_list) > 0:
# We have a conflict here, because it is forbidden to have # We have a conflict here, because it is forbidden to have
# 2 movements on the same node group # 2 movements on the same node group
tmp_result = self._separate(movement) tmp_result = self._separate(movement)
self._movement_list, split_movement_list = tmp_result self._movement_list, split_movement_list = tmp_result
...@@ -112,19 +112,19 @@ class RootMovementGroup: ...@@ -112,19 +112,19 @@ class RootMovementGroup:
def setGroupEdit(self, **kw): def setGroupEdit(self, **kw):
""" """
Store properties for the futur created object Store properties for the futur created object
""" """
self._property_dict = kw self._property_dict = kw
def updateGroupEdit(self, **kw): def updateGroupEdit(self, **kw):
""" """
Update properties for the futur created object Update properties for the futur created object
""" """
self._property_dict.update(kw) self._property_dict.update(kw)
def getGroupEditDict(self): def getGroupEditDict(self):
""" """
Get property dict for the futur created object Get property dict for the futur created object
""" """
return getattr(self, '_property_dict', {}) return getattr(self, '_property_dict', {})
...@@ -165,7 +165,7 @@ class RootMovementGroup: ...@@ -165,7 +165,7 @@ class RootMovementGroup:
added_movement = None added_movement = None
else: else:
break break
return [new_stored_movement], [rejected_movement] return [new_stored_movement], [rejected_movement]
######################################################## ########################################################
...@@ -260,7 +260,7 @@ class OrderMovementGroup(RootMovementGroup): ...@@ -260,7 +260,7 @@ class OrderMovementGroup(RootMovementGroup):
allow_class(OrderMovementGroup) allow_class(OrderMovementGroup)
class CausalityAssignmentMovementGroup(RootMovementGroup): class CausalityAssignmentMovementGroup(RootMovementGroup):
""" """
This movement group is used in order to define the causality This movement group is used in order to define the causality
on lines and cells. on lines and cells.
""" """
...@@ -290,7 +290,7 @@ allow_class(CausalityAssignmentMovementGroup) ...@@ -290,7 +290,7 @@ allow_class(CausalityAssignmentMovementGroup)
class CausalityMovementGroup(RootMovementGroup): class CausalityMovementGroup(RootMovementGroup):
""" TODO: docstring """ """ TODO: docstring """
def __init__(self, movement, **kw): def __init__(self, movement, **kw):
RootMovementGroup.__init__(self, movement=movement, **kw) RootMovementGroup.__init__(self, movement=movement, **kw)
explanation_relative_url = self._getExplanationRelativeUrl(movement) explanation_relative_url = self._getExplanationRelativeUrl(movement)
...@@ -316,13 +316,13 @@ class CausalityMovementGroup(RootMovementGroup): ...@@ -316,13 +316,13 @@ class CausalityMovementGroup(RootMovementGroup):
# get the enclosing delivery for this cell or line # get the enclosing delivery for this cell or line
if hasattr(explanation_value, 'getExplanationValue') : if hasattr(explanation_value, 'getExplanationValue') :
explanation_value = explanation_value.getExplanationValue() explanation_value = explanation_value.getExplanationValue()
explanation_relative_url = explanation_value.getRelativeUrl() explanation_relative_url = explanation_value.getRelativeUrl()
return explanation_relative_url return explanation_relative_url
def test(self,movement): def test(self,movement):
return self._getExplanationRelativeUrl(movement) == self.explanation return self._getExplanationRelativeUrl(movement) == self.explanation
allow_class(CausalityMovementGroup) allow_class(CausalityMovementGroup)
class RootAppliedRuleCausalityMovementGroup(RootMovementGroup): class RootAppliedRuleCausalityMovementGroup(RootMovementGroup):
...@@ -345,10 +345,10 @@ class RootAppliedRuleCausalityMovementGroup(RootMovementGroup): ...@@ -345,10 +345,10 @@ class RootAppliedRuleCausalityMovementGroup(RootMovementGroup):
if explanation_value is not None: if explanation_value is not None:
explanation_relative_url = explanation_value.getRelativeUrl() explanation_relative_url = explanation_value.getRelativeUrl()
return explanation_relative_url return explanation_relative_url
def test(self,movement): def test(self,movement):
return self._getExplanationRelativeUrl(movement) == self.explanation return self._getExplanationRelativeUrl(movement) == self.explanation
allow_class(RootAppliedRuleCausalityMovementGroup) allow_class(RootAppliedRuleCausalityMovementGroup)
# Again add a strange movement group, it was first created for building # Again add a strange movement group, it was first created for building
...@@ -367,10 +367,10 @@ class ParentExplanationMovementGroup(RootMovementGroup): ...@@ -367,10 +367,10 @@ class ParentExplanationMovementGroup(RootMovementGroup):
def _getParentExplanationValue(self, movement): def _getParentExplanationValue(self, movement):
""" Get the order value for a movement """ """ Get the order value for a movement """
return movement.getParentValue().getExplanationValue() return movement.getParentValue().getExplanationValue()
def test(self,movement): def test(self,movement):
return self._getParentExplanationValue(movement) == self.explanation_value return self._getParentExplanationValue(movement) == self.explanation_value
allow_class(ParentExplanationMovementGroup) allow_class(ParentExplanationMovementGroup)
class PathMovementGroup(RootMovementGroup): class PathMovementGroup(RootMovementGroup):
...@@ -569,7 +569,7 @@ class DateMovementGroup(RootMovementGroup): ...@@ -569,7 +569,7 @@ class DateMovementGroup(RootMovementGroup):
allow_class(DateMovementGroup) allow_class(DateMovementGroup)
class CriterionMovementGroup(RootMovementGroup): class CriterionMovementGroup(RootMovementGroup):
def __init__(self,movement,**kw): def __init__(self,movement,**kw):
RootMovementGroup.__init__(self, movement=movement, **kw) RootMovementGroup.__init__(self, movement=movement, **kw)
if hasattr(movement, 'getGroupCriterion'): if hasattr(movement, 'getGroupCriterion'):
...@@ -791,7 +791,7 @@ class FakeMovement: ...@@ -791,7 +791,7 @@ class FakeMovement:
if variation_category not in reference_variation_category_list: if variation_category not in reference_variation_category_list:
error_raising_needed = 1 error_raising_needed = 1
break break
if error_raising_needed == 1: if error_raising_needed == 1:
raise ValueError, "FakeMovement not well used." raise ValueError, "FakeMovement not well used."
...@@ -811,7 +811,7 @@ class FakeMovement: ...@@ -811,7 +811,7 @@ class FakeMovement:
Return content movement list Return content movement list
""" """
return self.__movement_list return self.__movement_list
def setDeliveryValue(self, object): def setDeliveryValue(self, object):
""" """
Set Delivery value for each movement Set Delivery value for each movement
...@@ -835,7 +835,7 @@ class FakeMovement: ...@@ -835,7 +835,7 @@ class FakeMovement:
def getRelativeUrl(self): def getRelativeUrl(self):
""" """
Only use to return a short description of one movement Only use to return a short description of one movement
(if user did not configure DeliveryBuilder well...). (if user did not configure DeliveryBuilder well...).
Be careful. Be careful.
""" """
...@@ -858,7 +858,7 @@ class FakeMovement: ...@@ -858,7 +858,7 @@ class FakeMovement:
mvt_ratio = 1 / len(self.__movement_list) mvt_ratio = 1 / len(self.__movement_list)
for movement in self.__movement_list: for movement in self.__movement_list:
movement.edit(delivery_ratio=mvt_ratio) movement.edit(delivery_ratio=mvt_ratio)
def getPrice(self): def getPrice(self):
""" """
Return calculated price Return calculated price
...@@ -867,7 +867,7 @@ class FakeMovement: ...@@ -867,7 +867,7 @@ class FakeMovement:
return getattr(self, self.__price_method)() return getattr(self, self.__price_method)()
else: else:
return None return None
def setPriceMethod(self, method): def setPriceMethod(self, method):
""" """
Set the price method Set the price method
...@@ -879,7 +879,7 @@ class FakeMovement: ...@@ -879,7 +879,7 @@ class FakeMovement:
Return calculated quantity Return calculated quantity
""" """
return getattr(self, self.__quantity_method)() return getattr(self, self.__quantity_method)()
def setQuantityMethod(self, method): def setQuantityMethod(self, method):
""" """
Set the quantity method Set the quantity method
...@@ -888,7 +888,7 @@ class FakeMovement: ...@@ -888,7 +888,7 @@ class FakeMovement:
def getAveragePrice(self): def getAveragePrice(self):
""" """
Return average price Return average price
""" """
if self.getAddQuantity()>0: if self.getAddQuantity()>0:
return (self.getAddPrice() / self.getAddQuantity()) return (self.getAddPrice() / self.getAddQuantity())
...@@ -907,7 +907,7 @@ class FakeMovement: ...@@ -907,7 +907,7 @@ class FakeMovement:
def getAddPrice(self): def getAddPrice(self):
""" """
Return total price Return total price
""" """
total_price = 0 total_price = 0
for movement in self.getMovementList(): for movement in self.getMovementList():
...@@ -1110,9 +1110,9 @@ class SplitMovementGroup(RootMovementGroup): ...@@ -1110,9 +1110,9 @@ class SplitMovementGroup(RootMovementGroup):
allow_class(SplitMovementGroup) allow_class(SplitMovementGroup)
class TransformationAppliedRuleCausalityMovementGroup(RootMovementGroup): class TransformationAppliedRuleCausalityMovementGroup(RootMovementGroup):
""" """
Groups movement that comes from simulation movement that shares the Groups movement that comes from simulation movement that shares the
same Production Applied Rule. same Production Applied Rule.
""" """
def __init__(self, movement, **kw): def __init__(self, movement, **kw):
RootMovementGroup.__init__(self, movement=movement, **kw) RootMovementGroup.__init__(self, movement=movement, **kw)
...@@ -1128,11 +1128,11 @@ class TransformationAppliedRuleCausalityMovementGroup(RootMovementGroup): ...@@ -1128,11 +1128,11 @@ class TransformationAppliedRuleCausalityMovementGroup(RootMovementGroup):
transformation_rule = transformation_applied_rule.getSpecialiseValue() transformation_rule = transformation_applied_rule.getSpecialiseValue()
if transformation_rule.getPortalType() != 'Transformation Rule': if transformation_rule.getPortalType() != 'Transformation Rule':
raise MovementGroupError, 'movement! %s' % movement.getPath() raise MovementGroupError, 'movement! %s' % movement.getPath()
# XXX Dirty hardcoded # XXX Dirty hardcoded
production_movement = transformation_applied_rule.pr production_movement = transformation_applied_rule.pr
production_packing_list = production_movement.getExplanationValue() production_packing_list = production_movement.getExplanationValue()
return production_packing_list.getRelativeUrl() return production_packing_list.getRelativeUrl()
def test(self,movement): def test(self,movement):
return self._getExplanationRelativeUrl(movement) == self.explanation return self._getExplanationRelativeUrl(movement) == self.explanation
...@@ -1238,5 +1238,3 @@ class PaymentModeMovementGroup(PropertyMovementGroup): ...@@ -1238,5 +1238,3 @@ class PaymentModeMovementGroup(PropertyMovementGroup):
class ColourMovementGroup(RootMovementGroup): class ColourMovementGroup(RootMovementGroup):
""" Group movements that have the same colour category.""" """ Group movements that have the same colour category."""
_property = 'colour' _property = 'colour'
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