def sudo_copy_file(src_path, dest_path): print 'from', src_path print 'to', dest_path if is_windows: copy_file(src_path, dest_path) # Won't work if '+' in path # osprocess.call (['copy', '/Y', src_path, dest_path], shell = True) else: osprocess.sudo_call(['cp', src_path, dest_path])
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 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 sudo_copy_file (src_path, dest_path): print 'from', src_path print 'to', dest_path if is_windows: copy_file (src_path, dest_path) # Won't work if '+' in path # osprocess.call (['copy', '/Y', src_path, dest_path], shell = True) else: osprocess.sudo_call (['cp', src_path, dest_path])
def compile_executable(target, source, env): install = env.get("install") and env.get("action") == "finalize" config = env["EIFFEL_CONFIG"] package_exe_path = path.join("package", "bin", config.exe_name) if install and path.exists(package_exe_path): osprocess.sudo_call([package_exe_path, "-uninstall"]) config.pre_compilation() config.compile() config.post_compilation() if install and path.exists(package_exe_path): osprocess.sudo_call([package_exe_path, "-install"])
def compile_C_code(target, source, env): install = env.get('install') and env.get('action') == 'finalize' build = env['C_BUILD'] package_exe_path = path.join('package', 'bin', build.exe_name) if install and path.exists(package_exe_path): osprocess.sudo_call([package_exe_path, '-uninstall']) build.pre_compilation() build.compile() build.post_compilation() if install and path.exists(package_exe_path): osprocess.sudo_call([package_exe_path, '-install'])
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 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])