From 57095f727405ad8a77dba491bb3bb37a4333c10a Mon Sep 17 00:00:00 2001 From: rlbr Date: Tue, 27 Nov 2018 15:19:00 -0600 Subject: [PATCH] Added google api submodule, removed package installation at startup --- .gitmodules | 6 ++++++ endtime.bat | 2 +- google_api_wrapper | 1 + install.bat | 12 ++++++------ secrets | 1 + workers/done.bat | 5 +++-- workers/install.py | 25 ------------------------- workers/packs.txt | 35 ----------------------------------- 8 files changed, 18 insertions(+), 69 deletions(-) create mode 100644 .gitmodules create mode 160000 google_api_wrapper create mode 160000 secrets delete mode 100644 workers/install.py delete mode 100644 workers/packs.txt diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..cec6179 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "google_api_wrapper"] + path = google_api_wrapper + url = https://rlbrhost.ddns.net/git/rlbr/google_api_wrapper +[submodule "secrets"] + path = secrets + url = https://rlbrhost.ddns.net/git/school/secrets.git diff --git a/endtime.bat b/endtime.bat index 795a7a2..ebf9ae3 100644 --- a/endtime.bat +++ b/endtime.bat @@ -1,3 +1,3 @@ @echo off title endtime -%python% timeout.py \ No newline at end of file +python workers\timeout.py \ No newline at end of file diff --git a/google_api_wrapper b/google_api_wrapper new file mode 160000 index 0000000..78ee774 --- /dev/null +++ b/google_api_wrapper @@ -0,0 +1 @@ +Subproject commit 78ee774585aa6c8993d24a9fdcc4604dc5522da9 diff --git a/install.bat b/install.bat index e723101..de6065a 100644 --- a/install.bat +++ b/install.bat @@ -4,19 +4,19 @@ for %%d in (%~dp0..) do set ParentDirectory=%%~fd -for /f "usebackq tokens=*" %%a in (`dir /B ^| findstr /r /i winpython.*`) do ( - set setup=%%a +for /f "usebackq tokens=*" %%a in (`dir /B installer`) do ( + set setup=installer\%%a goto skipA ) :skipA -set Directory=%~dp0 +REM set Directory=%~dp0 "%Directory%\%setup%" - set winpython=%%a + REM set winpython=%%a for /f "usebackq tokens=*" %%a in (`dir /A:D /B ^| findstr /r /i w.*py.*`) do ( set winpython=%%a goto skipB ) -:skipBq +:skipB set winpython="%Directory%\%winpython%" for /f "usebackq tokens=*" %%a in (`dir /A:D /B %winpython% ^| findstr /r /i python.*`) do ( set exe=%%a @@ -30,4 +30,4 @@ md "%winpython%\settings\.idlerc" copy config-highlight.cfg %winpython%\settings\.idlerc md "%appdata%\Notepad++\themes" copy themes "%appdata%\Notepad++\themes" -%exe% workers\install.py from_pack workers\packs.txt \ No newline at end of file +"%exe%" -m pip install -r %Directory%\google_api_wrapper\requirements.txt \ No newline at end of file diff --git a/secrets b/secrets new file mode 160000 index 0000000..9525281 --- /dev/null +++ b/secrets @@ -0,0 +1 @@ +Subproject commit 9525281bcafcb75d5ccd1c5a0b7e66470743b397 diff --git a/workers/done.bat b/workers/done.bat index 53c7b97..58a22b2 100644 --- a/workers/done.bat +++ b/workers/done.bat @@ -15,5 +15,6 @@ for /f "usebackq tokens=*" %%a in (`dir /A:D /B %winpython% ^| findstr /r /i pyt goto skipC ) :skipC -set exe="%winpython%\%exe%\python.exe" -"%winpython%\t\7z.exe" a -t7z "%ParentDirectory%\python.7z" -p123456789 -mhe=on -mx "%Directory%" -xr!%_winpython% -xr!__pycache__ \ No newline at end of file +REM set exe="%winpython%\%exe%\python.exe" +"%winpython%\t\7z.exe" a -t7z "%ParentDirectory%\python.7z" -p123456789 -mhe=on -mx "%Directory%" -xr!%_winpython% -xr!__pycache__ +python upload.py \ No newline at end of file diff --git a/workers/install.py b/workers/install.py deleted file mode 100644 index a5c7577..0000000 --- a/workers/install.py +++ /dev/null @@ -1,25 +0,0 @@ -#funcs -import pip._internal as pip -def from_pack(file): - file = open(file) - packages = set(file.read().split('\n')) - set(package.key for package in pip.get_installed_distributions()) - file.close() - for package in packages: - pip.main(['install',package]) - -def to_pack(file): - file = open(file,'w') - s = '\n'.join(map(lambda p: p.key,pip.get_installed_distributions())) - file.write(s) - file.close() -#arguments -if __name__ == "__main__": - import argparse - parser = argparse.ArgumentParser() - parser.add_argument("mode",metavar = "action",help="what you wanna do") - parser.add_argument("path",metavar = "dir",help="fullpath to pack") - args = parser.parse_args() - if args.mode == "to_pack": - to_pack(args.path) - elif args.mode == "from_pack": - from_pack(args.path) diff --git a/workers/packs.txt b/workers/packs.txt deleted file mode 100644 index 41b7e67..0000000 --- a/workers/packs.txt +++ /dev/null @@ -1,35 +0,0 @@ -winpython -wcwidth -toolz -sympy -symengine -sqlite-bro -six -setuptools -pythonnet -python-snappy -python-dateutil -pyreadline -pyperclip -pyodbc -pygments -pycryptodome -ptpython -prompt-toolkit -pip -pillow -pdfminer.six -partd -parso -mpmath -lxml -locket -joblib -jedi -docopt -dask -cloudpickle -chardet -bs4 -brotli -beautifulsoup4 \ No newline at end of file