@@ -8,31 +8,37 @@ import pathlib
88from pathlib import Path
99import pprint
1010import msvcrt
11+ verbose = True
1112
1213root = Path('.').resolve().parent.parent
1314boxdir = root / " Box Sync" / " TIJ4-ebook-Backups"
1415gdrive = root / " Google Drive" / " TIJ4RefreshedBackups"
1516idrive = root / " IDrive-Sync" / " TIJ4-ebook-Backups"
1617
17- def cp(src, dest, display=True):
18+ def cp(src, dest, display=True, shortForm=False ):
1819 if type(src) is pathlib.WindowsPath:
1920 name = src.name
2021 else:
2122 name = src
2223 if display:
23- print(" copying" , name)
24- print(" to:" , dest, " \n" )
24+ if shortForm:
25+ print(name)
26+ else:
27+ print(" \ncopying" , name)
28+ print(" to:" , dest)
2529 shutil.copy(str(src), str(dest))
2630
2731now = datetime.datetime.now().strftime(" %Y-% m-%d_% H-%M" )
2832zip_file_name = 'TIJDirectorsCut-' + now + '.zip'
2933dest = boxdir / zip_file_name
30- print(dest, " \n " )
34+ print(dest)
3135tozip = [" Notes.txt" , " backup.bat" , " go.bat" ] + glob(" *.py" ) + glob(" *.docx" ) + glob(" *.docm" )
3236
3337with zipfile.ZipFile(str(dest), 'w') as myzip:
3438 for f in tozip:
3539 myzip.write(f)
40+ if verbose:
41+ print(" adding {}" .format(f))
3642
3743cp(dest, gdrive)
3844cp(dest, idrive)
@@ -41,9 +47,9 @@ shortcut = Path(r"C:\Python34\Scripts")
4147tools = [" Examples.py" , " Validate.py" , " backup.bat" , " go.bat" , " StripLastBlankLine.py" ,
4248 shortcut / " v.bat" , shortcut / " e.bat" ]
4349
44- print(" copying tools to Github" )
50+ print(" \nCopying tools to Github" )
4551for tool in tools:
46- cp(tool, root / " Documents" / " GitHub" / " TIJ-Directors-Cut" / " tools" , False )
52+ cp(tool, root / " Documents" / " GitHub" / " TIJ-Directors-Cut" / " tools" , shortForm=True )
4753
4854# Touch this file to indicate most recent update time:
4955os.utime(" backup.bat" , None)
0 commit comments