Skip to content

Commit 1d04690

Browse files
author
Michael Flaxman
committedOct 28, 2020
cleanup
1 parent 284bad6 commit 1d04690

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed
 

‎multiwallet.py

+15-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
#!/usr/bin/env python
2-
3-
from platform import platform
4-
import pkg_resources
52
import re
63
import readline
74
import sys
8-
95
from cmd import Cmd
6+
from platform import platform
7+
from pkg_resources import DistributionNotFound, get_distribution
108

119
import buidl # noqa: F401 (used below with pkg_resources for versioning)
12-
1310
from buidl.hd import HDPrivateKey, HDPublicKey
1411
from buidl.helper import sha256, hash256
1512
from buidl.mnemonic import WORD_LIST, WORD_LOOKUP
@@ -61,6 +58,13 @@ def print_red(string):
6158
print(red_fg(string))
6259

6360

61+
def _get_buidl_version():
62+
try:
63+
return get_distribution("buidl").version
64+
except DistributionNotFound:
65+
return "Unknown"
66+
67+
6468
def _get_all_valid_checksum_words(first_words):
6569
to_return = []
6670
for word in WORD_LIST:
@@ -621,10 +625,11 @@ def do_psbt_signer(self, arg):
621625
else:
622626
return _abort("PSBT wasn't signed")
623627

624-
def do_settings(self, arg):
625-
"""Print program settings"""
628+
def do_debug(self, arg):
629+
"""Print program settings for debug purposes"""
630+
626631
to_print = [
627-
f"buidl Version: {pkg_resources.get_distribution('buidl').version}",
632+
f"buidl Version: {_get_buidl_version()}",
628633
f"Python Version: {sys.version_info}",
629634
f"Platform: {platform()}",
630635
f"libsecp256k1 Configured: {_is_libsec_enabled()}",
@@ -633,15 +638,15 @@ def do_settings(self, arg):
633638

634639
def do_exit(self, arg):
635640
"""Exit Program"""
636-
print_yellow("\nNo data saved\n")
641+
print_yellow("\nNo data saved")
637642
return True
638643

639644

640645
def main():
641646
try:
642647
MyPrompt().cmdloop()
643648
except KeyboardInterrupt:
644-
print_yellow("\nNo data saved\n")
649+
print_yellow("\nNo data saved")
645650

646651

647652
if __name__ == "__main__":

‎run_tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
black --diff --check . && pytest -v && flake8 .
1+
black --diff --check . && pytest -v && flake8 . && printf "\nSUCCESS!\n" || printf "\n-----------------\nFAIL\n-----------------\n"

0 commit comments

Comments
 (0)
Please sign in to comment.