2012-06-22 02:00:04 +00:00
|
|
|
"""For starting up remote processes"""
|
2012-08-17 20:15:13 +00:00
|
|
|
import sys, pickle, os
|
2012-06-22 02:00:04 +00:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2012-08-17 20:15:13 +00:00
|
|
|
os.setpgrp() ## prevents signals (notably keyboard interrupt) being forwarded from parent to this process
|
2012-06-22 02:00:04 +00:00
|
|
|
name, port, authkey, targetStr, path = pickle.load(sys.stdin)
|
|
|
|
if path is not None:
|
|
|
|
## rewrite sys.path without assigning a new object--no idea who already has a reference to the existing list.
|
|
|
|
while len(sys.path) > 0:
|
|
|
|
sys.path.pop()
|
|
|
|
sys.path.extend(path)
|
|
|
|
#import pyqtgraph
|
|
|
|
#import pyqtgraph.multiprocess.processes
|
|
|
|
target = pickle.loads(targetStr) ## unpickling the target should import everything we need
|
|
|
|
target(name, port, authkey)
|
|
|
|
sys.exit(0)
|