diff options
author | Chad Austin <chad@imvu.com> | 2013-01-28 18:08:22 -0800 |
---|---|---|
committer | Chad Austin <chad@imvu.com> | 2013-03-04 19:01:45 -0800 |
commit | 531931628897969a228c83f136d231599f486a70 (patch) | |
tree | d3a0df347486be228637c7774a965bf085111916 /tools | |
parent | 8dc0e2b7deca6b366066a1b94fe31b7ba4a2b2d0 (diff) |
Integrate azakai's style feedback and make sanity tests pass again.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/js_optimizer.py | 2 | ||||
-rw-r--r-- | tools/shared.py | 15 |
2 files changed, 9 insertions, 8 deletions
diff --git a/tools/js_optimizer.py b/tools/js_optimizer.py index c1e800c3..533242b2 100644 --- a/tools/js_optimizer.py +++ b/tools/js_optimizer.py @@ -2,7 +2,7 @@ import os, sys, subprocess, multiprocessing, re import shared -temp_files = shared.ConfigureTempFiles() +temp_files = shared.make_temp_files() __rootpath__ = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) def path_from_root(*pathelems): diff --git a/tools/shared.py b/tools/shared.py index f46942e6..1005a48d 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -302,7 +302,7 @@ except: CANONICAL_TEMP_DIR = os.path.join(TEMP_DIR, 'emscripten_temp') class Configuration: - def __init__(self, environ=os.environ): + def __init__(self, environ): self.DEBUG = environ.get('EMCC_DEBUG') self.EMSCRIPTEN_TEMP_DIR = None @@ -314,7 +314,8 @@ class Configuration: except Exception, e: print >> sys.stderr, e, 'Could not create canonical temp dir. Check definition of TEMP_DIR in ~/.emscripten' -configuration = Configuration() +configuration = Configuration( + environ=os.environ) DEBUG = configuration.DEBUG EMSCRIPTEN_TEMP_DIR = configuration.EMSCRIPTEN_TEMP_DIR DEBUG_CACHE = DEBUG and "cache" in DEBUG @@ -429,9 +430,9 @@ def try_delete(filename): pass class TempFiles: - def __init__(self, tmp, saveDebugFiles=False): + def __init__(self, tmp, save_debug_files=False): self.tmp = tmp - self.saveDebugFiles = saveDebugFiles + self.save_debug_files = save_debug_files self.to_clean = [] @@ -445,7 +446,7 @@ class TempFiles: return named_file def clean(self): - if self.saveDebugFiles: + if self.save_debug_files: print >> sys.stderr, 'not cleaning up temp files since in debug-save mode, see them in %s' % (self.tmp,) return for filename in self.to_clean: @@ -458,10 +459,10 @@ class TempFiles: finally: self.clean() -def ConfigureTempFiles(configuration=configuration): +def make_temp_files(configuration=configuration): return TempFiles( tmp=TEMP_DIR if not configuration.DEBUG else configuration.EMSCRIPTEN_TEMP_DIR, - saveDebugFiles=os.environ.get('EMCC_DEBUG_SAVE')) + save_debug_files=os.environ.get('EMCC_DEBUG_SAVE')) # Utilities |