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

Enable coding style on erp5_calendar

See merge request !1531
parents 8a7b7ade 48464494
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>string:${object_url}/CalendarPeriodicity_view</string> </value> <value> <string>string:${object_url}/PresencePeriod_viewPeriodicity</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>string:${object_url}/CalendarPeriodicity_view</string> </value> <value> <string>string:${object_url}/PresencePeriod_viewPeriodicity</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>string:${object_url}/CalendarPeriodicity_view</string> </value> <value> <string>string:${object_url}/PresencePeriod_viewPeriodicity</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</item> </item>
<item> <item>
<key> <string>domain_generator_method_id</string> </key> <key> <string>domain_generator_method_id</string> </key>
<value> <string>Orgnaisation_generatePlanningDomain</string> </value> <value> <string>Organisation_generatePlanningDomain</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>size</string>
<string>items</string> <string>items</string>
<string>size</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -87,6 +87,12 @@ ...@@ -87,6 +87,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value> <value> <string>Base_viewFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>size</string> </key> <key> <string>size</string> </key>
<value> <int>12</int> </value> <value> <int>12</int> </value>
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>size</string>
<string>items</string> <string>items</string>
<string>size</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -87,6 +87,12 @@ ...@@ -87,6 +87,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value> <value> <string>Base_viewFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>size</string> </key> <key> <string>size</string> </key>
<value> <int>12</int> </value> <value> <int>12</int> </value>
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>size</string>
<string>items</string> <string>items</string>
<string>size</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -87,6 +87,12 @@ ...@@ -87,6 +87,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value> <value> <string>Base_viewFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>size</string> </key> <key> <string>size</string> </key>
<value> <int>7</int> </value> <value> <int>7</int> </value>
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>size</string>
<string>items</string> <string>items</string>
<string>size</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -87,6 +87,12 @@ ...@@ -87,6 +87,12 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value> <value> <string>Base_viewFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>size</string> </key> <key> <string>size</string> </key>
<value> <int>12</int> </value> <value> <int>12</int> </value>
......
...@@ -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>
......
...@@ -7,19 +7,15 @@ if object_path is None: ...@@ -7,19 +7,15 @@ if object_path is None:
# Sometimes the object_path not comes with the request, when you edit for example. # Sometimes the object_path not comes with the request, when you edit for example.
object_path = request.get('URL1').split('/')[-1] object_path = request.get('URL1').split('/')[-1]
def sorted(seq, comparator):
new_seq = seq[::]
new_seq.sort(comparator)
return new_seq
def display_method(doc): def display_method(doc):
return doc.getTitle() return doc.getTitle()
domain_list = [] domain_list = []
organisation = context.organisation_module.restrictedTraverse(object_path) organisation = context.organisation_module.restrictedTraverse(object_path)
for person in sorted(organisation.getSubordinationRelatedValueList( for person in sorted(
portal_type='Person', checked_permission='View'), organisation.getSubordinationRelatedValueList(portal_type='Person', checked_permission='View'),
lambda a, b: cmp(display_method(a), display_method(b))): key=display_method):
domain = parent.generateTempDomain(id=person.getId()) domain = parent.generateTempDomain(id=person.getId())
domain.edit(title = display_method(person), domain.edit(title = display_method(person),
membership_criterion_base_category = ('source', 'destination'), membership_criterion_base_category = ('source', 'destination'),
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Orgnaisation_generatePlanningDomain</string> </value> <value> <string>Organisation_generatePlanningDomain</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -417,7 +417,7 @@ ...@@ -417,7 +417,7 @@
</item> </item>
<item> <item>
<key> <string>color_script</string> </key> <key> <string>color_script</string> </key>
<value> <string>TaskMovement_getSimulationStateColorText</string> </value> <value> <string>Movement_getSimulationStateColorText</string> </value>
</item> </item>
<item> <item>
<key> <string>constraint_method</string> </key> <key> <string>constraint_method</string> </key>
......
from Products.PythonScripts.standard import Object
request = container.REQUEST request = container.REQUEST
portal = context.getPortalObject() portal = context.getPortalObject()
stool = portal.portal_simulation stool = portal.portal_simulation
......
...@@ -417,7 +417,7 @@ ...@@ -417,7 +417,7 @@
</item> </item>
<item> <item>
<key> <string>color_script</string> </key> <key> <string>color_script</string> </key>
<value> <string>TaskMovement_getSimulationStateColorText</string> </value> <value> <string>Movement_getSimulationStateColorText</string> </value>
</item> </item>
<item> <item>
<key> <string>constraint_method</string> </key> <key> <string>constraint_method</string> </key>
......
...@@ -417,7 +417,7 @@ ...@@ -417,7 +417,7 @@
</item> </item>
<item> <item>
<key> <string>color_script</string> </key> <key> <string>color_script</string> </key>
<value> <string>TaskMovement_getSimulationStateColorText</string> </value> <value> <string>Movement_getSimulationStateColorText</string> </value>
</item> </item>
<item> <item>
<key> <string>constraint_method</string> </key> <key> <string>constraint_method</string> </key>
......
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>CalendarPeriodicity_view</string> </value> <value> <string>PresencePeriod_viewPeriodicity</string> </value>
</item> </item>
<item> <item>
<key> <string>method</string> </key> <key> <string>method</string> </key>
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
</item> </item>
<item> <item>
<key> <string>name</string> </key> <key> <string>name</string> </key>
<value> <string>CalendarPeriodicity_view</string> </value> <value> <string>PresencePeriod_viewPeriodicity</string> </value>
</item> </item>
<item> <item>
<key> <string>pt</string> </key> <key> <string>pt</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>
......
if task.getPortalType() in task.getPortalCalendarPeriodTypeList():
return '#d3d3d3'
simulation_method = getattr(task, 'getSimulationState', None)
if simulation_method is None:
return '#D1E8FF'
simulation_state = simulation_method()
color_dict = {
'draft': '#a7d7ae',
'planned': '#ffff00',
'ordered': '#ff8e56',
'confirmed': '#ff0000',
'started': '#ff00ff',
'stopped': '#00b8ff',
'delivered': '#3deb3d',
}
return color_dict.get(simulation_state, '#D1E8FF')
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<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>task=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>TaskMovement_getSimulationStateColorText</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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