mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
09122265fd
commit
e3873e4254
@ -167,7 +167,8 @@ class Worker(object):
|
|||||||
'''
|
'''
|
||||||
exe = self.gui_executable if self.gui else self.executable
|
exe = self.gui_executable if self.gui else self.executable
|
||||||
env = self.env
|
env = self.env
|
||||||
env['ORIGWD'] = cwd or os.path.abspath(os.getcwd())
|
env[b'ORIGWD'] = binascii.hexlify(cPickle.dumps(cwd or
|
||||||
|
os.path.abspath(os.getcwdu())))
|
||||||
_cwd = cwd
|
_cwd = cwd
|
||||||
if priority is None:
|
if priority is None:
|
||||||
priority = prefs['worker_process_priority']
|
priority = prefs['worker_process_priority']
|
||||||
|
@ -5,7 +5,7 @@ __license__ = 'GPL v3'
|
|||||||
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import sys, cPickle, os
|
import sys, cPickle, os, binascii
|
||||||
from code import InteractiveInterpreter
|
from code import InteractiveInterpreter
|
||||||
from Queue import Queue, Empty
|
from Queue import Queue, Empty
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
@ -130,7 +130,7 @@ class Interpreter(InteractiveInterpreter): # {{{
|
|||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
def connect():
|
def connect():
|
||||||
os.chdir(os.environ['ORIGWD'])
|
os.chdir(cPickle.loads(binascii.unhexlify(os.environ['ORIGWD'])))
|
||||||
address = cPickle.loads(unhexlify(os.environ['CALIBRE_WORKER_ADDRESS']))
|
address = cPickle.loads(unhexlify(os.environ['CALIBRE_WORKER_ADDRESS']))
|
||||||
key = unhexlify(os.environ['CALIBRE_WORKER_KEY'])
|
key = unhexlify(os.environ['CALIBRE_WORKER_KEY'])
|
||||||
return Client(address, authkey=key)
|
return Client(address, authkey=key)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user