added mkdir flag to Session.__init__() to allow adopting existing sessions

(Boeing r1786)
This commit is contained in:
ahrenholz 2013-10-25 15:21:08 +00:00
parent 0fc51e38bf
commit d00a49d682

View file

@ -45,7 +45,7 @@ class Session(object):
''' CORE session manager.
'''
def __init__(self, sessionid = None, cfg = {}, server = None,
persistent = False):
persistent = False, mkdir = True):
if sessionid is None:
# try to keep this short since it's used to construct
# network interface names
@ -57,6 +57,7 @@ class Session(object):
self.sessionid = sessionid
self.sessiondir = os.path.join(tempfile.gettempdir(),
"pycore.%s" % self.sessionid)
if mkdir:
os.mkdir(self.sessiondir)
self.name = None
self.filename = None