diff --git a/scripts/block-spammer.py b/scripts/block-spammer.py index 69273c8d..51ae6b37 100755 --- a/scripts/block-spammer.py +++ b/scripts/block-spammer.py @@ -8,7 +8,8 @@ print("Please don't run this script on Onionr networks that include more than yo import sys import os -os.chdir('../') +if not os.path.exists('onionr.sh'): + os.chdir('../') sys.path.append("src/") import onionrblocks diff --git a/scripts/client-api-request-crafter.py b/scripts/client-api-request-crafter.py index 73f55b33..a5780fb0 100644 --- a/scripts/client-api-request-crafter.py +++ b/scripts/client-api-request-crafter.py @@ -8,6 +8,19 @@ import os if not os.path.exists('onionr.sh'): os.chdir('../') sys.path.append("src/") + +import atexit +import readline + +histfile = os.path.join(os.path.expanduser("~"), ".onionr_history") +try: + readline.read_history_file(histfile) + # default history len is -1 (infinite), which may grow unruly + readline.set_history_length(1000) +except FileNotFoundError: + pass + +atexit.register(readline.write_history_file, histfile) from onionrutils.localcommand import local_command from onionrutils.localcommand import get_hostname @@ -16,7 +29,7 @@ try: except TypeError: print('Onionr not running') sys.exit(1) -print('1. get request') +print('1. get request (default)') print('2. post request') choice = input(">").lower().strip() post = False diff --git a/static-data/www/shared/sidebar/sidebar.html b/static-data/www/shared/sidebar/sidebar.html index 75e5cbe4..dea7078e 100644 --- a/static-data/www/shared/sidebar/sidebar.html +++ b/static-data/www/shared/sidebar/sidebar.html @@ -7,6 +7,9 @@