]> git.phdru.name Git - bookmarks_db.git/commitdiff
Pass subproc_* parameters to the subprocess
authorOleg Broytman <phd@phdru.name>
Fri, 4 Jul 2014 22:09:10 +0000 (02:09 +0400)
committerOleg Broytman <phd@phdru.name>
Fri, 4 Jul 2014 22:09:10 +0000 (02:09 +0400)
Robots/bkmk_rforking.py

index e1b4ee24a74d3717317855e8cb9eede270f9f423..0d41c747585d483ee1d0131e3d1acb55282a7b42 100644 (file)
@@ -53,7 +53,15 @@ class robot_forking(Robot):
       global _set_subproc
       if _set_subproc:
          _set_subproc = False
-         os.environ['BKMK_ROBOT'] = self.subproc
+
+         subproc = self.subproc
+         subproc_attrs = []
+         for attr in dir(self):
+             if attr.startswith('subproc_'):
+                 subproc_attrs.append((attr[len('subproc_'):], getattr(self, attr)))
+         if subproc_attrs:
+             subproc += ':' + ':'.join(['='.join((k,v)) for k,v in subproc_attrs])
+         os.environ['BKMK_ROBOT'] = subproc
 
       if not check_subp:
          restart_subp(self.log) # Not restart, just start afresh