diff --git a/docs/Bulk-Processing.md b/docs/Bulk-Processing.md index 5336a19a..97a29b99 100644 --- a/docs/Bulk-Processing.md +++ b/docs/Bulk-Processing.md @@ -41,6 +41,7 @@ Batch files can contain the following types of lines: * GAM waits for all running GAM commands to complete * GAM prints \ and waits for the user to press any key * GAM continues +* sleep \ - Batch processing will suspend for \ seconds before the next command line is processed * print \ - Print \ on stderr * set \ \ * Subsequent lines will have %\% replaced with \ diff --git a/docs/GamUpdates.md b/docs/GamUpdates.md index cae72bf9..e798457a 100644 --- a/docs/GamUpdates.md +++ b/docs/GamUpdates.md @@ -11,6 +11,14 @@ Add the `-s` option to the end of the above commands to suppress creating the `g See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation +### 6.67.36 + +Updated `gam batch ` and `gam tbatch ` commands to accept lines with the following form: +``` +sleep +``` +Batch processing will suspend for `` seconds before the next command line is processed. + ### 6.67.35 Added the following options to `` that allow more powerful matching. diff --git a/docs/How-to-Upgrade-from-Standard-GAM.md b/docs/How-to-Upgrade-from-Standard-GAM.md index 82392e69..25254cce 100644 --- a/docs/How-to-Upgrade-from-Standard-GAM.md +++ b/docs/How-to-Upgrade-from-Standard-GAM.md @@ -334,7 +334,7 @@ writes the credentials into the file oauth2.txt. admin@server:/Users/admin/bin/gamadv-xtd3$ rm -f /Users/admin/GAMConfig/oauth2.txt admin@server:/Users/admin/bin/gamadv-xtd3$ ./gam version WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found -GAMADV-XTD3 6.67.35 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.67.36 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.1 64-bit final MacOS Sonoma 14.2.1 x86_64 @@ -1002,7 +1002,7 @@ writes the credentials into the file oauth2.txt. C:\GAMADV-XTD3>del C:\GAMConfig\oauth2.txt C:\GAMADV-XTD3>gam version WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found -GAMADV-XTD3 6.67.35 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.67.36 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.1 64-bit final Windows-10-10.0.17134 AMD64 diff --git a/docs/Version-and-Help.md b/docs/Version-and-Help.md index ded26c80..5c9715a5 100644 --- a/docs/Version-and-Help.md +++ b/docs/Version-and-Help.md @@ -4,7 +4,7 @@ Print the current version of Gam with details ``` gam version -GAMADV-XTD3 6.67.35 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.67.36 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.1 64-bit final MacOS Sonoma 14.2.1 x86_64 @@ -16,7 +16,7 @@ Time: 2023-06-02T21:10:00-07:00 Print the current version of Gam with details and time offset information ``` gam version timeoffset -GAMADV-XTD3 6.67.35 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.67.36 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.1 64-bit final MacOS Sonoma 14.2.1 x86_64 @@ -28,7 +28,7 @@ Your system time differs from www.googleapis.com by less than 1 second Print the current version of Gam with extended details and SSL information ``` gam version extended -GAMADV-XTD3 6.67.35 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.67.36 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.1 64-bit final MacOS Sonoma 14.2.1 x86_64 @@ -65,7 +65,7 @@ MacOS High Sierra 10.13.6 x86_64 Path: /Users/Admin/bin/gamadv-xtd3 Version Check: Current: 5.35.08 - Latest: 6.67.35 + Latest: 6.67.36 echo $? 1 ``` @@ -73,7 +73,7 @@ echo $? Print the current version number without details ``` gam version simple -6.67.35 +6.67.36 ``` In Linux/MacOS you can do: ``` @@ -83,7 +83,7 @@ echo $VER Print the current version of Gam and address of this Wiki ``` gam help -GAM 6.67.35 - https://github.com/taers232c/GAMADV-XTD3 +GAM 6.67.36 - https://github.com/taers232c/GAMADV-XTD3 Ross Scroggs Python 3.12.1 64-bit final MacOS Sonoma 14.2.1 x86_64 diff --git a/src/GamUpdate.txt b/src/GamUpdate.txt index dcb300b9..2caa1e67 100644 --- a/src/GamUpdate.txt +++ b/src/GamUpdate.txt @@ -2,6 +2,14 @@ Merged GAM-Team version +6.67.36 + +Updated `gam batch ` and `gam tbatch ` commands to accept lines with the following form: +``` +sleep +``` +Batch processing will suspend for `` seconds before the next command line is processed. + 6.67.35 Added the following options to `` that allow more powerful matching. diff --git a/src/gam/__init__.py b/src/gam/__init__.py index e636df6b..0c2d182f 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -9681,6 +9681,10 @@ def MultiprocessGAMCommands(items, showCmds): if item[0] == Cmd.PRINT_CMD: batchWriteStderr(Cmd.QuotedArgumentList(item[1:])+'\n') continue + if item[0] == Cmd.SLEEP_CMD: + batchWriteStderr(f'{currentISOformatTimeStamp()},0/{numItems},Sleepiing {item[1]} seconds\n') + time.sleep(int(item[1])) + continue pid += 1 if not showCmds and ((pid % 100 == 0) or (pid == numItems)): batchWriteStderr(Msg.PROCESSING_ITEM_N_OF_M.format(currentISOformatTimeStamp(), pid, numItems)) @@ -9823,6 +9827,10 @@ def ThreadBatchGAMCommands(items, showCmds): if item[0] == Cmd.PRINT_CMD: batchWriteStderr(f'{currentISOformatTimeStamp()},0/{numItems},{Cmd.QuotedArgumentList(item[1:])}\n') continue + if item[0] == Cmd.SLEEP_CMD: + batchWriteStderr(f'{currentISOformatTimeStamp()},0/{numItems},Sleepiing {item[1]} seconds\n') + time.sleep(int(item[1])) + continue pid += 1 if not showCmds and ((pid % 100 == 0) or (pid == numItems)): batchWriteStderr(Msg.PROCESSING_ITEM_N_OF_M.format(currentISOformatTimeStamp(), pid, numItems)) @@ -9904,6 +9912,12 @@ def doBatch(threadBatch=False): writeStderr(f'{ERROR_PREFIX}{Cmd.ARGUMENT_ERROR_NAMES[Cmd.ARGUMENT_INVALID][1]}: {Msg.EXPECTED} <{Cmd.CLEAR_CMD} keyword>)>\n') errors += 1 continue + if cmd == Cmd.SLEEP_CMD: + if len(argv) != 2 or not argv[1].isdigit(): + writeStderr(f'Command: >>>{Cmd.QuotedArgumentList([argv[0]])}<<< {Cmd.QuotedArgumentList(argv[1:])}\n') + writeStderr(f'{ERROR_PREFIX}{Cmd.ARGUMENT_ERROR_NAMES[Cmd.ARGUMENT_INVALID][1]}: {Msg.EXPECTED} <{Cmd.SLEEP_CMD} integer>)>\n') + errors += 1 + continue if (not cmd) or ((len(argv) == 1) and (cmd not in [Cmd.COMMIT_BATCH_CMD, Cmd.PRINT_CMD])): continue if cmd in validCommands: diff --git a/src/gam/gamlib/glclargs.py b/src/gam/gamlib/glclargs.py index 8efe5cd2..5ddc2955 100644 --- a/src/gam/gamlib/glclargs.py +++ b/src/gam/gamlib/glclargs.py @@ -379,6 +379,7 @@ class GamCLArgs(): PRINT_CMD = 'print' SET_CMD = 'set' CLEAR_CMD = 'clear' + SLEEP_CMD = 'sleep' # Command line batch/csv/loop/tbatch keywords BATCH_CMD = 'batch' CSV_CMD = 'csv'