Commit 02caefb6 authored by Jérome Perrin's avatar Jérome Perrin

CodingStyle: review allowed prefixes

 - Use TypesTool methods instead of looking in modules __dict__ when
   possible.
 - Allow prefixes from mixin
 - Allow prefixes from interfaces without the I ( ISomething ->
   Something )
 - Allow "Zuite" and "ListBox" that are used in zelenium tests.
 - Allow "DCWorkflow" that is used in some workflow scripts.
parent 58144924
...@@ -59,28 +59,31 @@ def getSkinPrefixList(self): ...@@ -59,28 +59,31 @@ def getSkinPrefixList(self):
skin_prefix_list.append(portal_prefix) skin_prefix_list.append(portal_prefix)
# Add document classes prefix # Add document classes prefix
from Products.ERP5Type import Document skin_prefix_list.extend(self.portal_types.getDocumentTypeList())
for document_class in Document.__dict__.keys():
if not document_class.startswith('add') and \ # Add mixins prefix
not document_class.startswith('new') and \ skin_prefix_list.extend(self.portal_types.getMixinTypeList())
not document_class.startswith('_'):
skin_prefix_list.append(document_class)
# Add interfaces prefix # Add interfaces prefix
skin_prefix_list.extend(self.portal_types.getInterfaceTypeList())
# XXX getInterfaceTypeList seems empty ... keep this low-level way for now.
from Products.ERP5Type import interfaces from Products.ERP5Type import interfaces
for interface_name in interfaces.__dict__.keys(): for interface_name in interfaces.__dict__.keys():
if interface_name.startswith('I'): if interface_name.startswith('I'):
skin_prefix_list.append(interface_name[1:])
# XXX do we really add with the I prefix ?
skin_prefix_list.append(interface_name) skin_prefix_list.append(interface_name)
# Add other prefix # Add other prefix
skin_prefix_list.extend(( skin_prefix_list.extend((
'Base',
'ERP5Site',
'ERP5Type', 'ERP5Type',
'Entity', # A base class for Person / Organisation 'Entity', # A base class for Person / Organisation
'Zuite', # Products.Zelenium test suites 'Zuite', # Products.Zelenium test suites
'Form', # Acceptable for ERP5 Forms which will soon become portal types too 'Form', # Acceptable for ERP5 Forms which will soon become portal types too
'ListBox',
'DCWorkflow', # some workflow script use this, not sure it's correct.
'Zuite', # from Zelenium
'Brain', # Catalog brains 'Brain', # Catalog brains
)) ))
......
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