def sudo_mkpath(dir_path): parent_path = path.dirname(dir_path) if not path.exists(parent_path): sudo_mkpath(parent_path) if is_windows: osprocess.call(['mkdir', dir_path], shell=True) else: osprocess.sudo_call(['mkdir', dir_path])
def extract_archive(archive_path, dir_path, env): command = [ 'tar', '--extract', '--gunzip', '--file=' + archive_path, '--directory', dir_path ] if is_windows: osprocess.call(command, shell=True, env=env) else: osprocess.call(command, env=env)
def sudo_mkpath (dir_path): parent_path = path.dirname (dir_path) if not path.exists (parent_path): sudo_mkpath (parent_path) if is_windows: osprocess.call (['mkdir', dir_path], shell = True) else: osprocess.sudo_call (['mkdir', dir_path])
def make_archive (archive_path, target): dir_path = path.dirname (target) target_dir = path.basename (target) command = ['tar', '--create', '--gzip', '--file=' + archive_path] if dir_path: command.extend (['--directory', dir_path, target_dir]) else: command.append (target_dir) if is_windows: osprocess.call (command, shell = True) else: osprocess.call (command)
def make_archive(archive_path, target): dir_path = path.dirname(target) target_dir = path.basename(target) command = ['tar', '--create', '--gzip', '--file=' + archive_path] if dir_path: command.extend(['--directory', dir_path, target_dir]) else: command.append(target_dir) if is_windows: osprocess.call(command, shell=True) else: osprocess.call(command)
def compile(self): self.__copy_win64_F_code() curdir = path.abspath(os.curdir) os.chdir(self.code_dir_path()) ret_code = osprocess.call(['finish_freezing']) os.chdir(curdir)
def compile (self): curdir = path.abspath (os.curdir) os.chdir (self.code_dir_path ()) command = ['finish_freezing'] self.write_io ('Subprocess: %s\n' % command) ret_code = osprocess.call (command, env = self.env ['ASCII_ENV']) os.chdir (curdir)
def compile(self): code_dir = self.code_dir() classic_dir = path.dirname(code_dir) if path.exists(classic_dir): if path.exists(code_dir): dir_util.remove_tree(code_dir) else: dir_util.mkpath(classic_dir) tar_path = self.f_code_tar_unix_path() tar = ARCHIVE(tar_path) tar.chdir = '/'.join(self.code_dir_steps()[0:-1]) self.write_io('Extracting: %s\n' % tar_path) tar.extract() curdir = path.abspath(os.curdir) os.chdir(self.code_dir()) ret_code = osprocess.call(['finish_freezing']) os.chdir(curdir)
def compile (self): code_dir = self.code_dir () classic_dir = path.dirname (code_dir) if path.exists (classic_dir): if path.exists (code_dir): dir_util.remove_tree (code_dir) else: dir_util.mkpath (classic_dir) tar_path = self.f_code_tar_unix_path () tar = ARCHIVE (tar_path) tar.chdir = '/'.join (self.code_dir_steps ()[0:-1]) self.write_io ('Extracting: %s\n' % tar_path) tar.extract () curdir = path.abspath (os.curdir) os.chdir (self.code_dir ()) ret_code = osprocess.call (['finish_freezing']) os.chdir (curdir)
def precompile(target, source, env): curdir = path.abspath(os.curdir) precomp_dir = env["EIF_PRECOMP_PLATFORM_DIR"] ecf_path = env["EIF_PRECOMP_MASTER_ECF"] os.chdir(precomp_dir) file_util.copy_file(ecf_path, precomp_dir) ecf_path = path.join(precomp_dir, path.basename(ecf_path)) compile_command = ["ec", "-batch", "-precompile", "-c_compile", "-config", ecf_path] environ = env["ASCII_ENV"] # for name, value in environ.items (): # if not (isinstance (name, str) and isinstance (value, str)): # sys.stdout.write ('Variable is not str: ' + str (name) + '\n') # sys.stdout.write (str (value) + '\n') sys.stdout.write("Subprocess: " + str(compile_command) + "\n") call_status = osprocess.call(compile_command, env=environ) os.chdir(curdir)
def make_link(name, target): if is_windows: osprocess.call(['mklink', '/D', name, target], shell=True) else: return
def compile (self): command = ['ec', '-batch'] + self.compilation_options () + ['-config', self.ecf_path, '-project_path', self.project_path ()] self.write_io ('Subprocess: %s\n' % command) ret_code = osprocess.call (command, env = self.env ['ASCII_ENV'])
def sudo_remove_tree (dir_path): if is_windows: osprocess.call (['rmdir', '/S', '/Q', dir_path], shell = True) else: osprocess.sudo_call (['rm', '-r', dir_path])
def make_link (name, target): if is_windows: osprocess.call (['mklink', '/D', name, target], shell = True) else: return
def sudo_copy_tree (src_path, dest_path): if is_windows: osprocess.call (['xcopy', '/S', '/I', src_path, dest_path], shell = True) else: osprocess.sudo_call (['cp', '-r', src_path, dest_path])
def sudo_remove_tree(dir_path): if is_windows: osprocess.call(['rmdir', '/S', '/Q', dir_path], shell=True) else: osprocess.sudo_call(['rm', '-r', dir_path])
def sudo_copy_tree(src_path, dest_path): if is_windows: osprocess.call(['xcopy', '/S', '/I', src_path, dest_path], shell=True) else: osprocess.sudo_call(['cp', '-r', src_path, dest_path])
def extract_archive (archive_path, dir_path, env): command = ['tar', '--extract', '--gunzip', '--file=' + archive_path, '--directory', dir_path] if is_windows: osprocess.call (command, shell = True, env = env) else: osprocess.call (command, env = env)