diff options
Diffstat (limited to 'cbc/environment.py')
-rwxr-xr-x | cbc/environment.py | 16 |
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 |