From 3fba155c68e18f0bb697fb060d05ce5d5109b205 Mon Sep 17 00:00:00 2001 From: DevilXD Date: Sun, 13 Feb 2022 22:54:59 +0100 Subject: [PATCH] Add manual --- .gitignore | 9 ++++----- build.bat | 2 +- main.py | 7 ++++--- manual.txt | 18 ++++++++++++++++++ pack.bat | 24 ++++++++++++++++-------- 5 files changed, 43 insertions(+), 17 deletions(-) create mode 100644 manual.txt diff --git a/.gitignore b/.gitignore index ebac738..4d563a4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,12 +4,11 @@ __pycache__ # Build files /build /*.spec -/Twitch Drops Miner # Dist files +/dist /7z.exe /*.zip -/*.zip.tmp +/*.tmp +/Twitch Drops Miner # Dev files -/cookies.jar -/settings.json -/log*.txt +cookies* diff --git a/build.bat b/build.bat index b123c89..84057ed 100644 --- a/build.bat +++ b/build.bat @@ -1,5 +1,5 @@ @echo off cls pyinstaller --onefile --noconsole --name "Twitch Drops Miner (by DevilXD)" --icon pickaxe.ico ^ ---add-data pickaxe.ico;. --distpath "./Twitch Drops Miner" main.py +--add-data pickaxe.ico;. main.py call pack.bat diff --git a/main.py b/main.py index b60f0f2..25c0936 100644 --- a/main.py +++ b/main.py @@ -64,12 +64,13 @@ parser = argparse.ArgumentParser( ) parser.add_argument("--version", action="version", version=f"v{__version__}") parser.add_argument("-v", dest="_verbose", action="count", default=0) -parser.add_argument("--no-run-check", dest="no_run_check", action="store_true") -parser.add_argument("--debug-ws", dest="_debug_ws", action="store_true") -parser.add_argument("--debug-gql", dest="_debug_gql", action="store_true") parser.add_argument("-g", "--game", default=None) parser.add_argument("--tray", action="store_true") parser.add_argument("--log", action="store_true") +# undocumented debug args +parser.add_argument("--no-run-check", dest="no_run_check", action="store_true") +parser.add_argument("--debug-ws", dest="_debug_ws", action="store_true") +parser.add_argument("--debug-gql", dest="_debug_gql", action="store_true") options: ParsedArgs = parser.parse_args(namespace=ParsedArgs()) # check if we're not already running try: diff --git a/manual.txt b/manual.txt new file mode 100644 index 0000000..a757431 --- /dev/null +++ b/manual.txt @@ -0,0 +1,18 @@ +################################### +# Twitch Drops Miner (by DevilXD) # +################################### + +Available command line arguments: + +• -g ; --game + On application start, begin mining immedately for the `` game. Case sensitive. +• --tray + Start application as minimised into tray. +• -v + Increase verbosity level. Can be stacked up to 3 times (-vv and -vvv) to show + increasingly more information during application runtime. +• --log + Enables logging of runtime information into a 'log.txt' file. Verbosity level of this logging + matches the level set by `-v`. +• --version + Show application version information diff --git a/pack.bat b/pack.bat index 731a6d4..5c46a5d 100644 --- a/pack.bat +++ b/pack.bat @@ -1,13 +1,21 @@ @echo off IF NOT EXIST 7z.exe GOTO NO7Z -IF NOT EXIST "Twitch Drops Miner.zip" GOTO NEW -7z u "Twitch Drops Miner.zip" "Twitch Drops Miner/" -r -x!"Twitch Drops Miner/cookies.*" -GOTO TEST -:NEW -7z a "Twitch Drops Miner.zip" "Twitch Drops Miner/" -r -x!"Twitch Drops Miner/cookies.*" -GOTO TEST -:TEST -7z t "Twitch Drops Miner.zip" +IF NOT EXIST "Twitch Drops Miner" mkdir "Twitch Drops Miner" +rem Prepare files +copy /y /v dist\*.exe "Twitch Drops Miner" +copy /y /v manual.txt "Twitch Drops Miner" +IF EXIST "Twitch Drops Miner.zip" ( + rem Add action + set action=a +) ELSE ( + rem Update action + set action=u +) +rem Pack and test +7z %action% "Twitch Drops Miner.zip" "Twitch Drops Miner/" -r +7z t "Twitch Drops Miner.zip" * -r +rem Cleanup +IF EXIST "Twitch Drops Miner" rmdir /s /q "Twitch Drops Miner" GOTO EXIT :NO7Z echo No 7z.exe detected, skipping packaging!