コード例 #1
0
def cleanup():
    for dirpath, dirnames, filenames in os.walk("."):
        nowalkdirs = []
        for d in dirnames:
            path = os.path.join(dirpath, d)[2:]
            if path in fileset.ignoredirs:
                nowalkdirs.append(d)

            elif path not in fileset.dirs:
                nowalkdirs.append(d)
                common.rmtree(path)

        dirnames[:] = [d for d in dirnames if d not in nowalkdirs]

        for f in filenames:
            path = os.path.join(dirpath, f)[2:]
            if not path.startswith(".") and path not in fileset.files:
                os.unlink(path)
コード例 #2
0
ファイル: sync-webdav.py プロジェクト: jamesread/satools
def cleanup():
    for dirpath, dirnames, filenames in os.walk("."):
        nowalkdirs = []
        for d in dirnames:
            path = os.path.join(dirpath, d)[2:]
            if path in fileset.ignoredirs:
                nowalkdirs.append(d)

            elif path not in fileset.dirs:
                nowalkdirs.append(d)
                common.rmtree(path)

        dirnames[:] = [d for d in dirnames if d not in nowalkdirs]

        for f in filenames:
            path = os.path.join(dirpath, f)[2:]
            if not path.startswith(".") and path not in fileset.files:
                os.unlink(path)
コード例 #3
0
def rmpath(path):
    common.rmtree(base(spd(path)))
    common.unlink(base(halfspd(path) + ".msf"))
    common.unlink(base(halfspd(path)))
コード例 #4
0
def rmpath(path):
    common.rmtree(base(spd(path)))
    common.unlink(base(halfspd(path) + ".msf"))
    common.unlink(base(halfspd(path)))