This commit is contained in:
Bruce Eckel 2015-05-16 17:20:25 -07:00
parent 6e12196184
commit 6beb47d953
2 changed files with 3 additions and 7 deletions

View File

@ -1,4 +1,3 @@
.;..;%JAVA_LIB%\xom-1.2.10.jar;%JAVA_LIB%\jdk1.8.0_45\lib\tools.jar;%JAVA_LIB%\jre1.8.0_45\lib\javaws.jar;%JAVA_LIB%\swt-4.4.2-win32-win32-x86\swt.jar;%JAVA_LIB%\javassist.jar;C:\Users\Bruce\Dropbox\__TIJ4-ebook\ExtractedExamples;%JAVA_LIB%\junit-4.12.jar;%JAVA_LIB%\hamcrest-core-1.3.jar; .;..;%JAVA_LIB%\xom-1.2.10.jar;%JAVA_LIB%\jdk1.8.0_45\lib\tools.jar;%JAVA_LIB%\jre1.8.0_45\lib\javaws.jar;%JAVA_LIB%\swt-4.4.2-win32-win32-x86\swt.jar;%JAVA_LIB%\javassist.jar;C:\Users\Bruce\Dropbox\__TIJ4-ebook\ExtractedExamples;%JAVA_LIB%\junit-4.12.jar;%JAVA_LIB%\hamcrest-core-1.3.jar;
JAVA_LIB = C:\Program Files (x86)\Java JAVA_LIB = C:\Program Files (x86)\Java

View File

@ -10,12 +10,9 @@ import pprint
import msvcrt import msvcrt
root = Path('.').resolve().parent.parent root = Path('.').resolve().parent.parent
boxdir = root / r"Box Sync\TIJ4-ebook-Backups" boxdir = root / "Box Sync" / "TIJ4-ebook-Backups"
gdrive = root / "Google Drive" / "TIJ4RefreshedBackups" gdrive = root / "Google Drive" / "TIJ4RefreshedBackups"
idrive = root / "IDrive-Sync" / "TIJ4-ebook-Backups" idrive = root / "IDrive-Sync" / "TIJ4-ebook-Backups"
print(boxdir)
print(gdrive)
print(idrive)
def cp(src, dest, display=True): def cp(src, dest, display=True):
if type(src) is pathlib.WindowsPath: if type(src) is pathlib.WindowsPath:
@ -24,13 +21,13 @@ def cp(src, dest, display=True):
name = src name = src
if display: if display:
print("copying", name) print("copying", name)
print("to:", dest) print("to:", dest, "\n")
shutil.copy(str(src), str(dest)) shutil.copy(str(src), str(dest))
now = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M") now = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M")
zip_file_name = 'TIJDirectorsCut-' + now + '.zip' zip_file_name = 'TIJDirectorsCut-' + now + '.zip'
dest = boxdir / zip_file_name dest = boxdir / zip_file_name
print(dest) print(dest, "\n")
tozip = ["Notes.txt", "backup.bat", "go.bat"] + glob("*.py") + glob("*.docx") + glob("*.docm") tozip = ["Notes.txt", "backup.bat", "go.bat"] + glob("*.py") + glob("*.docx") + glob("*.docm")
with zipfile.ZipFile(str(dest), 'w') as myzip: with zipfile.ZipFile(str(dest), 'w') as myzip: