コード例 #1
0
ファイル: backup.py プロジェクト: inglor/caatinga
def isFileModifiedOrNew(previousFile, localFile):
    """
    Returns true if the local file is a new file or if it has been modified
    since the last backup was ran.
    """
    if os.path.exists(previousFile) is False:
        return True
    return fn.isModified(localFile, previousFile)
コード例 #2
0
ファイル: changes.py プロジェクト: inglor/caatinga
def _getStatus(localFile, backedUpFile):
    """
    Return the status of the item provided compared to the version that is
    found in the backup.  Status can be "New", "Deleted" or "Modified".
    """
    if os.path.exists(localFile) and os.path.exists(backedUpFile) is False:
        return "New"
    elif os.path.exists(localFile) is False and os.path.exists(backedUpFile):
        return "Deleted"
    elif fn.isModified(localFile, backedUpFile):
        return "Modified"
    else:
        return None