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

Enable coding style for erp5_xhtml_style

/reviewed-on !1048
parents 159daa14 e8674e78
......@@ -128,7 +128,6 @@ def getModuleActionInformationDict(**kw):
print_list.append((translated_title, module_print_list))
# Add the actions, only if they are not empty.
action_list_dict = {}
for k, v in (('add', add_list), ('search', search_list),
('exchange', exchange_list), ('report', report_list),
('print', print_list), ('view', view_list)):
......
......@@ -10,7 +10,6 @@ def getConfiguredStatusDict():
express_pref_dict = context.ERP5Site_getExpressPreferenceDict()
subscription_status = express_pref_dict.get('subscription_status')
configuration_status = express_pref_dict.get('configuration_status')
user_id = express_pref_dict.get('user_id')
SUPPORT_ENABLED = 'support_enabled'
......@@ -39,7 +38,6 @@ basic_mode, dms_mode, express_mode = getConfiguredStatusDict()
member = portal.portal_membership.getAuthenticatedMember()
role_list = list(member.getRoles())
role_list.sort()
group_list = ()
getGroups = getattr(member, 'getGroups', None)
if role_list == ['Authenticated', 'Member'] and not getGroups():
basic_mode = False
......
language = context.Localizer.get_selected_language()
SUPPORT_ENABLED = 'support_enabled'
SUPPORT_DISABLED = 'support_disabled'
ADVERTISEMENT_ENABLED = 'advertisement_enabled'
if express_mode==SUPPORT_ENABLED:
# For Express users.
......
# pylint: disable-all
from Products.PythonScripts.standard import html_quote
from Products.CMFCore.utils import getToolByName
from Products.FCKeditor.utils import fckCreateValidZopeId
......
# pylint: disable-all
from Products.PythonScripts.standard import html_quote
from Products.CMFCore.utils import getToolByName
......
# pylint: disable-all
from Products.PythonScripts.standard import html_quote
from Products.CMFCore.utils import getToolByName
from Products.FCKeditor.utils import fckCreateValidZopeId
......
# pylint: disable-all
from Products.CMFCore.utils import getToolByName
from Products.PythonScripts.standard import html_quote
......
# pylint: disable=redefined-builtin
# select_language is a builtin because of Localizer add in builtins and pylint uses it as it runs in same process as ERP5.
# https://lab.nexedi.com/nexedi/erp5/blob/52146f5e3abf538c056a1ab2ffd124757c4825d6/product/Localizer/itools/i18n/accept.py#L163
import re
try:
......
......@@ -29,7 +29,7 @@ def addDialogIfNeeded(url):
# try to get format parameter if exists
parameter_kw = {}
format = ''
target_format = ''
if len(action_list) > 1:
parameter_list = action.split('?')[1]
parameter_tuple_list = [tuple(tuple_parameter.split('=')) for tuple_parameter in parameter_list.split('&')]
......@@ -44,13 +44,13 @@ def addDialogIfNeeded(url):
base_content_type = form.getProperty('content_type')
if parameter_kw.has_key('format'):
# if format is passed in action url: remove it
format = parameter_kw.pop('format')
target_format = parameter_kw.pop('format')
action = '%s?%s' % (action_id, '&'.join(['='.join(tuple_parameter) for tuple_parameter in parameter_kw.items()]))
url = '%s/Base_viewOOoPrintDialog?dialog_action_url=%s&base_content_type=%s&field_your_format=%s' % (
context.absolute_url(),
url_quote('%s/%s' % (absolute_url, action)),
url_quote(base_content_type),
url_quote(format))
url_quote(target_format))
elif not (hasattr(form, 'pt') and form.pt == 'form_dialog'):
url = '%s/Base_viewIntermediatePrintDialog?dialog_action_url=%s' % (
context.absolute_url(), url_quote('%s/%s' % (absolute_url, action)))
......
# pylint: disable=redefined-builtin
# this script uses format argument
if '?' in dialog_action_url:
dialog_action_url = '%s&form_id=%s' % (dialog_action_url, form_id)
else:
......
......@@ -20,9 +20,9 @@ def getFieldDescription(field_id):
properties = document.propertyMap()
except AttributeError: # If context has no propertyMap, give up
properties = []
for property in properties:
if split_id[1] == property['id']:
desc = property.get('description', '')
for prop in properties:
if split_id[1] == prop['id']:
desc = prop.get('description', '')
break
return desc
......
# Return first listbox in a form that is enabled and not hidden
# Christophe Dumez <christophe@nexedi.com>
# This script should be used to detect a listbox without having to name it "listbox"
form=context
......
......@@ -42,13 +42,6 @@ car_width = 6
depth_width = 10
# the same over the vertical axis
depth_height = 10
# mid block size in wich we try to insert text
block_width = 40
# margin between the block and the delimitation (this permits to have
# blocks a bit smaller that lines or columns)
margin = 5
size_planning_width = basic.field.get_value('size_planning_width')
size_x_axis_height = basic.field.get_value('size_x_axis_height')
......
......@@ -84,12 +84,12 @@ for area_name in properties_structure.keys():
returned_list.append('.%s{' % class_name)
else:
returned_list.append('#%s{' % class_name)
for id in css_dict[class_name].keys():
if same_type(css_dict[class_name][id],''):
returned_list.append('%s:%s;\n' % (id,css_dict[class_name][id]))
for id_ in css_dict[class_name].keys():
if same_type(css_dict[class_name][id_], ''):
returned_list.append('%s:%s;\n' % (id_, css_dict[class_name][id_]))
else:
# if data is type float or integer then need to add 'px' at the end
returned_list.append('%s:%s%s;\n' % (id, int(css_dict[class_name][id] + 0.5),'px'))
returned_list.append('%s:%s%s;\n' % (id_, int(css_dict[class_name][id_] + 0.5), 'px'))
returned_list.append('}\n')
returned_list.append(" \
.planning_box_topleft{ position:absolute;left:0;top:0;} \n \
......
......@@ -124,6 +124,12 @@ ignored_skin_id_set = {
'PortalType_addAction',
'PortalType_deleteAction',
'RelationFieldZuite_CommonTemplate',
'Field_getDescription',
'ERP5XhtmlStyle_redirect',
'connectorCPS.py',
'connectorERP5',
'connectorPlone.py',
'resolveUid',
}
# Generic method to check consistency of a skin 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