# HG changeset patch # User Sverre Rabbelier # Date 1244312949 -7200 # Node ID 4f87bab3c6b3d3665c5401b15c846e7251bb97a4 # Parent 92cfd29a363dcdf0ba0582fe6092db94d835cf18 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). diff -r 92cfd29a363d -r 4f87bab3c6b3 app/settings.py --- 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'] diff -r 92cfd29a363d -r 4f87bab3c6b3 app/soc/modules/core.py --- 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) diff -r 92cfd29a363d -r 4f87bab3c6b3 app/soc/modules/soc_core/__init__.py --- 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" ', - '"Lennard de Rijk" ', - ] - - - -from soc.modules.soc_core import callback - -def getCallback(): - return callback.Callback