Ticket #1516: 0001-Import-plugins-as-modules-not-as-files.patch

File 0001-Import-plugins-as-modules-not-as-files.patch, 895 bytes (added by alsroot, 13 years ago)
  • backend.py

    From 13c7003c56e7d09b76adf6a0782c9581abce2868 Mon Sep 17 00:00:00 2001
    From: Aleksey Lim <alsroot@activitycentral.org>
    Date: Tue, 8 Feb 2011 14:33:15 +0000
    Subject: [PATCH] Import plugins as modules, not as files
    
    ---
     backend.py          |    2 +-
     1 files changed, 1 insertions(+), 1 deletions(-)
     create mode 100644 plugins/__init__.py
    
    diff --git a/backend.py b/backend.py
    index a26176b..eaed0f3 100755
    a b class PluginManager: 
    184184                plugin_fn = os.path.splitext(fn)[0]
    185185
    186186                # Import
    187                 p = __import__(os.path.join(self.plugin_dir, plugin_fn))
     187                p = __import__('.'.join([self.plugin_dir, plugin_fn]))
    188188                self.plugins.append(p)
    189189
    190190                if debug_info: