project-folder-backup.py
def writePlainText(kah_remote, kah_local, output, report):
    """Write the comparison report to a plain text file."""

    filename = output + '.txt'
    with open(filename, 'w') as file:
        file.write('COMPARISON OF FILES BETWEEN FOLDERS:\n')
        file.write('\tFOLDER 1: {}\n'.format(kah_remote))
        file.write('\tFOLDER 2: {}\n'.format(kah_local))
        file.write('\n\n')

        file.write('FILES ONLY IN: {}\n'.format(kah_remote))
        for item in report['left']:
            file.write('\t' + item + '\n')
        if not report['left']:
            file.write('\tNone\n')
        file.write('\n\n')

        file.write('FILES ONLY IN: {}\n'.format(kah_local))
        for item in report['right']:
            file.write('\t' + item + '\n')
        if not report['right']:
            file.write('\tNone\n')
        file.write('\n\n')

        file.write('FILES IN BOTH FOLDERS:\n')
        for item in report['both']:
            file.write('\t' + item + '\n')
        if not report['both']:
            file.write('\tNone\n')
Write the comparison report to a plain text file.
Write the comparison report to a plain text file.
Write the comparison report to a plain text file .
def writePlainText(kah_remote, kah_local, output, report):
    filename = output + '.txt'
    with open(filename, 'w') as file:
        file.write('COMPARISON OF FILES BETWEEN FOLDERS:\n')
        file.write('\tFOLDER 1: {}\n'.format(kah_remote))
        file.write('\tFOLDER 2: {}\n'.format(kah_local))
        file.write('\n\n')
        file.write('FILES ONLY IN: {}\n'.format(kah_remote))
        for item in report['left']:
            file.write('\t' + item + '\n')
        if not report['left']:
            file.write('\tNone\n')
        file.write('\n\n')
        file.write('FILES ONLY IN: {}\n'.format(kah_local))
        for item in report['right']:
            file.write('\t' + item + '\n')
        if not report['right']:
            file.write('\tNone\n')
        file.write('\n\n')
        file.write('FILES IN BOTH FOLDERS:\n')
        for item in report['both']:
            file.write('\t' + item + '\n')
        if not report['both']:
            file.write('\tNone\n')
def writePlainText ( kah_remote , kah_local , output , report ) : filename = output + '.txt' with open ( filename , 'w' ) as file : file . write ( 'COMPARISON OF FILES BETWEEN FOLDERS:\n' ) file . write ( '\tFOLDER 1: {}\n' . format ( kah_remote ) ) file . write ( '\tFOLDER 2: {}\n' . format ( kah_local ) ) file . write ( '\n\n' ) file . write ( 'FILES ONLY IN: {}\n' . format ( kah_remote ) ) for item in report [ 'left' ] : file . write ( '\t' + item + '\n' ) if not report [ 'left' ] : file . write ( '\tNone\n' ) file . write ( '\n\n' ) file . write ( 'FILES ONLY IN: {}\n' . format ( kah_local ) ) for item in report [ 'right' ] : file . write ( '\t' + item + '\n' ) if not report [ 'right' ] : file . write ( '\tNone\n' ) file . write ( '\n\n' ) file . write ( 'FILES IN BOTH FOLDERS:\n' ) for item in report [ 'both' ] : file . write ( '\t' + item + '\n' ) if not report [ 'both' ] : file . write ( '\tNone\n' )
Write the comparison report to a plain text file.
Write the comparison report to a plain text file .
"""Write the comparison report to a plain text file."""
kah_remote
kah_local
output
report