diff options
author | erikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0> | 2007-12-14 04:03:14 (GMT) |
---|---|---|
committer | erikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0> | 2007-12-14 04:03:14 (GMT) |
commit | f706c43145128d40f8c639059800fe7282abe063 (patch) | |
tree | 9be98c6f44599722a4469fd08349a9c03d23197d /instance.py | |
parent | 24abbc6129ac8b3b24eb30aa474fe5792239c817 (diff) |
46 has correct rainbow tmp directories
git-svn-id: http://mediamods.com/public-svn/camera-activity/tags/46@973 574bc980-5f2d-0410-acbc-c8f9f0eb14e0
Diffstat (limited to 'instance.py')
-rw-r--r-- | instance.py | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/instance.py b/instance.py index 1c9db31..729bb5e 100644 --- a/instance.py +++ b/instance.py @@ -21,31 +21,23 @@ class Instance: instanceId = None tmpPath = None - instancePath = None + dataPath = None def __init__(self, ca): self.__class__.instanceId = ca._activity_id - tmpPath = os.path.join( ca.get_activity_root(), "tmp" ) - self.__class__.tmpPath = os.path.join( tmpPath, str(self.__class__.instanceId)) + + self.__class__.tmpPath = os.path.join(ca.get_activity_root(), "tmp") recreateTmp() - self.__class__.instancePath = os.path.join( ca.get_activity_root(), "instance" ) + self.__class__.dataPath = os.path.join(ca.get_activity_root(), "data") recreateInstance() def recreateTmp(): - #todo: figure out how to have multiple spaces for my media - #problem is, if new instance is created, with this code, it clears the whole tmp directory! - if (os.path.exists(Instance.tmpPath)): - shutil.rmtree(Instance.tmpPath) if (not os.path.exists(Instance.tmpPath)): os.makedirs(Instance.tmpPath) -def recreateInstance(): - #todo: figure out how to have multiple spaces for my media - #problem is, if new instance is created, with this code, it clears the whole tmp directory! - if (os.path.exists(Instance.instancePath)): - shutil.rmtree(Instance.instancePath) - if (not os.path.exists(Instance.instancePath)): - os.makedirs(Instance.instancePath)
\ No newline at end of file +def recreateData(): + if (not os.path.exists(Instance.dataPath)): + os.makedirs(Instance.dataPath)
\ No newline at end of file |