Пример #1
0
def copyscripttree(src, dst, modpaths, ss, isInstall = False,
                   repositoryRoot = None):

    if repositoryRoot == None:
        repositoryRoot = RepositoryRoot
    
    if not os.path.exists(src):
        return

    if os.path.isfile(src):
        if os.path.basename(src).endswith('.py'):
            copyScript(src, dst, modpaths, ss)
        elif os.path.basename(src).endswith('.pyc'):
            pass
        else:
            shutil.copyfile(src, dst)
            ryw_bizarro.sudo_chmod(dst, '666', 0666,
                                   repositoryRoot = repositoryRoot)
    else:
        if not os.path.exists(dst):
            createdirpath(dst)

        for n in os.listdir(src):
            if isInstall and n.lower() == "cvs":
                continue
            copyscripttree(os.path.join(src, n),
                           os.path.join(dst, n),
                           modpaths, ss, isInstall,
                           repositoryRoot = repositoryRoot)
Пример #2
0
def chmod_tree(path):
    if not os.path.exists(path):
        # give_bad_news('chmod_tree: path does not exist: ' + path,
        #              logging.warning)
        return

    ryw_bizarro.sudo_chmod(path, "777", 0777)

    if os.path.isfile(path):
        return

    for entry in os.listdir(path):
        path2 = os.path.join(path, entry)
        chmod_tree(path2)