Remove getCallback indirection in modules
Instead, assume that the imported module contains the Callback class
that was previously returned by getCallback. This is done to prevent
a circular import (caused by the __init__ importing a submodule).
--- a/app/settings.py Sat Jun 06 19:42:54 2009 +0200
+++ b/app/settings.py Sat Jun 06 20:29:09 2009 +0200
@@ -110,5 +110,5 @@
# 'django.contrib.sites',
)
-MODULE_FMT = 'soc.modules.%s'
+MODULE_FMT = 'soc.modules.%s.callback'
MODULES = ['ghop']
--- a/app/soc/modules/core.py Sat Jun 06 19:42:54 2009 +0200
+++ b/app/soc/modules/core.py Sat Jun 06 20:29:09 2009 +0200
@@ -190,7 +190,7 @@
modules = ['soc_core'] + settings.MODULES
modules = [__import__(fmt % i, fromlist=['']) for i in modules]
- for callback_class in [i.getCallback() for i in modules]:
+ for callback_class in [i.Callback for i in modules]:
if callback_class.API_VERSION != self.API_VERSION:
raise APIVersionMismatch(self.API_VERSION,
callback_class.API_VERSION)
--- a/app/soc/modules/soc_core/__init__.py Sat Jun 06 19:42:54 2009 +0200
+++ b/app/soc/modules/soc_core/__init__.py Sat Jun 06 20:29:09 2009 +0200
@@ -15,15 +15,3 @@
"""This is the main modules module.
"""
-
-__authors__ = [
- '"Sverre Rabbelier" <sverre@rabbelier.nl>',
- '"Lennard de Rijk" <ljvderijk@gmail.com>',
- ]
-
-
-
-from soc.modules.soc_core import callback
-
-def getCallback():
- return callback.Callback