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

payroll_l10n_fr: coding style

parent ca5a11db
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>string:${object_url}/DSNReport_viewEditor</string> </value> <value> <string>string:${object_url}/DSNMonthlyReport_viewEditor</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>string:${object_url}/DSNReport_viewEditor</string> </value> <value> <string>string:${object_url}/DSNMonthlyReport_viewEditor</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>string:${object_url}/DSNReport_viewFilePrintDialog</string> </value> <value> <string>string:${object_url}/DSNMonthlyReport_viewFilePrintDialog</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>string:${object_url}/DSNReport_viewEditor</string> </value> <value> <string>string:${object_url}/DSNMonthlyReport_viewEditor</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
<value> <value>
<list> <list>
<string>my_notice_type</string> <string>my_notice_type</string>
<string>my_validation_state_title</string> <string>my_translated_validation_state_title</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_validation_state_title</string> </value> <value> <string>my_translated_validation_state_title</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>DSNReport_printAsFile</string> </value> <value> <string>DSNMonthlyReport_printAsFile</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>DSNReport_viewEditor</string> </value> <value> <string>DSNMonthlyReport_viewEditor</string> </value>
</item> </item>
<item> <item>
<key> <string>method</string> </key> <key> <string>method</string> </key>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</item> </item>
<item> <item>
<key> <string>action</string> </key> <key> <string>action</string> </key>
<value> <string>DSNReport_printAsFile</string> </value> <value> <string>DSNMonthlyReport_printAsFile</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>DSNReport_viewFilePrintDialog</string> </value> <value> <string>DSNMonthlyReport_viewFilePrintDialog</string> </value>
</item> </item>
<item> <item>
<key> <string>method</string> </key> <key> <string>method</string> </key>
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
</item> </item>
<item> <item>
<key> <string>name</string> </key> <key> <string>name</string> </key>
<value> <string>DSNReport_viewFilePrintDialog</string> </value> <value> <string>DSNMonthlyReport_viewFilePrintDialog</string> </value>
</item> </item>
<item> <item>
<key> <string>pt</string> </key> <key> <string>pt</string> </key>
......
"""
Return a list of values of a given rubric from one or more DSN Records.
Rubrics will be grouped on a given parent's bloc. This bloc must be made unique
by a given rubrique's code.
Values will be returned as a list in a dictionnary, whose keys are the values of
the unique rubrique's code use to group them.
"""
portal = context.getPortalObject()
if not searched_block:
searched_block = 'S21.G00.23'
if not grouping_rubric:
grouping_rubric = 'S21.G00.11.001'
dsn_files = portal.dsn_module.searchFolder(effective_date=">%s" % from_date,
simulation_state='validated',
**kw)
result_dict = {}
for dsn_file in dsn_files:
# Exclude current and future DSNs
if dsn_file.getEffectiveDate() >= context.getEffectiveDate():
continue
dsn_file = dsn_file.getObject()
result_dict[dsn_file] = {}
found_parent = False
dsn_data = dsn_file.getTextContent()
is_monthly_dsn = False
result_bloc = []
last_rubric = ''
for line in dsn_data.split('\n'):
rubric, value = line.split(',', 1)
value = value.strip('\'')
# Let's exclude events DSN
if rubric == 'S20.G00.05.001':
is_monthly_dsn = (True if value == '01' else False)
# We found a parent node
if grouping_rubric == rubric and is_monthly_dsn:
found_parent = value
result_dict[dsn_file][value] = []
# If we have finished a bloc, we add it to the returned dict,
# and we look for another bloc under the same parent node
if rubric < last_rubric and found_parent and len(result_bloc):
result_dict[dsn_file][found_parent].append(result_bloc)
result_bloc = []
# The bloc we are looking for has been found. We add it to
# the corresponding gathering rubric
if found_parent and searched_block in rubric and is_monthly_dsn:
result_bloc.append((rubric, value))
last_rubric = rubric
return result_dict
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>searched_block=\'\', grouping_rubric=\'\', from_date=None, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DSNReport_getGroupedOlderValueDict</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
<string>my_civil_servant_status</string> <string>my_civil_servant_status</string>
<string>my_occupational_accident_risk_code</string> <string>my_occupational_accident_risk_code</string>
<string>my_occupational_accident_risk_rate</string> <string>my_occupational_accident_risk_rate</string>
<string>my_validation_state_title</string> <string>my_translated_validation_state_title</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_validation_state_title</string> </value> <value> <string>my_translated_validation_state_title</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
...@@ -92,34 +92,6 @@ ...@@ -92,34 +92,6 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>extra_context</string> </key> <key> <string>extra_context</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -132,14 +104,6 @@ ...@@ -132,14 +104,6 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
......
...@@ -6,18 +6,18 @@ ...@@ -6,18 +6,18 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>_bind_names</string> </key>
<value> <value>
<object> <object>
<klass> <klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/> <global name="_reconstructor" module="copy_reg"/>
</klass> </klass>
<tuple/> <tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state> <state>
<dictionary> <dictionary>
<item> <item>
......
...@@ -6,18 +6,18 @@ ...@@ -6,18 +6,18 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>_bind_names</string> </key>
<value> <value>
<object> <object>
<klass> <klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/> <global name="_reconstructor" module="copy_reg"/>
</klass> </klass>
<tuple/> <tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state> <state>
<dictionary> <dictionary>
<item> <item>
......
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