Skip to content

Commit

Permalink
Added no-gui argument to prevent any attempt to load gui elements
Browse files Browse the repository at this point in the history
  • Loading branch information
3rdIteration committed Dec 10, 2020
1 parent f7b2d15 commit 80869e1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions btcrecover/btcrseed.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@

ADDRESSDB_DEF_FILENAME = "addresses.db"

no_gui = False

def full_version():
return "seedrecover {}, {}".format(
__version__,
Expand Down Expand Up @@ -1600,6 +1602,12 @@ def pubkey_to_hash160(uncompressed_pubkey):

tk_root = None
def init_gui():
# just return and leave tk_root as none if gui force disabled...
global no_gui
if no_gui:
print("Warning: GUI disabled, you will need to set some recovery arguments manually")
return

global disable_security_warnings
global tk_root, tk, tkFileDialog, tkSimpleDialog, tkMessageBox
if not tk_root:
Expand Down Expand Up @@ -1858,6 +1866,7 @@ def main(argv):
parser.add_argument("--no-dupchecks",action="store_true", help="disable duplicate guess checking to save memory")
parser.add_argument("--no-progress", action="store_true", help="disable the progress bar")
parser.add_argument("--no-pause", action="store_true", help="never pause before exiting (default: auto)")
parser.add_argument("--no-gui", action="store_true", help="Force disable the gui elements")
parser.add_argument("--performance", action="store_true", help="run a continuous performance test (Ctrl-C to exit)")
parser.add_argument("--btcr-args", action="store_true", help=argparse.SUPPRESS)
parser.add_argument("--version","-v",action="store_true", help="show full version information and exit")
Expand Down Expand Up @@ -1901,6 +1910,11 @@ def main(argv):
if args.coin:
args.pathlist = "./common-derivation-pathlists/" + args.coin + ".txt"

# Assign the no-gui to a global variable...
global no_gui
if args.no_gui:
no_gui = True

# Pass an argument so that btcrpass knows that we are running a seed recovery
extra_args.append("--btcrseed")

Expand Down

0 comments on commit 80869e1

Please sign in to comment.