Commit 5cfe3488 authored by Maude Le Jeune's avatar Maude Le Jeune
Browse files

Merge branch 'master' of git@gitorious.org:pipelet/pipelet

parents 3a7215ea f7252166
...@@ -131,7 +131,7 @@ class Pipeline: ...@@ -131,7 +131,7 @@ class Pipeline:
self.compute_hash() self.compute_hash()
## string, sql data base ## string, sql data base
self.sqlfile=sqlfile self.sqlfile=path.expanduser(path.expandvars(sqlfile))
## boolean, if true, turn the matplotlib backend to Agg ## boolean, if true, turn the matplotlib backend to Agg
self.matplotlib = matplotlib self.matplotlib = matplotlib
......
...@@ -65,7 +65,7 @@ class Repository: ...@@ -65,7 +65,7 @@ class Repository:
return bool(self._ext_re.match(path.splitext(f)[1])) return bool(self._ext_re.match(path.splitext(f)[1]))
def get_directive(self, Direct, seg): def get_directive(self, Direct, seg):
c = self.get_code_string(seg) c = self.get_code_string(seg)+'\n'.join(self._hook[seg].values())
d = Direct() d = Direct()
for l in c.splitlines(): for l in c.splitlines():
try: try:
...@@ -252,7 +252,7 @@ class LocalRepository(Repository): ...@@ -252,7 +252,7 @@ class LocalRepository(Repository):
s = re.findall('^(.+?)\d+$',seg)[0] s = re.findall('^(.+?)\d+$',seg)[0]
f = [self.get_code_file(s)] f = [self.get_code_file(s)]
except: except:
raise Exception('No source file corresponding to segment') raise Exception('No source file corresponding to segment %s'%seg)
return f[0] return f[0]
def get_hook_file(self, seg, hook): def get_hook_file(self, seg, hook):
......
...@@ -62,6 +62,12 @@ def main(options, args): ...@@ -62,6 +62,12 @@ def main(options, args):
signal.signal(signal.SIGABRT, catch_sigterm) signal.signal(signal.SIGABRT, catch_sigterm)
signal.signal(signal.SIGINT, catch_sigterm) signal.signal(signal.SIGINT, catch_sigterm)
if options.buffer:
old = pipe.sqlfile
pipe.sqlfile = options.buffer
shutil.copy(old, options.buffer)
try: try:
# Launching the scheduler # Launching the scheduler
class SchedulerManager(BaseManager): class SchedulerManager(BaseManager):
...@@ -69,11 +75,11 @@ def main(options, args): ...@@ -69,11 +75,11 @@ def main(options, args):
""" """
pass pass
if options.buffer: # Now that logging is set up decouple from parent environnement
old = pipe.sqlfile redirect_stream(sys.stdin, None)
pipe.sqlfile = options.buffer redirect_stream(sys.stdout, None)
shutil.copy(old, options.buffer) redirect_stream(sys.stderr, None)
s = scheduler.Scheduler(pipe) s = scheduler.Scheduler(pipe)
SchedulerManager.register('get_scheduler', callable=lambda:s) SchedulerManager.register('get_scheduler', callable=lambda:s)
...@@ -81,12 +87,6 @@ def main(options, args): ...@@ -81,12 +87,6 @@ def main(options, args):
mgr.start() mgr.start()
print "Started" print "Started"
# Now that logging is set up decouple from parent environnement
redirect_stream(sys.stdin, None)
redirect_stream(sys.stdout, None)
redirect_stream(sys.stderr, None)
os.chdir(WORKDIR)
sched_proxy = mgr.get_scheduler() sched_proxy = mgr.get_scheduler()
sched_proxy.run() sched_proxy.run()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment