Browse Source

Load context now uses the original lodel package as context

Yann Weber 8 years ago
parent
commit
5e46a8f791
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      lodel/context.py

+ 4
- 2
lodel/context.py View File

@@ -68,9 +68,9 @@ def dir_for_context(site_identifier):
68 68
 class LodelMetaPathFinder(importlib.abc.MetaPathFinder):
69 69
     
70 70
     def find_spec(fullname, path, target = None):
71
-        print("find_spec called : fullname=%s path=%s target=%s" % (
72
-            fullname, path, target))
73 71
         if fullname.startswith(CTX_PKG):
72
+            print("find_spec called : fullname=%s path=%s target=%s" % (
73
+                fullname, path, target))
74 74
             spl = fullname.split('.')
75 75
             site_identifier = spl[1]
76 76
             #creating a symlink to represent the lodel site package
@@ -126,6 +126,8 @@ site_id when we are in MONOSITE beahvior")
126 126
                     "A context named '%s' allready exists." % site_id)
127 127
             self.__id = site_id
128 128
             self.__pkg_name = '%s.%s' % (CTX_PKG, site_id)
129
+            if self.__id == LOAD_CTX:
130
+                self.__pkg_name = 'lodel'
129 131
             #Importing the site package to trigger its creation
130 132
             self.__package = importlib.import_module(self.__pkg_name)
131 133
             self.__class__._contexts[site_id] = self

Loading…
Cancel
Save