Ejemplo n.º 1
0
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])
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
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])
Ejemplo n.º 4
0
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)
Ejemplo n.º 5
0
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)
Ejemplo n.º 6
0
    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)
Ejemplo n.º 7
0
	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)
Ejemplo n.º 8
0
    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)
Ejemplo n.º 9
0
	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)
Ejemplo n.º 10
0
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)
Ejemplo n.º 11
0
def make_link(name, target):
    if is_windows:
        osprocess.call(['mklink', '/D', name, target], shell=True)
    else:
        return
Ejemplo n.º 12
0
	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'])
Ejemplo n.º 13
0
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])
Ejemplo n.º 14
0
def make_link (name, target):
	if is_windows:
		osprocess.call (['mklink', '/D', name, target], shell = True)
	else:
		return
Ejemplo n.º 15
0
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])
Ejemplo n.º 16
0
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])
Ejemplo n.º 17
0
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])
Ejemplo n.º 18
0
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)