aboutsummaryrefslogtreecommitdiff
path: root/cbc/environment.py
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-06-23 09:28:34 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-06-23 09:28:34 -0400
commit3a8198bfb603a6aaf3cc795f753d741530bdcb51 (patch)
treefae26ec465ce19c3e92470411b94eaaccc736912 /cbc/environment.py
parentdefbf2d0d1ff6520bb3f7aab9904c0f239de784e (diff)
downloadcbc-3a8198bfb603a6aaf3cc795f753d741530bdcb51.tar.gz
Refactored and split apart exceptions
Diffstat (limited to 'cbc/environment.py')
-rwxr-xr-xcbc/environment.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/cbc/environment.py b/cbc/environment.py
index 78b64cc..34d77b2 100755
--- a/cbc/environment.py
+++ b/cbc/environment.py
@@ -1,7 +1,8 @@
import os
+from .exceptions import IncompleteEnv
+from tempfile import TemporaryDirectory
+import time
-class IncompleteEnv(Exception):
- pass
class Environment(object):
def __init__(self, *args, **kwargs):
@@ -19,10 +20,17 @@ class Environment(object):
if not os.path.exists(self.cbchome):
os.makedirs(self.cbchome)
-
+
+ temp_prefix = os.path.basename(os.path.splitext(__name__)[0])
+ tempdir = TemporaryDirectory(prefix=temp_prefix, dir=self.cbchome)
+ self.working_dir = tempdir.name
+ time.sleep(10)
self.config['meta'] = self.join('meta.yaml')
self.config['build'] = self.join('build.sh')
self.config['build_windows'] = self.join('bld.bat')
+ print(self.working_dir)
def join(self, path):
- return os.path.join(self.cbchome, path) \ No newline at end of file
+ return os.path.join(self.cbchome, path)
+
+ \ No newline at end of file