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