Browse Source

Dirty workaround in plugins

Yann Weber 8 years ago
parent
commit
93b713edf0
2 changed files with 4 additions and 1 deletions
  1. 1
    1
      lodel/context.py
  2. 3
    0
      lodel/plugin/plugins.py

+ 1
- 1
lodel/context.py View File

524
     #@return The module name in the current context
524
     #@return The module name in the current context
525
     def _translate(self, module_fullname):
525
     def _translate(self, module_fullname):
526
         if module_fullname.startswith('lodel'):
526
         if module_fullname.startswith('lodel'):
527
-            return module_fullname.replace('lodel', self.__pkg_name)
527
+            return self.__pkg_name + module_fullname[5:]
528
         if module_fullname.startswith('leapi_dyncode'):
528
         if module_fullname.startswith('leapi_dyncode'):
529
             return self.__pkg_name+'.'+module_fullname
529
             return self.__pkg_name+'.'+module_fullname
530
         raise ContextModuleError("Given module is not lodel nor dyncode \
530
         raise ContextModuleError("Given module is not lodel nor dyncode \

+ 3
- 0
lodel/plugin/plugins.py View File

431
    
431
    
432
     ##@brief Return associated module name
432
     ##@brief Return associated module name
433
     def module_name(self):
433
     def module_name(self):
434
+        #WOOT WE LOVE DIRTY WORKAROUNDS !!!
435
+        return "lodel.plugins."+os.path.basename(self.path)
436
+        #END OF DIRTY WORKAROUND
434
         if not self.path.startswith('./plugins'):
437
         if not self.path.startswith('./plugins'):
435
             raise PluginError("Bad path for plugin %s : %s" % (
438
             raise PluginError("Bad path for plugin %s : %s" % (
436
                 self.name, self.path))
439
                 self.name, self.path))

Loading…
Cancel
Save