Commit c3305bad authored by Jérome Perrin's avatar Jérome Perrin

pdm: fix pylint messages on document.erp5.Consumption

- fix indentation
- make overloaded methods accept same arguments as on parent class
- use list comprehension instead of map()
parent 30001f17
......@@ -59,7 +59,7 @@ class Consumption(XMLObject, XMLMatrix, VariatedMixin):
security.declareProtected(Permissions.ModifyPortalContent,
'_setVariationCategoryList')
def _setVariationCategoryList(self,value):
def _setVariationCategoryList(self, value, base_category_list=()):
"""
Set consumption variation category list.
Set matrix cell range.
......@@ -74,7 +74,7 @@ class Consumption(XMLObject, XMLMatrix, VariatedMixin):
security.declareProtected(Permissions.ModifyPortalContent,
'setVariationCategoryList')
def setVariationCategoryList(self,value):
def setVariationCategoryList(self, value, base_category_list=()):
"""
Set consumption variation category list.
Reindex Object.
......@@ -84,13 +84,17 @@ class Consumption(XMLObject, XMLMatrix, VariatedMixin):
security.declareProtected(Permissions.ModifyPortalContent,
'getVariationRangeBaseCategoryItemList')
def getVariationRangeBaseCategoryItemList(self):
def getVariationRangeBaseCategoryItemList(
self,
base=1,
display_id='getTitle',
current_category=None):
"""
Return range of base variation item
Left display
"""
# XXX get TitleOrId
return map( lambda x: (x,x) , self.getVariationRangeBaseCategoryList() )
return [(x, x) for x in self.getVariationRangeBaseCategoryList()]
security.declareProtected(Permissions.ModifyPortalContent,
'getQuantityRatio')
......
......@@ -6,6 +6,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>Consumption</string> </value>
......@@ -14,6 +20,12 @@
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.Consumption</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document.erp5.Consumption</string> </value>
......@@ -37,47 +49,7 @@
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple>
<string>W: 40, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 45, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 46, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 49, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 50, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 53, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 60, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 62, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 63, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 67, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 73, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 75, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 77, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 78, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 82, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 83, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 85, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 87, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 88, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 93, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 95, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 97, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 99, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:103, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:105, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:107, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation)</string>
<string>W:108, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation)</string>
<string>W:109, 0: Bad indentation. Found 10 spaces, expected 8 (bad-indentation)</string>
<string>W:110, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation)</string>
<string>W:111, 0: Bad indentation. Found 10 spaces, expected 8 (bad-indentation)</string>
<string>W:112, 0: Bad indentation. Found 10 spaces, expected 8 (bad-indentation)</string>
<string>W:113, 0: Bad indentation. Found 12 spaces, expected 10 (bad-indentation)</string>
<string>W:114, 0: Bad indentation. Found 10 spaces, expected 8 (bad-indentation)</string>
<string>W:115, 0: Bad indentation. Found 12 spaces, expected 10 (bad-indentation)</string>
<string>W:117, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 62, 4: Arguments number differs from overridden \'_setVariationCategoryList\' method (arguments-differ)</string>
<string>W: 77, 4: Arguments number differs from overridden \'setVariationCategoryList\' method (arguments-differ)</string>
<string>W: 87, 4: Arguments number differs from overridden \'getVariationRangeBaseCategoryItemList\' method (arguments-differ)</string>
<string>W: 93, 13: map/filter on lambda could be replaced by comprehension (deprecated-lambda)</string>
</tuple>
<tuple/>
</value>
</item>
<item>
......@@ -87,13 +59,28 @@
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
......@@ -106,7 +93,7 @@
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
......@@ -115,7 +102,7 @@
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
......
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