From: <cl...@us...> - 2003-09-25 19:12:02
|
Update of /cvsroot/todo-manager/todo-manager In directory sc8-pr-cvs1:/tmp/cvs-serv31461 Modified Files: main.py plugin.py Log Message: Yeh! the first commit in a looong while. I have improved the plugin loading system in the following ways: * The root 'todo-manager' directory is added to the import path so plugins can now access every native module in the package. * plugins no long have to be passed a reference to the plugin module. Index: main.py =================================================================== RCS file: /cvsroot/todo-manager/todo-manager/main.py,v retrieving revision 1.82 retrieving revision 1.83 diff -u -d -r1.82 -r1.83 --- main.py 14 May 2003 02:13:52 -0000 1.82 +++ main.py 25 Sep 2003 19:11:53 -0000 1.83 @@ -24,11 +24,10 @@ from tdmcalls import * import plugin -# So the plugin module has a refrence of itself to pass onto plugins -plugin.plugin_module = plugin - import thread +# Add the main source directory to the path for import operations +sys.path.append(get_root_directory()) # gettext setup _ = get_translation('core') Index: plugin.py =================================================================== RCS file: /cvsroot/todo-manager/todo-manager/plugin.py,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- plugin.py 2 May 2003 03:56:32 -0000 1.9 +++ plugin.py 25 Sep 2003 19:11:53 -0000 1.10 @@ -45,10 +45,6 @@ print _("Unable to load plugin from file: %s" %file) return None - # If the plugin_module is set, then tell the new plugin - if plugin_module: - mod.plugin = plugin_module - p = plugin.copy() try: @@ -83,8 +79,6 @@ # This function is called to load all of the plugins from the plugins directory def load_all_plugins(path): # If plugin_module equals None then don't load any plugins - if not plugin_module: return - plugins = get_all_plugins(path) if plugins: |