changeset 1820:243ce99c0e32

merged
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 02 Oct 2012 21:54:03 +0200
parents 22926dea4ac9 (current diff) 38632887ca57 (diff)
children 0526be2e2221 d4ad8f78afbf
files
diffstat 1 files changed, 4 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/items/content.py	Mon Oct 01 14:24:35 2012 +0200
+++ b/MoinMoin/items/content.py	Tue Oct 02 21:54:03 2012 +0200
@@ -94,15 +94,12 @@
         self.group_names = group_names
         self.groups = dict([(g, []) for g in group_names])
 
-    def register(self, factory, contenttype, default_contenttype_params, display_name, group, ingroup_order, priority=RegistryBase.PRIORITY_MIDDLE):
+    def register(self, e, group):
         """
-        Register a factory
-
-        :param factory: Factory to register. Callable, must return an object.
+        Register a contenttype entry and optionally add it to a specific group.
         """
-        e = self.Entry(factory, contenttype, default_contenttype_params, display_name, ingroup_order, priority)
         # If group is specified and contenttype is not a wildcard one
-        if group and contenttype.type and contenttype.subtype:
+        if group and e.content_type.type and e.content_type.subtype:
             if group not in self.groups:
                 raise ValueError('Unknown group name: {0}'.format(group))
             self.groups[group].append(e)
@@ -121,7 +118,7 @@
 ])
 
 def register(cls):
-    content_registry.register(cls._factory, Type(cls.contenttype), cls.default_contenttype_params, cls.display_name, cls.group, cls.ingroup_order)
+    content_registry.register(RegistryContent.Entry(cls._factory, Type(cls.contenttype), cls.default_contenttype_params, cls.display_name, cls.ingroup_order, RegistryContent.PRIORITY_MIDDLE), cls.group)
     return cls