[Checkins] SVN: martian/trunk/ move some functions that were really
grok-specific back into grok.
Martijn Faassen
faassen at infrae.com
Thu Jan 24 11:38:57 EST 2008
Log message for revision 83173:
move some functions that were really grok-specific back into grok.
Changed:
U martian/trunk/CHANGES.txt
U martian/trunk/src/martian/util.py
-=-
Modified: martian/trunk/CHANGES.txt
===================================================================
--- martian/trunk/CHANGES.txt 2008-01-24 16:25:20 UTC (rev 83172)
+++ martian/trunk/CHANGES.txt 2008-01-24 16:38:57 UTC (rev 83173)
@@ -13,6 +13,12 @@
called. Subclasses need to override this to return the default value
to use.
+Restructuring
+-------------
+
+* Move some util functions that were really grok-specific out of Martian
+ back into Grok.
+
0.9.2 (2007-11-20)
==================
Modified: martian/trunk/src/martian/util.py
===================================================================
--- martian/trunk/src/martian/util.py 2008-01-24 16:25:20 UTC (rev 83172)
+++ martian/trunk/src/martian/util.py 2008-01-24 16:38:57 UTC (rev 83173)
@@ -87,16 +87,6 @@
return obj_module == dotted_name
-AMBIGUOUS_CONTEXT = object()
-def check_context(component, context):
- if context is None:
- raise GrokError("No module-level context for %r, please use "
- "grok.context." % component, component)
- elif context is AMBIGUOUS_CONTEXT:
- raise GrokError("Multiple possible contexts for %r, please use "
- "grok.context." % component, component)
-
-
def check_implements_one(class_):
check_implements_one_from_list(list(interface.implementedBy(class_)),
class_)
@@ -127,27 +117,6 @@
result.add(obj)
return list(result)
-def determine_module_context(module_info, models):
- if len(models) == 0:
- context = None
- elif len(models) == 1:
- context = models[0]
- else:
- context = AMBIGUOUS_CONTEXT
-
- module_context = module_info.getAnnotation('grok.context', None)
- if module_context:
- context = module_context
-
- return context
-
-
-def determine_class_context(class_, module_context):
- context = class_annotation(class_, 'grok.context', module_context)
- check_context(class_, context)
- return context
-
-
def methods_from_class(class_):
# XXX Problem with zope.interface here that makes us special-case
# __provides__.
More information about the Checkins
mailing list