Commit 1336f0cb authored by Nicolas Delaby's avatar Nicolas Delaby

cleanup trailing spaces


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39597 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 65e4b130
# -*- coding: utf-8 -*-
############################################################################## ##############################################################################
# #
# Copyright (c) 2002, 2005 Nexedi SARL and Contributors. All Rights Reserved. # Copyright (c) 2002, 2005 Nexedi SARL and Contributors. All Rights Reserved.
...@@ -81,8 +82,8 @@ class Resource(XMLMatrix, Variated): ...@@ -81,8 +82,8 @@ class Resource(XMLMatrix, Variated):
# Some genericity is needed # Some genericity is needed
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getVariationRangeCategoryItemList') 'getVariationRangeCategoryItemList')
def getVariationRangeCategoryItemList(self, base_category_list=(), base=1, def getVariationRangeCategoryItemList(self, base_category_list=(), base=1,
root=1, display_id='title', root=1, display_id='title',
display_base_category=1, display_base_category=1,
current_category=None, current_category=None,
omit_individual_variation=0, **kw): omit_individual_variation=0, **kw):
...@@ -91,7 +92,7 @@ class Resource(XMLMatrix, Variated): ...@@ -91,7 +92,7 @@ class Resource(XMLMatrix, Variated):
resource.getVariationRangeCategoryItemList resource.getVariationRangeCategoryItemList
=> [(display, value)] => [(display, value)]
## Variation API (exemple) ## ## Variation API (exemple) ##
Base categories defined: Base categories defined:
- colour - colour
...@@ -128,7 +129,7 @@ class Resource(XMLMatrix, Variated): ...@@ -128,7 +129,7 @@ class Resource(XMLMatrix, Variated):
individual_variation_list] individual_variation_list]
other_base_category_dict = dict([(i,1) for i in base_category_list]) other_base_category_dict = dict([(i,1) for i in base_category_list])
if not omit_individual_variation: if not omit_individual_variation:
for variation in individual_variation_list: for variation in individual_variation_list:
for base_category in variation.getVariationBaseCategoryList(): for base_category in variation.getVariationBaseCategoryList():
if base_category_list is ()\ if base_category_list is ()\
...@@ -174,7 +175,7 @@ class Resource(XMLMatrix, Variated): ...@@ -174,7 +175,7 @@ class Resource(XMLMatrix, Variated):
""" """
base_category_list = base_category_list or \ base_category_list = base_category_list or \
self.getVariationBaseCategoryList() self.getVariationBaseCategoryList()
individual_bc_list = self.getIndividualVariationBaseCategoryList() individual_bc_list = self.getIndividualVariationBaseCategoryList()
other_bc_list = [x for x in base_category_list other_bc_list = [x for x in base_category_list
if not x in individual_bc_list] if not x in individual_bc_list]
...@@ -185,13 +186,13 @@ class Resource(XMLMatrix, Variated): ...@@ -185,13 +186,13 @@ class Resource(XMLMatrix, Variated):
if optional_bc_list: if optional_bc_list:
other_bc_list = [x for x in other_bc_list other_bc_list = [x for x in other_bc_list
if not x in optional_bc_list] if not x in optional_bc_list]
result = Variated.getVariationCategoryItemList(self, result = Variated.getVariationCategoryItemList(self,
base_category_list=other_bc_list, base_category_list=other_bc_list,
display_base_category=display_base_category, display_base_category=display_base_category,
display_id=display_id, base=base, **kw) display_id=display_id, base=base, **kw)
if not omit_individual_variation: if not omit_individual_variation:
individual_variation_list = self.searchFolder( individual_variation_list = self.searchFolder(
portal_type=self.getPortalVariationTypeList()) portal_type=self.getPortalVariationTypeList())
...@@ -375,7 +376,7 @@ class Resource(XMLMatrix, Variated): ...@@ -375,7 +376,7 @@ class Resource(XMLMatrix, Variated):
#################################################### ####################################################
# Stock Management # Stock Management
#################################################### ####################################################
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getInventory') 'getInventory')
def getInventory(self, **kw): def getInventory(self, **kw):
""" """
...@@ -385,7 +386,7 @@ class Resource(XMLMatrix, Variated): ...@@ -385,7 +386,7 @@ class Resource(XMLMatrix, Variated):
portal_simulation = getToolByName(self, 'portal_simulation') portal_simulation = getToolByName(self, 'portal_simulation')
return portal_simulation.getInventory(**kw) return portal_simulation.getInventory(**kw)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getCurrentInventory') 'getCurrentInventory')
def getCurrentInventory(self, **kw): def getCurrentInventory(self, **kw):
""" """
...@@ -395,7 +396,7 @@ class Resource(XMLMatrix, Variated): ...@@ -395,7 +396,7 @@ class Resource(XMLMatrix, Variated):
portal_simulation = getToolByName(self, 'portal_simulation') portal_simulation = getToolByName(self, 'portal_simulation')
return portal_simulation.getCurrentInventory(**kw) return portal_simulation.getCurrentInventory(**kw)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getAvailableInventory') 'getAvailableInventory')
def getAvailableInventory(self, **kw): def getAvailableInventory(self, **kw):
""" """
...@@ -406,7 +407,7 @@ class Resource(XMLMatrix, Variated): ...@@ -406,7 +407,7 @@ class Resource(XMLMatrix, Variated):
portal_simulation = getToolByName(self, 'portal_simulation') portal_simulation = getToolByName(self, 'portal_simulation')
return portal_simulation.getAvailableInventory(**kw) return portal_simulation.getAvailableInventory(**kw)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getFutureInventory') 'getFutureInventory')
def getFutureInventory(self, **kw): def getFutureInventory(self, **kw):
""" """
...@@ -416,7 +417,7 @@ class Resource(XMLMatrix, Variated): ...@@ -416,7 +417,7 @@ class Resource(XMLMatrix, Variated):
portal_simulation = getToolByName(self, 'portal_simulation') portal_simulation = getToolByName(self, 'portal_simulation')
return portal_simulation.getFutureInventory(**kw) return portal_simulation.getFutureInventory(**kw)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getInventoryList') 'getInventoryList')
def getInventoryList(self, **kw): def getInventoryList(self, **kw):
""" """
...@@ -426,7 +427,7 @@ class Resource(XMLMatrix, Variated): ...@@ -426,7 +427,7 @@ class Resource(XMLMatrix, Variated):
portal_simulation = getToolByName(self, 'portal_simulation') portal_simulation = getToolByName(self, 'portal_simulation')
return portal_simulation.getInventoryList(**kw) return portal_simulation.getInventoryList(**kw)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getCurrentInventoryList') 'getCurrentInventoryList')
def getCurrentInventoryList(self, **kw): def getCurrentInventoryList(self, **kw):
""" """
...@@ -436,7 +437,7 @@ class Resource(XMLMatrix, Variated): ...@@ -436,7 +437,7 @@ class Resource(XMLMatrix, Variated):
portal_simulation = getToolByName(self, 'portal_simulation') portal_simulation = getToolByName(self, 'portal_simulation')
return portal_simulation.getCurrentInventoryList(**kw) return portal_simulation.getCurrentInventoryList(**kw)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getAvailableInventoryList') 'getAvailableInventoryList')
def getAvailableInventoryList(self, **kw): def getAvailableInventoryList(self, **kw):
""" """
...@@ -446,7 +447,7 @@ class Resource(XMLMatrix, Variated): ...@@ -446,7 +447,7 @@ class Resource(XMLMatrix, Variated):
portal_simulation = getToolByName(self, 'portal_simulation') portal_simulation = getToolByName(self, 'portal_simulation')
return portal_simulation.getAvailableInventoryList(**kw) return portal_simulation.getAvailableInventoryList(**kw)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getFutureInventoryList') 'getFutureInventoryList')
def getFutureInventoryList(self, **kw): def getFutureInventoryList(self, **kw):
""" """
...@@ -456,7 +457,7 @@ class Resource(XMLMatrix, Variated): ...@@ -456,7 +457,7 @@ class Resource(XMLMatrix, Variated):
portal_simulation = getToolByName(self, 'portal_simulation') portal_simulation = getToolByName(self, 'portal_simulation')
return portal_simulation.getFutureInventoryList(**kw) return portal_simulation.getFutureInventoryList(**kw)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getInventoryStat') 'getInventoryStat')
def getInventoryStat(self, **kw): def getInventoryStat(self, **kw):
""" """
...@@ -466,7 +467,7 @@ class Resource(XMLMatrix, Variated): ...@@ -466,7 +467,7 @@ class Resource(XMLMatrix, Variated):
portal_simulation = getToolByName(self, 'portal_simulation') portal_simulation = getToolByName(self, 'portal_simulation')
return portal_simulation.getInventoryStat(**kw) return portal_simulation.getInventoryStat(**kw)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getCurrentInventoryStat') 'getCurrentInventoryStat')
def getCurrentInventoryStat(self, **kw): def getCurrentInventoryStat(self, **kw):
""" """
...@@ -486,7 +487,7 @@ class Resource(XMLMatrix, Variated): ...@@ -486,7 +487,7 @@ class Resource(XMLMatrix, Variated):
portal_simulation = getToolByName(self, 'portal_simulation') portal_simulation = getToolByName(self, 'portal_simulation')
return portal_simulation.getAvailableInventoryStat(**kw) return portal_simulation.getAvailableInventoryStat(**kw)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getFutureInventoryStat') 'getFutureInventoryStat')
def getFutureInventoryStat(self, **kw): def getFutureInventoryStat(self, **kw):
""" """
...@@ -496,7 +497,7 @@ class Resource(XMLMatrix, Variated): ...@@ -496,7 +497,7 @@ class Resource(XMLMatrix, Variated):
portal_simulation = getToolByName(self, 'portal_simulation') portal_simulation = getToolByName(self, 'portal_simulation')
return portal_simulation.getFutureInventoryStat(**kw) return portal_simulation.getFutureInventoryStat(**kw)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getInventoryChart') 'getInventoryChart')
def getInventoryChart(self, **kw): def getInventoryChart(self, **kw):
""" """
...@@ -506,7 +507,7 @@ class Resource(XMLMatrix, Variated): ...@@ -506,7 +507,7 @@ class Resource(XMLMatrix, Variated):
portal_simulation = getToolByName(self, 'portal_simulation') portal_simulation = getToolByName(self, 'portal_simulation')
return portal_simulation.getInventoryChart(**kw) return portal_simulation.getInventoryChart(**kw)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getCurrentInventoryChart') 'getCurrentInventoryChart')
def getCurrentInventoryChart(self, **kw): def getCurrentInventoryChart(self, **kw):
""" """
...@@ -516,7 +517,7 @@ class Resource(XMLMatrix, Variated): ...@@ -516,7 +517,7 @@ class Resource(XMLMatrix, Variated):
portal_simulation = getToolByName(self, 'portal_simulation') portal_simulation = getToolByName(self, 'portal_simulation')
return portal_simulation.getCurrentInventoryChart(**kw) return portal_simulation.getCurrentInventoryChart(**kw)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getFutureInventoryChart') 'getFutureInventoryChart')
def getFutureInventoryChart(self, **kw): def getFutureInventoryChart(self, **kw):
""" """
...@@ -526,7 +527,7 @@ class Resource(XMLMatrix, Variated): ...@@ -526,7 +527,7 @@ class Resource(XMLMatrix, Variated):
portal_simulation = getToolByName(self, 'portal_simulation') portal_simulation = getToolByName(self, 'portal_simulation')
return portal_simulation.getFutureInventoryChart(**kw) return portal_simulation.getFutureInventoryChart(**kw)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getInventoryHistoryList') 'getInventoryHistoryList')
def getInventoryHistoryList(self, **kw): def getInventoryHistoryList(self, **kw):
""" """
...@@ -536,7 +537,7 @@ class Resource(XMLMatrix, Variated): ...@@ -536,7 +537,7 @@ class Resource(XMLMatrix, Variated):
portal_simulation = getToolByName(self, 'portal_simulation') portal_simulation = getToolByName(self, 'portal_simulation')
return portal_simulation.getInventoryHistoryList(**kw) return portal_simulation.getInventoryHistoryList(**kw)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getInventoryHistoryChart') 'getInventoryHistoryChart')
def getInventoryHistoryChart(self, **kw): def getInventoryHistoryChart(self, **kw):
""" """
...@@ -550,7 +551,7 @@ class Resource(XMLMatrix, Variated): ...@@ -550,7 +551,7 @@ class Resource(XMLMatrix, Variated):
# Method getCurrentMovementHistoryList, # Method getCurrentMovementHistoryList,
# getAvailableMovementHistoryList, getFutureMovementHistoryList # getAvailableMovementHistoryList, getFutureMovementHistoryList
# can be added # can be added
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getMovementHistoryList') 'getMovementHistoryList')
def getMovementHistoryList(self, **kw): def getMovementHistoryList(self, **kw):
""" """
...@@ -560,7 +561,7 @@ class Resource(XMLMatrix, Variated): ...@@ -560,7 +561,7 @@ class Resource(XMLMatrix, Variated):
portal_simulation = getToolByName(self, 'portal_simulation') portal_simulation = getToolByName(self, 'portal_simulation')
return portal_simulation.getMovementHistoryList(**kw) return portal_simulation.getMovementHistoryList(**kw)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getMovementHistoryStat') 'getMovementHistoryStat')
def getMovementHistoryStat(self, **kw): def getMovementHistoryStat(self, **kw):
""" """
...@@ -570,7 +571,7 @@ class Resource(XMLMatrix, Variated): ...@@ -570,7 +571,7 @@ class Resource(XMLMatrix, Variated):
portal_simulation = getToolByName(self, 'portal_simulation') portal_simulation = getToolByName(self, 'portal_simulation')
return portal_simulation.getMovementHistoryStat(**kw) return portal_simulation.getMovementHistoryStat(**kw)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getNextNegativeInventoryDate') 'getNextNegativeInventoryDate')
def getNextNegativeInventoryDate(self, **kw): def getNextNegativeInventoryDate(self, **kw):
""" """
...@@ -639,7 +640,7 @@ class Resource(XMLMatrix, Variated): ...@@ -639,7 +640,7 @@ class Resource(XMLMatrix, Variated):
return None return None
# Predicate handling # Predicate handling
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'asPredicate') 'asPredicate')
def asPredicate(self): def asPredicate(self):
""" """
...@@ -658,7 +659,7 @@ class Resource(XMLMatrix, Variated): ...@@ -658,7 +659,7 @@ class Resource(XMLMatrix, Variated):
return -1 # a defines a destination section and wins return -1 # a defines a destination section and wins
return 1 # a defines no destination section and loses return 1 # a defines no destination section and loses
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getPriceParameterDict') 'getPriceParameterDict')
def getPriceParameterDict(self, context=None, REQUEST=None, def getPriceParameterDict(self, context=None, REQUEST=None,
supply_path_type=None, **kw): supply_path_type=None, **kw):
...@@ -731,7 +732,7 @@ class Resource(XMLMatrix, Variated): ...@@ -731,7 +732,7 @@ class Resource(XMLMatrix, Variated):
price_parameter_dict[price_parameter_name] = \ price_parameter_dict[price_parameter_name] = \
price_parameter_value[0] price_parameter_value[0]
return price_parameter_dict return price_parameter_dict
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getPricingVariable') 'getPricingVariable')
def getPricingVariable(self, context=None): def getPricingVariable(self, context=None):
...@@ -752,7 +753,7 @@ class Resource(XMLMatrix, Variated): ...@@ -752,7 +753,7 @@ class Resource(XMLMatrix, Variated):
return 0.0 return 0.0
return float(method()) return float(method())
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getPriceCalculationOperandDict') 'getPriceCalculationOperandDict')
def getPriceCalculationOperandDict(self, default=None, context=None, def getPriceCalculationOperandDict(self, default=None, context=None,
REQUEST=None, **kw): REQUEST=None, **kw):
...@@ -849,7 +850,7 @@ class Resource(XMLMatrix, Variated): ...@@ -849,7 +850,7 @@ class Resource(XMLMatrix, Variated):
return {'price': unit_base_price} return {'price': unit_base_price}
return default return default
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getPrice') 'getPrice')
def getPrice(self, default=None, context=None, REQUEST=None, **kw): def getPrice(self, default=None, context=None, REQUEST=None, **kw):
""" """
...@@ -864,14 +865,14 @@ class Resource(XMLMatrix, Variated): ...@@ -864,14 +865,14 @@ class Resource(XMLMatrix, Variated):
LOG('ERP5', WARNING, msg) LOG('ERP5', WARNING, msg)
context = default context = default
default = None default = None
operand_dict = self.getPriceCalculationOperandDict(default=default, operand_dict = self.getPriceCalculationOperandDict(default=default,
context=context, REQUEST=REQUEST, **kw) context=context, REQUEST=REQUEST, **kw)
if operand_dict is not None: if operand_dict is not None:
return operand_dict['price'] return operand_dict['price']
return default return default
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getQuantityPrecision') 'getQuantityPrecision')
def getQuantityPrecision(self): def getQuantityPrecision(self):
"""Return the floating point precision of a quantity. """Return the floating point precision of a quantity.
......
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