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

CodingStyle: simplify prefix for interfaces

Now that getInterfaceTypeList also return file system interface, we can
use it directly.

Also simplify a bit by not getting types tool multiple times.

One breaking change is that for an interface like ISomething, ISomething
is no longer a valid prefix, only Something. So scripts like
ISomething_getSomething are not valid, only Something_getSomething.
parent bbbbe42c
Pipeline #9033 failed with stage
in 0 seconds
......@@ -52,21 +52,13 @@ def getSkinPrefixList(self):
skin_prefix_list.append(portal_prefix)
# Add document classes prefix
skin_prefix_list.extend(self.portal_types.getDocumentTypeList())
skin_prefix_list.extend(portal_types.getDocumentTypeList())
# Add mixins prefix
skin_prefix_list.extend(self.portal_types.getMixinTypeList())
# Add interfaces prefix
# XXX getInterfaceTypeList does not include file system interfaces ... keep this low-level way for now.
from Products.ERP5Type import interfaces
for interface_name in (
list(interfaces.__dict__.keys())
+ list(self.portal_types.getInterfaceTypeList())):
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.extend(portal_types.getMixinTypeList())
# Add interfaces prefix, without the I prefix
skin_prefix_list.extend([x[1:] for x in portal_types.getInterfaceTypeList()])
# Add other prefix
skin_prefix_list.extend((
......
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