Commit 396d814c authored by Arnaud Fontaine's avatar Arnaud Fontaine

WIP: from __future__ must be first but PythonScript is wrapped.

parent e3e53b04
from __future__ import print_function
#try: //Implement try catch instead of if else #try: //Implement try catch instead of if else
#from Products.ERP5Type.JSON import dumps #from Products.ERP5Type.JSON import dumps
from Products.ERP5Type.JSONEncoder import encodeInJson as dumps from Products.ERP5Type.JSONEncoder import encodeInJson as dumps
......
...@@ -3,7 +3,6 @@ that a 0 balance are grouped. ...@@ -3,7 +3,6 @@ that a 0 balance are grouped.
In other words, check that all transactions that can be grouped are grouped. In other words, check that all transactions that can be grouped are grouped.
""" """
from __future__ import print_function
from builtins import str from builtins import str
from Products.CMFActivity.ActiveResult import ActiveResult from Products.CMFActivity.ActiveResult import ActiveResult
active_process = context.newActiveProcess() active_process = context.newActiveProcess()
......
from __future__ import print_function
from builtins import str from builtins import str
def recursiveDocumentList(obj): def recursiveDocumentList(obj):
ret = [] ret = []
......
from __future__ import print_function
category_list = context.portal_catalog(path="%portal_categories/gap2/br%") category_list = context.portal_catalog(path="%portal_categories/gap2/br%")
for cat in category_list: for cat in category_list:
......
from __future__ import print_function
category_list = context.portal_catalog(path="%portal_categories/gap2/br%") category_list = context.portal_catalog(path="%portal_categories/gap2/br%")
for cat in category_list: for cat in category_list:
......
from __future__ import print_function
from builtins import str from builtins import str
from builtins import range from builtins import range
from builtins import object from builtins import object
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
Deployment script for crating initial accounts upon gap/pl/default structure Deployment script for crating initial accounts upon gap/pl/default structure
Warning: Before using this script as zope, edit account_workflow and give Manager permission to validate_action Warning: Before using this script as zope, edit account_workflow and give Manager permission to validate_action
""" """
from __future__ import print_function
#This script will REMOVE any existing accounts!!! #This script will REMOVE any existing accounts!!!
#comment following if you are sure #comment following if you are sure
......
...@@ -4,7 +4,6 @@ Creates gap structure under gap/pl/default. ...@@ -4,7 +4,6 @@ Creates gap structure under gap/pl/default.
The definition text is a raw text representation of a wiki page The definition text is a raw text representation of a wiki page
with accountants-approved gap structure with accountants-approved gap structure
""" """
from __future__ import print_function
gap_text = \ gap_text = \
"""* [0] Aktywa trwałe """* [0] Aktywa trwałe
......
from __future__ import print_function
print('<html><head><meta http-equiv="refresh" content="%s"></head><body>' % refresh_interval) print('<html><head><meta http-equiv="refresh" content="%s"></head><body>' % refresh_interval)
for table in 'message', 'message_queue': for table in 'message', 'message_queue':
......
from __future__ import print_function
portal = context.getPortalObject() portal = context.getPortalObject()
req = portal.erp5_sql_connection.manage_test req = portal.erp5_sql_connection.manage_test
......
from __future__ import print_function
from AccessControl import getSecurityManager from AccessControl import getSecurityManager
from zExceptions import Unauthorized from zExceptions import Unauthorized
from pprint import pformat from pprint import pformat
......
from __future__ import print_function
group_id_list_generator = getattr(context, 'ERP5Type_asSecurityGroupId') group_id_list_generator = getattr(context, 'ERP5Type_asSecurityGroupId')
security_category_dict = {} security_category_dict = {}
......
from __future__ import print_function
def checkTopLevel(): def checkTopLevel():
portal = context.getPortalObject() portal = context.getPortalObject()
for o in portal.objectValues(): for o in portal.objectValues():
......
from __future__ import print_function
for builder in sorted(context.getPortalObject().portal_deliveries.contentValues(), for builder in sorted(context.getPortalObject().portal_deliveries.contentValues(),
key=lambda x:x.getTitle()): key=lambda x:x.getTitle()):
print(builder.getId()) print(builder.getId())
......
from __future__ import print_function
if ignore_business_template_list is None: if ignore_business_template_list is None:
ignore_business_template_list = [] ignore_business_template_list = []
for business_template in sorted(context.getPortalObject().portal_templates.contentValues(portal_type='Business Template'), for business_template in sorted(context.getPortalObject().portal_templates.contentValues(portal_type='Business Template'),
......
from __future__ import print_function
for builder in sorted(context.getPortalObject().portal_orders.contentValues(), for builder in sorted(context.getPortalObject().portal_orders.contentValues(),
key=lambda x:x.getTitle()): key=lambda x:x.getTitle()):
print(builder.getId()) print(builder.getId())
......
from __future__ import print_function
from builtins import str from builtins import str
import hashlib import hashlib
portal = context.getPortalObject() portal = context.getPortalObject()
......
from __future__ import print_function
for ti in sorted(context.getPortalObject().portal_types.contentValues(), key=lambda x:x.getId()): for ti in sorted(context.getPortalObject().portal_types.contentValues(), key=lambda x:x.getId()):
for ai in sorted(ti.contentValues(portal_type='Action Information'), key=lambda x:x.getReference()): for ai in sorted(ti.contentValues(portal_type='Action Information'), key=lambda x:x.getReference()):
print(ti.getId()) print(ti.getId())
......
from __future__ import print_function
for ti in sorted(context.getPortalObject().portal_types.contentValues(), key=lambda x:x.getId()): for ti in sorted(context.getPortalObject().portal_types.contentValues(), key=lambda x:x.getId()):
print(ti.getId()) print(ti.getId())
print(" ", "\n ".join([x for x in ( print(" ", "\n ".join([x for x in (
......
from __future__ import print_function
for ti in sorted(context.getPortalObject().portal_types.contentValues(), key=lambda x:x.getId()): for ti in sorted(context.getPortalObject().portal_types.contentValues(), key=lambda x:x.getId()):
for ri in sorted(ti.contentValues(portal_type='Role Information'), key=lambda x:(x.getTitle(), x.getLocalRoleGroupId(), x.getRoleBaseCategoryScriptId(), x.getRoleBaseCategoryList())): for ri in sorted(ti.contentValues(portal_type='Role Information'), key=lambda x:(x.getTitle(), x.getLocalRoleGroupId(), x.getRoleBaseCategoryScriptId(), x.getRoleBaseCategoryList())):
print(ti.getId()) print(ti.getId())
......
from __future__ import print_function
if ignore_property_sheet_list is None: if ignore_property_sheet_list is None:
ignore_property_sheet_list = [] ignore_property_sheet_list = []
......
from __future__ import print_function
for rule in sorted(context.getPortalObject().portal_rules.contentValues(), for rule in sorted(context.getPortalObject().portal_rules.contentValues(),
key=lambda x:x.getTitle()): key=lambda x:x.getTitle()):
if rule.getValidationState() != 'validated': if rule.getValidationState() != 'validated':
......
from __future__ import print_function
# This method outputs the skin properties in the format that you can # This method outputs the skin properties in the format that you can
# easily get diff like the following: # easily get diff like the following:
# --- # ---
......
"""Utility script listing all relation fields that are using relation_setter_id feature. """Utility script listing all relation fields that are using relation_setter_id feature.
This helps migrating them after r33837 This helps migrating them after r33837
""" """
from __future__ import print_function
multi_relation_field_meta_type_list = ['RelationStringField', multi_relation_field_meta_type_list = ['RelationStringField',
'MultiRelationStringField'] 'MultiRelationStringField']
for field_path, field in context.ZopeFind( for field_path, field in context.ZopeFind(
......
from __future__ import print_function
portal_templates = context.getPortalObject().portal_templates portal_templates = context.getPortalObject().portal_templates
delete_list = [] delete_list = []
bt_list = portal_templates.objectValues() bt_list = portal_templates.objectValues()
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
This script when triggered will migrate all embedded "File" and "Image" This script when triggered will migrate all embedded "File" and "Image"
objects to an unified "Embedded File". objects to an unified "Embedded File".
""" """
from __future__ import print_function
active_process = context.getPortalObject().portal_activities.newActiveProcess() active_process = context.getPortalObject().portal_activities.newActiveProcess()
context.ERP5Site_checkDataWithScript("Base_migrateToEmbeddedFile", context.ERP5Site_checkDataWithScript("Base_migrateToEmbeddedFile",
tag="migrate", tag="migrate",
......
from __future__ import division
from past.utils import old_div from past.utils import old_div
from pprint import pformat from pprint import pformat
portal = context.getPortalObject() portal = context.getPortalObject()
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
Script can optionally include currency. Script can optionally include currency.
""" """
from __future__ import division
from builtins import str from builtins import str
from past.utils import old_div from past.utils import old_div
......
from __future__ import division
from past.utils import old_div from past.utils import old_div
if base_application in ('base_amount/loyalty_program/using_point', 'base_amount/loyalty_program/coupon'): if base_application in ('base_amount/loyalty_program/using_point', 'base_amount/loyalty_program/coupon'):
def getBaseAmountQuantity(delivery_amount, base_application, **kw): def getBaseAmountQuantity(delivery_amount, base_application, **kw):
......
from __future__ import division
# different part of the configuration process in estimatd percentages # different part of the configuration process in estimatd percentages
# values for machine with pystones =(1.3600000000000012, 36764.705882352908) # values for machine with pystones =(1.3600000000000012, 36764.705882352908)
from past.utils import old_div from past.utils import old_div
......
""" This script will be called to apply the customization. """ """ This script will be called to apply the customization. """
from __future__ import print_function
from AccessControl import getSecurityManager from AccessControl import getSecurityManager
from erp5.component.module.Log import log from erp5.component.module.Log import log
......
""" This script will be called to apply the customization. """ """ This script will be called to apply the customization. """
from __future__ import print_function
from erp5.component.module.Log import log from erp5.component.module.Log import log
portal = context.getPortalObject() portal = context.getPortalObject()
......
from __future__ import print_function
message_dict = {} message_dict = {}
FUNC_NAME_LIST = ('N_', FUNC_NAME_LIST = ('N_',
'Base_translateString', 'Base_translateString',
......
from __future__ import print_function
from builtins import str from builtins import str
portal = context.getPortalObject() portal = context.getPortalObject()
html_status_report = str(portal.portal_configurator.getInstallationStatusReport(active_process_id=2)) html_status_report = str(portal.portal_configurator.getInstallationStatusReport(active_process_id=2))
......
from __future__ import print_function
from past.builtins import cmp from past.builtins import cmp
from builtins import range from builtins import range
......
from __future__ import print_function
portal = context.getPortalObject() portal = context.getPortalObject()
active_process = portal.portal_activities.newActiveProcess() active_process = portal.portal_activities.newActiveProcess()
portal.event_module.recurseCallMethod( portal.event_module.recurseCallMethod(
......
from __future__ import print_function
uids = context.portal_selections.getSelectionCheckedUidsFor(selection_name) uids = context.portal_selections.getSelectionCheckedUidsFor(selection_name)
if len(uids) == 0: if len(uids) == 0:
# uids = map(lambda x:x.uid, context.portal_selections.callSelectionFor(selection_name)) # uids = map(lambda x:x.uid, context.portal_selections.callSelectionFor(selection_name))
......
...@@ -4,7 +4,6 @@ is based on calculation of the frequency_index and creation_date_index. ...@@ -4,7 +4,6 @@ is based on calculation of the frequency_index and creation_date_index.
Documents which their frequency_index and creation_date_index are the Documents which their frequency_index and creation_date_index are the
same as those calculated, are updated. same as those calculated, are updated.
""" """
from __future__ import division
from builtins import range from builtins import range
from past.utils import old_div from past.utils import old_div
from erp5.component.module.DateUtils import convertDateToHour from erp5.component.module.DateUtils import convertDateToHour
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
It will do that recursively in entire ERP5 instance. It will do that recursively in entire ERP5 instance.
""" """
from __future__ import print_function
context.ERP5Site_checkDataWithScript("Base_callPreConvert", context.ERP5Site_checkDataWithScript("Base_callPreConvert",
tag="pre_convert", tag="pre_convert",
packet=2, packet=2,
......
from __future__ import print_function
# Setup System Preference # Setup System Preference
dms_system_preference_id = 'dms_system_preference_ui_tests' dms_system_preference_id = 'dms_system_preference_ui_tests'
portal_preferences = context.portal_preferences portal_preferences = context.portal_preferences
......
from __future__ import print_function
# Delete System Preference # Delete System Preference
#portal_preferences = context.portal_preferences #portal_preferences = context.portal_preferences
#portal_preferences.manage_delObjects(['dms_system_preference_ui_tests', 'dms_preference_ui_tests']) #portal_preferences.manage_delObjects(['dms_system_preference_ui_tests', 'dms_preference_ui_tests'])
......
from __future__ import print_function
result = context.GlossaryModule_getTermDictListFromPortalType(portal_type_list) result = context.GlossaryModule_getTermDictListFromPortalType(portal_type_list)
if export_tsv: if export_tsv:
......
from __future__ import print_function
result = context.GlossaryModule_getTermDictListFromPropertySheet(property_sheet_list) result = context.GlossaryModule_getTermDictListFromPropertySheet(property_sheet_list)
if export_tsv: if export_tsv:
......
from __future__ import print_function
result = context.GlossaryModule_getTermDictListFromWorkflow(template_list) result = context.GlossaryModule_getTermDictListFromWorkflow(template_list)
if export_tsv: if export_tsv:
......
from __future__ import print_function
from DateTime import DateTime from DateTime import DateTime
MESSAGE_TEMPLATE = '''\ MESSAGE_TEMPLATE = '''\
msgid %(english)s msgid %(english)s
......
from __future__ import print_function
# This script set language property according to existing language category. # This script set language property according to existing language category.
for i in context.getPortalObject().glossary_module.objectValues(): for i in context.getPortalObject().glossary_module.objectValues():
lang_list = [x.split('/')[1] for x in i.categories if x.startswith('language/')] lang_list = [x.split('/')[1] for x in i.categories if x.startswith('language/')]
......
from __future__ import print_function
from erp5.component.module.DiffUtils import DiffFile from erp5.component.module.DiffUtils import DiffFile
from Products.PythonScripts.standard import html_quote from Products.PythonScripts.standard import html_quote
......
from __future__ import print_function
def sortDiffObjectList(diff_object_list): def sortDiffObjectList(diff_object_list):
return sorted(diff_object_list, key=lambda x: (x.object_state, x.object_class, x.object_id)) return sorted(diff_object_list, key=lambda x: (x.object_state, x.object_class, x.object_id))
......
from __future__ import print_function
# License: GPL # License: GPL
# Author: Lukasz Nowak <lukasz.nowak@ventis.com.pl> # Author: Lukasz Nowak <lukasz.nowak@ventis.com.pl>
# Copyright 2007 Ventis s. c. # Copyright 2007 Ventis s. c.
......
from __future__ import print_function
from Products.ERP5Type.Utils import getMessageIdWithContext from Products.ERP5Type.Utils import getMessageIdWithContext
message_dict = {} message_dict = {}
......
from __future__ import print_function
# This tool is able to check, if selection_name in listboxes in forms # This tool is able to check, if selection_name in listboxes in forms
# are unique "enough". # are unique "enough".
# It shall print nothing on properly made site, which will mean # It shall print nothing on properly made site, which will mean
......
"""Obsolete compatibility script. """Obsolete compatibility script.
""" """
from __future__ import print_function
from erp5.component.module.Log import log from erp5.component.module.Log import log
log("Obsolete script, please use BaseType_copyRoleList instead") log("Obsolete script, please use BaseType_copyRoleList instead")
......
"""List all dead proxy fields """List all dead proxy fields
""" """
from __future__ import print_function
portal_skin = context.REQUEST.get('portal_skin', 'View') portal_skin = context.REQUEST.get('portal_skin', 'View')
print("<html>") print("<html>")
......
"""Prints all fields that are in 'not assigned' group. """Prints all fields that are in 'not assigned' group.
This happens after updating a form where some fields have been added locally. This happens after updating a form where some fields have been added locally.
""" """
from __future__ import print_function
for form_path, form in context.ZopeFind( for form_path, form in context.ZopeFind(
context.portal_skins, obj_metatypes=['ERP5 Form'], search_sub=1): context.portal_skins, obj_metatypes=['ERP5 Form'], search_sub=1):
......
from __future__ import print_function
multi_relation_field_meta_type_list = ['RelationStringField', multi_relation_field_meta_type_list = ['RelationStringField',
'MultiRelationStringField'] 'MultiRelationStringField']
for field_path, field in context.ZopeFind( for field_path, field in context.ZopeFind(
......
"""List all skins that are present in more than one skin folder, ordered by """List all skins that are present in more than one skin folder, ordered by
priority. priority.
""" """
from __future__ import print_function
# make sure context is the skins tool # make sure context is the skins tool
stool = context.portal_skins stool = context.portal_skins
......
from __future__ import print_function
from past.builtins import basestring from past.builtins import basestring
vcs_tool = context.getVcsTool() vcs_tool = context.getVcsTool()
template_tool = context.getPortalObject().portal_templates template_tool = context.getPortalObject().portal_templates
......
from __future__ import division
from past.utils import old_div from past.utils import old_div
initial_durability = kw.get('initial_durability') initial_durability = kw.get('initial_durability')
if start_remaining_annuities is None or stop_remaining_annuities is None \ if start_remaining_annuities is None or stop_remaining_annuities is None \
......
from __future__ import print_function
# XXX Not updated, Immobilisation portal_type does not exist anymore # XXX Not updated, Immobilisation portal_type does not exist anymore
# but it has to update each delivery line and cell portal_type which # but it has to update each delivery line and cell portal_type which
# has already such actions # has already such actions
......
from __future__ import print_function
actions_to_add = [ actions_to_add = [
{'name' : 'Immobilisation Validity Errors', {'name' : 'Immobilisation Validity Errors',
'id': 'immobilisation_validity_errors', 'id': 'immobilisation_validity_errors',
......
from __future__ import print_function
from string import capitalize from string import capitalize
view_id_basis = "%s_%s_amortisation_method_view_details" view_id_basis = "%s_%s_amortisation_method_view_details"
......
from __future__ import print_function
actions_to_add = [ actions_to_add = [
{'name' : 'Immobilisation Periods', {'name' : 'Immobilisation Periods',
'id': 'immobilisation_periods', 'id': 'immobilisation_periods',
......
from __future__ import print_function
user_preferences = context.KnowledgeBox_getDefaultPreferencesDict() user_preferences = context.KnowledgeBox_getDefaultPreferencesDict()
print(user_preferences) print(user_preferences)
return printed return printed
from __future__ import print_function
# Publish all knowledge pad gadgets # Publish all knowledge pad gadgets
for gadget in context.portal_gadgets.objectValues(): for gadget in context.portal_gadgets.objectValues():
if gadget.getValidationState() == 'invisible': if gadget.getValidationState() == 'invisible':
......
from __future__ import print_function
portal = context.getPortalObject() portal = context.getPortalObject()
# Get Software Product Object # Get Software Product Object
......
from __future__ import print_function
print("<html><body><h1 class='test-script-title'>Title is : " + parameter + "</h1></body></html>") print("<html><body><h1 class='test-script-title'>Title is : " + parameter + "</h1></body></html>")
return printed return printed
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
this script is just made to have a simple visual render of the paysheet this script is just made to have a simple visual render of the paysheet
calculation calculation
''' '''
from __future__ import print_function
from builtins import str from builtins import str
line_dict_list = context.PaySheetTransaction_getLineListAsDict() line_dict_list = context.PaySheetTransaction_getLineListAsDict()
......
from __future__ import division
from builtins import str from builtins import str
from past.utils import old_div from past.utils import old_div
from erp5.component.module.DateUtils import addToDate, getIntervalBetweenDates, getNumberOfDayInMonth from erp5.component.module.DateUtils import addToDate, getIntervalBetweenDates, getNumberOfDayInMonth
......
from __future__ import division
from builtins import str from builtins import str
from past.utils import old_div from past.utils import old_div
from erp5.component.module.DateUtils import getNumberOfDayInMonth from erp5.component.module.DateUtils import getNumberOfDayInMonth
......
from __future__ import division
from builtins import str from builtins import str
from past.utils import old_div from past.utils import old_div
from erp5.component.module.DateUtils import addToDate from erp5.component.module.DateUtils import addToDate
......
from __future__ import division
from builtins import str from builtins import str
from past.utils import old_div from past.utils import old_div
from erp5.component.module.DateUtils import getNumberOfDayInMonth from erp5.component.module.DateUtils import getNumberOfDayInMonth
......
# coding: utf-8 # coding: utf-8
from __future__ import division
from builtins import next from builtins import next
from builtins import zip from builtins import zip
from past.utils import old_div from past.utils import old_div
......
...@@ -7,7 +7,6 @@ Uses sampling_amount, defaults to 20. ...@@ -7,7 +7,6 @@ Uses sampling_amount, defaults to 20.
Samples inventory by proper differency, returns Samples inventory by proper differency, returns
sampling_amount inventory lines, sorted by date. sampling_amount inventory lines, sorted by date.
""" """
from __future__ import division
# XXX: Might be set in preferences # XXX: Might be set in preferences
from builtins import str from builtins import str
......
from __future__ import division
# This is what we want to display in the report # This is what we want to display in the report
# project_month worker1 worker2 worker3 # project_month worker1 worker2 worker3
# january 34 32 15 # january 34 32 15
......
from __future__ import division
from builtins import range from builtins import range
from past.utils import old_div from past.utils import old_div
request = context.REQUEST request = context.REQUEST
......
"""Export the current selection in task report module in iCalendar format. """Export the current selection in task report module in iCalendar format.
""" """
from __future__ import print_function
from zExceptions import Unauthorized from zExceptions import Unauthorized
# XXX bypass CookieCrumbler # XXX bypass CookieCrumbler
if context.REQUEST.AUTHENTICATED_USER.getUserName() == 'Anonymous User': if context.REQUEST.AUTHENTICATED_USER.getUserName() == 'Anonymous User':
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
This script is intended to be run before exporting business template of test pages This script is intended to be run before exporting business template of test pages
It will change ID of all published/shared/released test page so that it can be exported easily It will change ID of all published/shared/released test page so that it can be exported easily
""" """
from __future__ import print_function
portal = context.getPortalObject() portal = context.getPortalObject()
test_pages = portal.test_page_module.searchFolder(validation_state= test_pages = portal.test_page_module.searchFolder(validation_state=
......
from __future__ import print_function
import json import json
portal = context.getPortalObject() portal = context.getPortalObject()
context.REQUEST.response.setHeader('Access-Control-Allow-Origin', '*') context.REQUEST.response.setHeader('Access-Control-Allow-Origin', '*')
......
from __future__ import print_function
#from Products.ERP5.Document.TileImageTransformed import TileImageTransformed #from Products.ERP5.Document.TileImageTransformed import TileImageTransformed
#from cStringIO import StringIO #from cStringIO import StringIO
......
from __future__ import division
from past.utils import old_div from past.utils import old_div
import json import json
from DateTime import DateTime from DateTime import DateTime
......
from __future__ import division
#from Products.ERP5Type.Document import newTempBase #from Products.ERP5Type.Document import newTempBase
#from Products.ZSQLCatalog.SQLCatalog import ComplexQuery, SimpleQuery #from Products.ZSQLCatalog.SQLCatalog import ComplexQuery, SimpleQuery
from builtins import str from builtins import str
......
""" Called after test results are saved under ERP5 from workflow transition. """ """ Called after test results are saved under ERP5 from workflow transition. """
from __future__ import print_function
recipient_list = [] recipient_list = []
include_link = 1 include_link = 1
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
Return for buildbot test summary info. Return for buildbot test summary info.
status, all tests, failures, errors status, all tests, failures, errors
""" """
from __future__ import print_function
seconds = 0.0 seconds = 0.0
for obj in context.contentValues(): for obj in context.contentValues():
seconds += obj.getProperty('duration') seconds += obj.getProperty('duration')
......
from __future__ import division
from past.utils import old_div from past.utils import old_div
from DateTime import DateTime from DateTime import DateTime
now = DateTime() now = DateTime()
......
...@@ -3,7 +3,6 @@ Web API intended for listing, one per line, the report URL (typically present ...@@ -3,7 +3,6 @@ Web API intended for listing, one per line, the report URL (typically present
in node's stdout) of all nodes involved in a Test Result. in node's stdout) of all nodes involved in a Test Result.
Multiline stdout values behaviour is undefined. Multiline stdout values behaviour is undefined.
""" """
from __future__ import print_function
for test_result_node in context.objectValues(portal_type='Test Result Node'): for test_result_node in context.objectValues(portal_type='Test Result Node'):
if test_result_node.getCmdline() == 'LOG url': if test_result_node.getCmdline() == 'LOG url':
print(test_result_node.getStdout()) print(test_result_node.getStdout())
......
from __future__ import print_function
# This script is intented to be called on a form # This script is intented to be called on a form
ps = context.getPortalObject().portal_property_sheets[property_sheet_id] ps = context.getPortalObject().portal_property_sheets[property_sheet_id]
......
from __future__ import division
# this API uses format= as argument # this API uses format= as argument
# pylint: disable=redefined-builtin # pylint: disable=redefined-builtin
......
from __future__ import print_function
portal = context.getPortalObject() portal = context.getPortalObject()
# Update Photos # Update Photos
......
"""Returns the quantity divided by the max quantity""" """Returns the quantity divided by the max quantity"""
from __future__ import division
from past.utils import old_div from past.utils import old_div
q = context.getQuantity() q = context.getQuantity()
max_q = 0.0 max_q = 0.0
......
from __future__ import print_function
for error_entry in context.error_log.getLogEntries(): for error_entry in context.error_log.getLogEntries():
for key in error_entry: for key in error_entry:
if key not in ["tb_text", "tb_html", 'req_html']: if key not in ["tb_text", "tb_html", 'req_html']:
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
the instance spam mailing lists during the the instance spam mailing lists during the
Functional Tests. Functional Tests.
""" """
from __future__ import print_function
if getattr(context.MailHost, "getMessageList", None) is None: if getattr(context.MailHost, "getMessageList", None) is None:
return "ERROR: MailHost is not a DummyMailHost" return "ERROR: MailHost is not a DummyMailHost"
......
from __future__ import print_function
from zExceptions import BadRequest from zExceptions import BadRequest
portal_tests = container.portal_tests portal_tests = container.portal_tests
if test_zuite_relative_url is not None: if test_zuite_relative_url is not None:
......
from __future__ import print_function
import time import time
from datetime import datetime from datetime import datetime
portal = context.getPortalObject() portal = context.getPortalObject()
......
from __future__ import division
from future import standard_library from future import standard_library
standard_library.install_aliases() standard_library.install_aliases()
from past.utils import old_div from past.utils import old_div
......
from __future__ import division
# - Months always starts at 0h of the current month's first day and # - Months always starts at 0h of the current month's first day and
# finish 0h of the next month's first day. # finish 0h of the next month's first day.
......
from __future__ import print_function
from builtins import str from builtins import str
new_category_list = () new_category_list = ()
from_cat = from_cat + '/' from_cat = from_cat + '/'
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
Script used by PlanningBox validator to round the bound dates to the Script used by PlanningBox validator to round the bound dates to the
closest full minute. closest full minute.
""" """
from __future__ import division
from past.utils import old_div from past.utils import old_div
if full_date.second() > 30: if full_date.second() > 30:
......
from __future__ import print_function
from random import getrandbits from random import getrandbits
portal = context.getPortalObject() portal = context.getPortalObject()
if clear_catalog: if clear_catalog:
......
from __future__ import print_function
# Reindex objects which indexation_timestamp is at most # Reindex objects which indexation_timestamp is at most
# delta seconds before current time (ie, bound inclued). # delta seconds before current time (ie, bound inclued).
# Unindex objects which cannot be found. # Unindex objects which cannot be found.
......
from __future__ import print_function
from Products.ERP5Type.Utils import getMessageIdWithContext from Products.ERP5Type.Utils import getMessageIdWithContext
supported_languages = context.Localizer.get_supported_languages() supported_languages = context.Localizer.get_supported_languages()
......
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