PackageManager: Fix Template module injection

master
Harald Wolff 2018-03-09 16:08:43 +01:00
parent ed0ffd3d66
commit b32507cf63
1 changed files with 5 additions and 2 deletions

View File

@ -48,8 +48,8 @@ class Package:
def __load(self):
print("Package.__load(): Path=%s" % (self.__path,))
setattr( self.__mod, "Templates", hserver.TemplateModule("%s/templates" % (self.__path,)) )
self.__modules["%s.Templates" % (self.__modpath,)] = self.__mod.Templates
self.__templates = hserver.TemplateModule("%s/templates" % (self.__path,))
self.__modules["%s.Templates" % (self.__modpath,)] = self.__templates
if os.path.exists("%s/package.conf" % (self.__path,)):
pcn = "%s/package.conf" % (self.__path,)
@ -182,6 +182,9 @@ class Package:
f.close()
co = compile( src, mod.__file__, "exec" )
mod.Templates = self.__templates
exec( co, mod.__dict__ )
def __export(self, name, o, glob=False):