[Checkins] SVN: grokcore.component/branches/jw-philipp-using-ndir-directives/src/grokcore/component/ martian.ndir has been renamed and exposed by the martian module, therefore import the new-style directive stuff from martian directly

Philipp von Weitershausen philikon at philikon.de
Sat May 3 08:25:07 EDT 2008


Log message for revision 86201:
  martian.ndir has been renamed and exposed by the martian module, therefore import the new-style directive stuff from martian directly

Changed:
  U   grokcore.component/branches/jw-philipp-using-ndir-directives/src/grokcore/component/__init__.py
  U   grokcore.component/branches/jw-philipp-using-ndir-directives/src/grokcore/component/directive.py

-=-
Modified: grokcore.component/branches/jw-philipp-using-ndir-directives/src/grokcore/component/__init__.py
===================================================================
--- grokcore.component/branches/jw-philipp-using-ndir-directives/src/grokcore/component/__init__.py	2008-05-03 12:24:03 UTC (rev 86200)
+++ grokcore.component/branches/jw-philipp-using-ndir-directives/src/grokcore/component/__init__.py	2008-05-03 12:25:06 UTC (rev 86201)
@@ -20,9 +20,9 @@
 from martian import ClassGrokker, InstanceGrokker, GlobalGrokker
 from grokcore.component.components import Adapter, GlobalUtility, MultiAdapter, Context
 
-from grokcore.component.directive import (context, name, title,
-                            provides, baseclass, global_utility,
-                            direct, order)
+from martian import baseclass
+from grokcore.component.directive import (
+    context, name, title, provides, global_utility, direct, order)
 from grokcore.component.decorators import subscribe, adapter, implementer
 from martian.error import GrokError, GrokImportError
 

Modified: grokcore.component/branches/jw-philipp-using-ndir-directives/src/grokcore/component/directive.py
===================================================================
--- grokcore.component/branches/jw-philipp-using-ndir-directives/src/grokcore/component/directive.py	2008-05-03 12:24:03 UTC (rev 86200)
+++ grokcore.component/branches/jw-philipp-using-ndir-directives/src/grokcore/component/directive.py	2008-05-03 12:25:06 UTC (rev 86201)
@@ -13,15 +13,13 @@
 ##############################################################################
 """Grok directives.
 """
+import martian
 import grokcore.component
 from zope.interface.interfaces import IInterface
-
 from martian.error import GrokImportError
-from martian import ndir
-from martian.ndir import baseclass
 
-class global_utility(ndir.MultipleTimesDirective):
-    scope = ndir.MODULE
+class global_utility(martian.MultipleTimesDirective):
+    scope = martian.MODULE
 
     def factory(self, factory, provides=None, name=u'', direct=False):
         if provides is not None and not IInterface.providedBy(provides):
@@ -46,9 +44,9 @@
             name = grokcore.component.name.get(factory)
         self.name = name
 
-class order(ndir.Directive):
-    scope = ndir.CLASS
-    store = ndir.ONCE
+class order(martian.Directive):
+    scope = martian.CLASS
+    store = martian.ONCE
     default = 0, 0
 
     _order = 0
@@ -57,26 +55,26 @@
         order._order += 1
         return value, order._order
 
-class name(ndir.Directive):
-    scope = ndir.CLASS
-    store = ndir.ONCE
+class name(martian.Directive):
+    scope = martian.CLASS
+    store = martian.ONCE
     default = u''
-    validate = ndir.validateText
+    validate = martian.validateText
 
-class context(ndir.Directive):
-    scope = ndir.CLASS_OR_MODULE
-    store = ndir.ONCE
-    validate = ndir.validateInterfaceOrClass
+class context(martian.Directive):
+    scope = martian.CLASS_OR_MODULE
+    store = martian.ONCE
+    validate = martian.validateInterfaceOrClass
 
-class title(ndir.Directive):
-    scope = ndir.CLASS
-    store = ndir.ONCE
-    validate = ndir.validateText
+class title(martian.Directive):
+    scope = martian.CLASS
+    store = martian.ONCE
+    validate = martian.validateText
 
-class direct(ndir.MarkerDirective):
-    scope = ndir.CLASS
+class direct(martian.MarkerDirective):
+    scope = martian.CLASS
 
-class provides(ndir.Directive):
-    scope = ndir.CLASS
-    store = ndir.ONCE
-    validate = ndir.validateInterface
+class provides(martian.Directive):
+    scope = martian.CLASS
+    store = martian.ONCE
+    validate = martian.validateInterface



More information about the Checkins mailing list