def _strings_path_from_path(path): """Calculate and cache `strings $path` and return the cached path.""" from hashlib import md5 import applib import buildutils from os.path import exists cache_dir = join( applib.user_cache_dir("komodo-dev", "ActiveState"), "strings") strings_dir = join(cache_dir, md5(dirname(path)).hexdigest()) strings_path = join(strings_dir, basename(path)+".strings") if not exists(strings_dir): os.makedirs(strings_dir) stdout = buildutils.capture_stdout(["strings", path]) fout = open(strings_path, 'w') fout.write(stdout) fout.close() return strings_path
def _strings_path_from_path(path): """Calculate and cache `strings $path` and return the cached path.""" from hashlib import md5 import applib import buildutils from os.path import exists cache_dir = join(applib.user_cache_dir("komodo-dev", "ActiveState"), "strings") strings_dir = join(cache_dir, md5(dirname(path)).hexdigest()) strings_path = join(strings_dir, basename(path) + ".strings") if not exists(strings_dir): os.makedirs(strings_dir) stdout = buildutils.capture_stdout(["strings", path]) fout = open(strings_path, 'w') fout.write(stdout) fout.close() return strings_path
def _od_path_from_path(path, od_opts=["-c"]): """Calculate and cache `od $od_opts $path` and return the cached path.""" from hashlib import md5 import applib import buildutils import which from os.path import exists cache_dir = join(applib.user_cache_dir("komodo-dev", "ActiveState"), "od") od_dir = join(cache_dir, md5(dirname(path)).hexdigest()) od_path = join(od_dir, basename(path) + ".od") if not exists(od_dir): os.makedirs(od_dir) od = "od" if sys.platform == "win32": od = r"C:\mozilla-build\msys\bin\od.exe" # HACK for Trent's machine. argv = [od] + od_opts + [path] stdout = buildutils.capture_stdout(argv) fout = open(od_path, 'w') fout.write(stdout) fout.close() return od_path
def _od_path_from_path(path, od_opts=["-c"]): """Calculate and cache `od $od_opts $path` and return the cached path.""" from hashlib import md5 import applib import buildutils import which from os.path import exists cache_dir = join( applib.user_cache_dir("komodo-dev", "ActiveState"), "od") od_dir = join(cache_dir, md5(dirname(path)).hexdigest()) od_path = join(od_dir, basename(path)+".od") if not exists(od_dir): os.makedirs(od_dir) od = "od" if sys.platform == "win32": od = r"C:\mozilla-build\msys\bin\od.exe" # HACK for Trent's machine. argv = [od] + od_opts + [path] stdout = buildutils.capture_stdout(argv) fout = open(od_path, 'w') fout.write(stdout) fout.close() return od_path
def __init__(self): self.cache_dir = join( applib.user_cache_dir("komodo-dev", "ActiveState"), "mar")
def get_userCacheDir(self): d = applib.user_cache_dir(self._appdatadir_name, "ActiveState") return os.path.join(d, self._ver)