This commit is contained in:
yumoqing 2022-09-14 10:08:50 +08:00
parent fc6b4df94e
commit 58a79e2602
3 changed files with 6 additions and 7 deletions

View File

@ -110,10 +110,7 @@ class Blocks(EventDispatcher):
self.register_event_type('on_failed') self.register_event_type('on_failed')
self.env = GlobalEnv() self.env = GlobalEnv()
config = getConfig() config = getConfig()
if config.script_root: self.script = Script()
self.script = Script(config.script_root)
else:
self.script = Script(config.workdir)
def set(self, k:str, v): def set(self, k:str, v):
self.env[k] = v self.env[k] = v

View File

@ -23,8 +23,10 @@ def set_script_env(n,v):
env.update({n:v}) env.update({n:v})
class Script: class Script:
def __init__(self, root): def __init__(self):
self.root = root config = getConfig()
self.root = config.script_root
print('Script.root=', self.root)
self.env = {} self.env = {}
self.handlers = {} self.handlers = {}
self.register('.tmpl', TemplateHandler) self.register('.tmpl', TemplateHandler)

View File

@ -1 +1 @@
__version__ = '0.3.9' __version__ = '0.3.10'