Example #1
0
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)
Example #2
0
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