Commit 7ce864fe authored by Jérome Perrin's avatar Jérome Perrin

core: remove unused scripts

parent d176a695
<?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>list=[]</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_convertDateListToChartList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
# This scripts allows to update a list so that it
# converts variation on a quantity to the quantity itself
# ie, if list=[[DateTime('09/10/2003'),+4],[DateTime('09/19/2003'),-8]],
# and initial_quantity = [3]
# result: [[DateTime('2003/09/10'), 7], [DateTime('2003/09/19'), -1]]
# The list given have to be of the forme:
# list = [[Datetime(),value (,value)*],([Datetime(),value (,value)*])*]
# The initial_quantity have to be like this :
# initial_quantity = [value (,value)*]
list.sort()
quantity_list = []
#if type(initial_quantity) is type(1):
# initial_quantity = [initial_quantity]
if len(list) >= 1 and (len(list[0])-1)==len(initial_quantity):
quantity_list.append([list[0][0]])
for i in range(1,len(list[0])):
if list[0][i]==None:
list[0][i]=0
quantity_list[0].append(initial_quantity[i-1] + list[0][i])
for value in range(1,len(list)):
quantity_list.append([list[value][0]])
for i in range(1,len(list[0])):
if list[value][i]==None:
list[value][i]=0
quantity_list[value].append(quantity_list[value-1][i] + list[value][i])
return quantity_list
<?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>list=[],initial_quantity=[]</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_convertVariationListToQuantityList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
from Products.Formulator.Errors import ValidationError, FormValidationError
from ZTUtils import make_query
request=context.REQUEST
if isinstance(list_form_id,tuple):
list_form_id = list_form_id[0]
# The type list is not working with isinstance, I have do do this bad hack
if hasattr(list_form_id,'sort'):
list_form_id = list_form_id[0]
module_name = context.getId()
try:
# Validate the form
form = getattr(context,dialog_id)
form.validate_all_to_request(request)
kw = {}
for f in form.get_fields():
k = f.id
# XXX Remove your_ parameters...
k = k[5:]
v = getattr(request,k,None)
if v is not None and k != 'list_form_id' :
kw[k] = v
if list_method_id is not None and list_method_id != '' :
kw['list_method_id'] = list_method_id
url_params_string = make_query(kw)
# raise str(kw), url_params_string
except FormValidationError, validation_errors:
# Pack errors into the request
field_errors = form.ErrorFields(validation_errors)
request.set('field_errors', field_errors)
return form(request)
if url_params_string != '':
redirect_url = '%s/%s?%s' % ( context.absolute_url()
, list_form_id
, url_params_string
)
else:
redirect_url = '%s/%s' % ( context.absolute_url()
, list_form_id
)
return request.RESPONSE.redirect( redirect_url )
<?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>form_id,dialog_id,list_form_id,list_method_id=\'\'</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_searchHandler</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