Commit 8a6248c2 authored by Julien Muchembled's avatar Julien Muchembled

* replace tabs with spaces

 * remove trailing spaces

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21612 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 307f3e9a
......@@ -194,10 +194,10 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper):
dc_workflow_list = []
template_workflow_id_list = getattr(self.getDocumentedObject(), 'template_workflow_id', [])
for wf in template_workflow_id_list:
url = '/' + self.getPortalObject().id + '/portal_workflow/' + wf
url = '/' + self.getPortalObject().id + '/portal_workflow/' + wf
wf_object = self.getPortalObject().unrestrictedTraverse(url)
if wf_object.__class__.__name__ == 'DCWorkflowDefinition':
dc_workflow_list.append(wf)
dc_workflow_list.append(wf)
return dc_workflow_list
security.declareProtected( Permissions.AccessContentsInformation, 'getDCWorkflowURIList' )
......
......@@ -96,7 +96,7 @@ class CatalogMethodDocumentationHelper(DocumentationHelper):
keys = []
arg = getattr(self.getDocumentedObject(), '_arg', None)
if arg is not None:
keys = getattr(arg, '_keys', [])
keys = getattr(arg, '_keys', [])
return keys
security.declareProtected(Permissions.AccessContentsInformation, 'getCatalog' )
......
......@@ -38,17 +38,17 @@ def getStatePermissionsOfRole(state=None, role=''):
permissions = ""
if state != None:
if hasattr(state, '__dict__'):
if 'permission_roles' in state.__dict__.keys():
if 'View' in state.__dict__['permission_roles'].keys():
if 'permission_roles' in state.__dict__.keys():
if 'View' in state.__dict__['permission_roles'].keys():
if role in state.__dict__['permission_roles']['View']:
permissions += "V"
if 'Access contents information' in state.__dict__['permission_roles'].keys():
if 'Access contents information' in state.__dict__['permission_roles'].keys():
if role in state.__dict__['permission_roles']['Access contents information']:
permissions += "A"
if 'Modify portal content' in state.__dict__['permission_roles'].keys():
if 'Modify portal content' in state.__dict__['permission_roles'].keys():
if role in state.__dict__['permission_roles']['Modify portal content']:
permissions += "M"
if 'Add portal content' in state.__dict__['permission_roles'].keys():
if 'Add portal content' in state.__dict__['permission_roles'].keys():
if role in state.__dict__['permission_roles']['Add portal content']:
permissions += "C"
return permissions
......@@ -62,12 +62,12 @@ class DCWorkflowDocumentationHelper(DocumentationHelper):
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
def __init__(self, uri):
self.uri = uri
def getInstance(self):
return self.getPortalObject().restrictedTraverse(self.uri)
return self.getPortalObject().restrictedTraverse(self.uri)
# API Implementation
security.declareProtected( Permissions.AccessContentsInformation, 'getId' )
......@@ -155,7 +155,7 @@ class DCWorkflowDocumentationHelper(DocumentationHelper):
for state in states.objectValues():
state_list.append(state.getId())
return state_list
security.declareProtected( Permissions.AccessContentsInformation, 'getStateItemList' )
def getStateItemList(self):
"""
......@@ -168,7 +168,7 @@ class DCWorkflowDocumentationHelper(DocumentationHelper):
getattr(state, "title", ""),
getStatePermissionsOfRole(state, 'Owner'),
getStatePermissionsOfRole(state, 'Assignor'),
getStatePermissionsOfRole(state, 'Assignee'),
getStatePermissionsOfRole(state, 'Assignee'),
getStatePermissionsOfRole(state, 'Associate'),
getStatePermissionsOfRole(state, 'Author'),
getStatePermissionsOfRole(state, 'Auditor')
......@@ -219,9 +219,9 @@ class DCWorkflowDocumentationHelper(DocumentationHelper):
if hasattr(transition.guard, '__dict__'):
if 'roles' in transition.guard.__dict__.keys():
guard_roles = ', '.join(role for role in transition.guard.__dict__['roles'])
transition_list.append((transition.getId(),
getattr(transition, "title", ""),
trigger_type_list[transition.trigger_type],
transition_list.append((transition.getId(),
getattr(transition, "title", ""),
trigger_type_list[transition.trigger_type],
getattr(transition, "description", ""),
guard_roles
))
......@@ -264,10 +264,10 @@ class DCWorkflowDocumentationHelper(DocumentationHelper):
variables = getattr(self.getInstance(), 'variables', None)
if variables is not None:
for variable in variables.objectValues():
variable_list.append((variable.getId(),
getattr(variable, "title", ""),
getattr(variable, "description", "")
))
variable_list.append((variable.getId(),
getattr(variable, "title", ""),
getattr(variable, "description", "")
))
return variable_list
security.declareProtected( Permissions.AccessContentsInformation, 'getVariableURIList' )
......@@ -298,7 +298,7 @@ class DCWorkflowDocumentationHelper(DocumentationHelper):
for permission in permissions:
permission_list.append(permission)
return permission_list
security.declareProtected( Permissions.AccessContentsInformation, 'getPermissionURIList' )
def getPermissionURIList(self):
......@@ -310,14 +310,14 @@ class DCWorkflowDocumentationHelper(DocumentationHelper):
module = klass.__module__
uri_prefix = '%s.%s.' % (module, class_name)
return map(lambda x: '%s%s' % (uri_prefix, x), permission_id_list)
security.declareProtected( Permissions.AccessContentsInformation, 'getPermissionUriList' )
def getPermissionUriList(self):
"""
"""
permission_id_list = self.getPermissionIdList()
return map(lambda x: '%s/permissions/%s' % (self.uri, x), permission_id_list)
security.declareProtected( Permissions.AccessContentsInformation, 'getWorklistIdList' )
def getWorklistIdList(self):
"""
......@@ -342,14 +342,14 @@ class DCWorkflowDocumentationHelper(DocumentationHelper):
if wl.title == "":
title = wl.actbox_name
else:
title = wl.title
title = wl.title
if hasattr(wl.guard, '__dict__'):
if 'roles' in wl.guard.__dict__.keys():
guard_roles = ', '.join(role for role in wl.guard.__dict__['roles'])
worklist_list.append((wl.__name__, title, wl.__dict__["description"],guard_roles))
return worklist_list
security.declareProtected( Permissions.AccessContentsInformation, 'getWorklistURIList' )
def getWorklistURIList(self):
"""
......@@ -387,9 +387,9 @@ class DCWorkflowDocumentationHelper(DocumentationHelper):
scripts = getattr(self.getInstance(), "scripts", None)
if scripts is not None:
for script in scripts.objectValues():
script_list.append((getattr(script, "__name__", ''),
getattr(script, "title", '')
))
script_list.append((getattr(script, "__name__", ''),
getattr(script, "title", '')
))
return script_list
......
......@@ -93,10 +93,10 @@ class DCWorkflowScriptDocumentationHelper(DocumentationHelper):
REQUEST = getattr(self, 'REQUEST', None)
if REQUEST is not None:
if REQUEST.get('portal_skin', 'View' ) != 'View':
return source_code
return source_code
else:
LOG('DCWorkflowScriptDocumentationHelper', INFO,
'Transformation Tool is not installed. No convertion of python script to html')
LOG('DCWorkflowScriptDocumentationHelper', INFO,
'Transformation Tool is not installed. No convertion of python script to html')
return source_code
src_mimetype='text/x-python'
mime_type = 'text/html'
......
......@@ -119,10 +119,10 @@ class DCWorkflowTransitionDocumentationHelper(DocumentationHelper):
"""
role_list = ()
if hasattr(self.getDocumentedObject(),'guard'):
dir(self.getDocumentedObject().guard)
dir(self.getDocumentedObject().guard)
if hasattr(self.getDocumentedObject().guard, '__dict__'):
if 'roles' in self.getDocumentedObject().guard.__dict__.keys():
if 'roles' in self.getDocumentedObject().guard.__dict__.keys():
role_list = self.getDocumentedObject().guard.__dict__['roles']
return ', '.join(role for role in role_list)
InitializeClass(DCWorkflowTransitionDocumentationHelper)
......@@ -75,8 +75,8 @@ class DCWorkflowWorklistDocumentationHelper(DocumentationHelper):
"""
if self.getDocumentedObject().title == "":
return self.getDocumentedObject().actbox_name
else:
return self.getDocumentedObject().title
else:
return self.getDocumentedObject().title
security.declareProtected(Permissions.AccessContentsInformation, 'getGuardRoles' )
def getGuardRoles(self):
......@@ -103,6 +103,6 @@ class DCWorkflowWorklistDocumentationHelper(DocumentationHelper):
for key in var_matches.keys():
var_matches_list.append('%s: %s' % (key, ', '.join(x for x in var_matches[key])))
#var_matches_list.append((key, '%s' % ', '.join(x for x in var_matches[key])))
return var_matches_list
return var_matches_list
InitializeClass(DCWorkflowWorklistDocumentationHelper)
......@@ -101,8 +101,8 @@ class DocumentationHelper(Implicit):
def getDocumentedObject(self):
if self.uri.startswith('portal_classes/temp_instance'):
url, method = self.uri.split('#')
portal_type = url.split('/')[-1]
url, method = self.uri.split('#')
portal_type = url.split('/')[-1]
#temp_folder = self.getPortalObject().portal_classes.newContent(id='temp_instance', portal_type='Folder', temp_object=1)
#temp_object = temp_folder.newContent(id=portal_type, portal_type=portal_type, temp_object=1)
self.getTempInstance = TempObjectLibrary(self.getPortalObject().portal_classes)
......@@ -118,14 +118,14 @@ class DocumentationHelper(Implicit):
file_name = self.uri.split('/')[-1]
file_url = ''
list_path = os.listdir(instance_home+'/Products')
zope_property_sheet = instance_home + '/PropertySheet'
zope_property_sheet = instance_home + '/PropertySheet'
list_propertysheets = [zope_property_sheet,]
for path in list_path:
full_path = instance_home+'/Products/'+path
if os.path.isdir(full_path) and os.path.exists(full_path+'/PropertySheet'):
full_path = instance_home+'/Products/'+path
if os.path.isdir(full_path) and os.path.exists(full_path+'/PropertySheet'):
list_propertysheets.append(full_path+'/PropertySheet')
for propertysheet_directory in list_propertysheets:
if os.path.exists(propertysheet_directory+'/'+file_name):
if os.path.exists(propertysheet_directory+'/'+file_name):
file_url = propertysheet_directory+'/'+file_name
documented_object = open(file_url)
elif '/' in self.uri and '#' not in self.uri:
......@@ -134,20 +134,20 @@ class DocumentationHelper(Implicit):
try:
documented_object = self.getPortalObject().portal_categories.resolveCategory(self.uri)
except:
documented_object = None
documented_object = None
if documented_object is None:
documented_object = self.getPortalObject().unrestrictedTraverse(self.uri)
documented_object = self.getPortalObject().unrestrictedTraverse(self.uri)
elif '/' in self.uri and '#' in self.uri:
if '?' in self.uri:
base_url, url = self.uri.split('?')
type, name = url.split('#')
parent_object = self.getPortalObject().unrestrictedTraverse(base_url)
object_list = getattr(parent_object, type, None)
documented_object = None
if object_list is not None:
base_url, url = self.uri.split('?')
type, name = url.split('#')
parent_object = self.getPortalObject().unrestrictedTraverse(base_url)
object_list = getattr(parent_object, type, None)
documented_object = None
if object_list is not None:
for obj in object_list:
if obj.__name__ == name:
documented_object = obj
if obj.__name__ == name:
documented_object = obj
else:
url, method = self.uri.split('#')
documented_object = self.getPortalObject().unrestrictedTraverse(url)
......@@ -171,7 +171,7 @@ class DocumentationHelper(Implicit):
for key in module_list[1:]:
documented_object = getattr(documented_object, key)
else:
raise NotImplemented
raise NotImplemented
#fp, pathname, description = imp.find_module(base_module)
#documented_object = imp.load_module(fp, pathname, description)
return documented_object
......
......@@ -79,7 +79,7 @@ class ERP5SiteDocumentationHelper(DocumentationHelper):
Returns the description of the documentation helper
"""
return getattr(self.getDocumentedObject(), "description", '')
security.declareProtected( Permissions.AccessContentsInformation, 'getBusinessTemplateIdList' )
def getBusinessTemplateIdList(self):
"""
......@@ -87,9 +87,9 @@ class ERP5SiteDocumentationHelper(DocumentationHelper):
bt_list = []
for bt in self.getDocumentedObject().portal_templates.objectValues():
current_state = ''
for wh in bt.workflow_history['business_template_installation_workflow']:
current_state = wh['installation_state']
if current_state == 'installed':
for wh in bt.workflow_history['business_template_installation_workflow']:
current_state = wh['installation_state']
if current_state == 'installed':
bt_list.append(bt.getId())
return bt_list
......@@ -104,13 +104,13 @@ class ERP5SiteDocumentationHelper(DocumentationHelper):
current_state = ''
for wh in bt.workflow_history['business_template_installation_workflow']:
current_state = wh['installation_state']
if current_state == 'installed':
bt_list.append((bt.getId(),
getattr(bt, "title", ''),
getattr(bt, "description", ''),
getattr(bt, "version", ''),
getattr(bt, "revision", '')
))
if current_state == 'installed':
bt_list.append((bt.getId(),
getattr(bt, "title", ''),
getattr(bt, "description", ''),
getattr(bt, "version", ''),
getattr(bt, "revision", '')
))
return bt_list
security.declareProtected( Permissions.AccessContentsInformation, 'getBusinessTemplateURIList' )
......
......@@ -38,17 +38,17 @@ def getStatePermissionsOfRole(state=None, role=''):
permissions = ""
if state != None:
if hasattr(state, '__dict__'):
if 'permission_roles' in state.__dict__.keys():
if 'View' in state.__dict__['permission_roles'].keys():
if 'permission_roles' in state.__dict__.keys():
if 'View' in state.__dict__['permission_roles'].keys():
if role in state.__dict__['permission_roles']['View']:
permissions += "V"
if 'Access contents information' in state.__dict__['permission_roles'].keys():
if 'Access contents information' in state.__dict__['permission_roles'].keys():
if role in state.__dict__['permission_roles']['Access contents information']:
permissions += "A"
if 'Modify portal content' in state.__dict__['permission_roles'].keys():
if 'Modify portal content' in state.__dict__['permission_roles'].keys():
if role in state.__dict__['permission_roles']['Modify portal content']:
permissions += "M"
if 'Add portal content' in state.__dict__['permission_roles'].keys():
if 'Add portal content' in state.__dict__['permission_roles'].keys():
if role in state.__dict__['permission_roles']['Add portal content']:
permissions += "C"
return permissions
......@@ -62,12 +62,12 @@ class InteractionWorkflowDocumentationHelper(DocumentationHelper):
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
def __init__(self, uri):
self.uri = uri
def getInstance(self):
return self.getPortalObject().restrictedTraverse(self.uri)
return self.getPortalObject().restrictedTraverse(self.uri)
# API Implementation
security.declareProtected( Permissions.AccessContentsInformation, 'getId' )
......@@ -76,7 +76,7 @@ class InteractionWorkflowDocumentationHelper(DocumentationHelper):
Returns the Id of the documentation helper
"""
return getattr(self.getInstance(), "__name__", '')
security.declareProtected( Permissions.AccessContentsInformation, 'getType' )
def getType(self):
......@@ -151,24 +151,24 @@ class InteractionWorkflowDocumentationHelper(DocumentationHelper):
"""
state_list = []
if hasattr(self.getInstance(), "states"):
if self.getInstance().states is not None:
if self.getInstance().states is not None:
for state in self.getInstance().states.objectValues():
state_list.append(state.getId())
return state_list
security.declareProtected( Permissions.AccessContentsInformation, 'getStateItemList' )
def getStateItemList(self):
"""
"""
state_list = []
if hasattr(self.getInstance(), "states"):
if self.getInstance().states is not None:
if self.getInstance().states is not None:
for state in self.getInstance().states.objectValues():
state_list.append((state.getId(),
state_list.append((state.getId(),
state.__dict__["title"],
getStatePermissionsOfRole(state, 'Owner'),
getStatePermissionsOfRole(state, 'Assignor'),
getStatePermissionsOfRole(state, 'Assignee'),
getStatePermissionsOfRole(state, 'Assignee'),
getStatePermissionsOfRole(state, 'Associate'),
getStatePermissionsOfRole(state, 'Author'),
getStatePermissionsOfRole(state, 'Auditor')
......@@ -200,7 +200,7 @@ class InteractionWorkflowDocumentationHelper(DocumentationHelper):
"""
transition_list = []
if hasattr(self.getInstance(), "transitions"):
if self.getInstance().transitions is not None:
if self.getInstance().transitions is not None:
for transition in self.getInstance().transitions.objectValues():
transition_list.append(transition.getId())
return transition_list
......@@ -212,16 +212,16 @@ class InteractionWorkflowDocumentationHelper(DocumentationHelper):
transition_list = []
trigger_type_list = ['Automatic','Initiated by user action','Initiated by WorkflowMethod']
if hasattr(self.getInstance(), "transitions"):
if self.getInstance().transitions is not None:
if self.getInstance().transitions is not None:
for transition in self.getInstance().transitions.objectValues():
guard_roles = ""
guard = dir(transition.guard)
if hasattr(transition.guard, '__dict__'):
if 'roles' in transition.guard.__dict__.keys():
guard_roles = ', '.join(role for role in transition.guard.__dict__['roles'])
transition_list.append((transition.getId(),
transition.title,
trigger_type_list[transition.trigger_type],
transition_list.append((transition.getId(),
transition.title,
trigger_type_list[transition.trigger_type],
transition.__dict__["description"],
guard_roles
))
......@@ -251,7 +251,7 @@ class InteractionWorkflowDocumentationHelper(DocumentationHelper):
"""
variable_list = []
if hasattr(self.getInstance(), "variables"):
if self.getInstance().variables is not None:
if self.getInstance().variables is not None:
for variable in self.getInstance().variables.objectValues():
variable_list.append(variable.getId())
return variable_list
......@@ -262,7 +262,7 @@ class InteractionWorkflowDocumentationHelper(DocumentationHelper):
"""
variable_list = []
if hasattr(self.getInstance(), "variables"):
if self.getInstance().variables is not None:
if self.getInstance().variables is not None:
for variable in self.getInstance().variables.objectValues():
variable_list.append((variable.getId(), variable.title, variable.__dict__["description"]))
return variable_list
......@@ -295,7 +295,7 @@ class InteractionWorkflowDocumentationHelper(DocumentationHelper):
for permission in self.getInstance().permissions:
permission_list.append(permission)
return permission_list
security.declareProtected( Permissions.AccessContentsInformation, 'getPermissionURIList' )
def getPermissionURIList(self):
......@@ -307,14 +307,14 @@ class InteractionWorkflowDocumentationHelper(DocumentationHelper):
module = klass.__module__
uri_prefix = '%s.%s.' % (module, class_name)
return map(lambda x: '%s%s' % (uri_prefix, x), permission_id_list)
security.declareProtected( Permissions.AccessContentsInformation, 'getPermissionUriList' )
def getPermissionUriList(self):
"""
"""
permission_id_list = self.getPermissionIdList()
return map(lambda x: '%s/permissions/%s' % (self.uri, x), permission_id_list)
security.declareProtected( Permissions.AccessContentsInformation, 'getWorklistIdList' )
def getWorklistIdList(self):
"""
......@@ -339,14 +339,14 @@ class InteractionWorkflowDocumentationHelper(DocumentationHelper):
if wl.title == "":
title = wl.actbox_name
else:
title = wl.title
title = wl.title
if hasattr(wl.guard, '__dict__'):
if 'roles' in wl.guard.__dict__.keys():
guard_roles = ', '.join(role for role in wl.guard.__dict__['roles'])
worklist_list.append((wl.__name__, title, wl.__dict__["description"],guard_roles))
return worklist_list
security.declareProtected( Permissions.AccessContentsInformation, 'getWorklistURIList' )
def getWorklistURIList(self):
"""
......
......@@ -73,8 +73,8 @@ class PageTemplateDocumentationHelper(DocumentationHelper):
source_code = getattr(self.getDocumentedObject(), "_text", '')
portal_transforms = getattr(self, 'portal_transforms', None)
if portal_transforms is None:
LOG('DCWorkflowScriptDocumentationHelper', INFO,
'Transformation Tool is not installed. No convertion of python script to html')
LOG('DCWorkflowScriptDocumentationHelper', INFO,
'Transformation Tool is not installed. No convertion of python script to html')
return source_code
src_mimetype='text/plain'
mime_type = 'text/html'
......
......@@ -43,7 +43,7 @@ def getPortalType(uri=''):
"""
portal_type = ''
uri_list = uri.split('/')
if len(uri_list) >= 3:
if len(uri_list) >= 3:
portal_type = uri_list[3]
return portal_type
......@@ -58,7 +58,7 @@ class PortalTypeDocumentationHelper(DocumentationHelper):
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
# API Implementation
security.declareProtected( Permissions.AccessContentsInformation, 'getTitle' )
def getTitle(self):
......@@ -83,7 +83,7 @@ class PortalTypeDocumentationHelper(DocumentationHelper):
klass = self.getTempInstance(portal_type).__class__.__bases__[0]
return str(klass).split("'")[1]
security.declareProtected( Permissions.AccessContentsInformation, 'getTempInstance' )
def getTempInstance(self, portal_type):
"""
......@@ -202,7 +202,7 @@ class PortalTypeDocumentationHelper(DocumentationHelper):
if local_roles:
return 'Yes'
else:
return 'No'
return 'No'
security.declareProtected( Permissions.AccessContentsInformation, 'getPropertySheetList' )
def getPropertySheetList(self):
......@@ -216,7 +216,7 @@ class PortalTypeDocumentationHelper(DocumentationHelper):
property_sheet.append(obj.__module__.split('.')[-1])
for obj in self.getDocumentedObject().property_sheet_list:
property_sheet.append(obj)
return property_sheet
return property_sheet
security.declareProtected( Permissions.AccessContentsInformation, 'getPropertySheetURIList' )
def getPropertySheetURIList(self):
......@@ -248,9 +248,9 @@ class PortalTypeDocumentationHelper(DocumentationHelper):
"""
"""
action_list = []
TITLE =['No', 'Yes']
TITLE =['No', 'Yes']
for action in self.getDocumentedObject()._actions:
permission = ', '.join(x for x in action.permissions)
permission = ', '.join(x for x in action.permissions)
visible = TITLE[action.visible]
category = action.category
action_list.append((action.getId(), action.title, action.Description(), permission, visible, category))
......@@ -317,12 +317,12 @@ class PortalTypeDocumentationHelper(DocumentationHelper):
temp_object = self.getTempInstance(portal_type)
dir_temp = dir(temp_object)
return Base.aq_portal_type[(portal_type, temp_object.__class__)]
security.declareProtected(Permissions.AccessContentsInformation, 'getWorkflowMethodIdList' )
def getWorkflowMethodIdList(self, inherited=1):
"""
"""
return self._getPropertyHolder().getWorkflowMethodIdList()
return self._getPropertyHolder().getWorkflowMethodIdList()
security.declareProtected(Permissions.AccessContentsInformation, 'getWorkflowMethodURIList' )
def getWorkflowMethodURIList(self, inherited=1, local=1):
......@@ -349,8 +349,8 @@ class PortalTypeDocumentationHelper(DocumentationHelper):
module = klass.__module__
uri_prefix = 'portal_classes/temp_instance/%s' % self.uri.split('/')[-1]
return map(lambda x: '%s#%s' % (uri_prefix, x), method_id_list)
security.declareProtected( Permissions.AccessContentsInformation, 'getClassMethodIdList' )
def getClassMethodIdList(self, inherited=1, local=1):
"""
......
......@@ -135,13 +135,13 @@ class PortalTypeInstanceDocumentationHelper(DocumentationHelper):
"""
"""
return self._getPropertyHolder()
security.declareProtected(Permissions.AccessContentsInformation, 'getWorkflowMethodIdList' )
def getWorkflowMethodIdList(self, inherited=1):
"""
"""
return self._getPropertyHolder().getWorkflowMethodIdList()
return self._getPropertyHolder().getWorkflowMethodIdList()
security.declareProtected(Permissions.AccessContentsInformation, 'getWorkflowMethodURIList' )
def getWorkflowMethodURIList(self, inherited=1, local=1):
"""
......
......@@ -73,12 +73,12 @@ class PortalTypePropertySheetDocumentationHelper(DocumentationHelper):
source_code = ""
property_sheet_file = self.getDocumentedObject()
if property_sheet_file is not None:
property_sheet_file.seek(0)
property_sheet_file.seek(0)
source_code = property_sheet_file.read()
portal_transforms = getattr(self, 'portal_transforms', None)
if portal_transforms is None:
LOG('DCWorkflowScriptDocumentationHelper', INFO,
'Transformation Tool is not installed. No convertion of python script to html')
LOG('DCWorkflowScriptDocumentationHelper', INFO,
'Transformation Tool is not installed. No convertion of python script to html')
return source_code
src_mimetype='text/x-python'
mime_type = 'text/html'
......
......@@ -72,8 +72,8 @@ class ScriptPythonDocumentationHelper(DocumentationHelper):
source_code = getattr(self.getDocumentedObject(), "_body", '')
portal_transforms = getattr(self, 'portal_transforms', None)
if portal_transforms is None:
LOG('DCWorkflowScriptDocumentationHelper', INFO,
'Transformation Tool is not installed. No convertion of python script to html')
LOG('DCWorkflowScriptDocumentationHelper', INFO,
'Transformation Tool is not installed. No convertion of python script to html')
return source_code
src_mimetype='text/x-python'
mime_type = 'text/html'
......
......@@ -73,7 +73,7 @@ class SkinFolderDocumentationHelper(DocumentationHelper):
security.declareProtected(Permissions.AccessContentsInformation, 'getMetaTypeList' )
def getMetaTypeList(self):
meta_type_dict = {}
for file in self.getDocumentedObject().objectValues():
for file in self.getDocumentedObject().objectValues():
meta_type_dict[file.meta_type] = None
type_list = meta_type_dict.keys()
type_list.sort()
......@@ -101,7 +101,7 @@ class SkinFolderDocumentationHelper(DocumentationHelper):
files = self.getDocumentedObject()
if files is not None:
for file in files.objectValues():
if not meta_type or file.meta_type == meta_type:
if not meta_type or file.meta_type == meta_type:
file_list.append((file.id, file.title, file.meta_type))
return file_list
......
......@@ -70,6 +70,5 @@ class SkinFolderItemDocumentationHelper(DocumentationHelper):
"""
return getattr(self.getDocumentedObject(), "content_type", '')
InitializeClass(SkinFolderItemDocumentationHelper)
......@@ -32,8 +32,8 @@ from Globals import InitializeClass
from DocumentationHelper import DocumentationHelper
from Products.ERP5Type import Permissions
class ZSQLMethodDocumentationHelper(DocumentationHelper):
"""
class ZSQLMethodDocumentationHelper(DocumentationHelper):
"""
Provides documentation about a Z SQL Method
"""
security = ClassSecurityInfo()
......
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