From 80f7033ad40eeaf870ee4f107c23617d8fef1ca3 Mon Sep 17 00:00:00 2001 From: coffeedogs Date: Mon, 14 May 2018 17:14:20 +0100 Subject: [PATCH] Fixed: Addressed PR comments --- fabfile/README.md | 7 +++---- fabfile/lib.py | 3 +-- fabfile/tasks.py | 2 +- src/bitmessagecli.py | 47 -------------------------------------------- 4 files changed, 5 insertions(+), 54 deletions(-) diff --git a/fabfile/README.md b/fabfile/README.md index 53430915..a435f73d 100644 --- a/fabfile/README.md +++ b/fabfile/README.md @@ -32,9 +32,8 @@ Furthermore, you can use -- to run arbitrary shell commands rather than tasks: * Install Fabric, fabric-virtualenv, virtualenvwrapper system-wide (log in to a new terminal afterwards if you're installing virtualenvwrappers for the first time) $ sudo apt install Fabric virtualenvwrapper; sudo pip install fabric-virtualenv - * Create a virtualenv called pybitmessage and install fabfile/requirements.txt - $ mkvirtualenv --system-site-packages pybitmessage-devops - $ pip install -r fabfile/requirements.txt + Create a virtualenv called pybitmessage and install fabfile/requirements.txt + $ mkvirtualenv -r fabfile/requirements.txt --system-site-packages pybitmessage-devops * Ensure you can ssh localhost with no intervention, which may include: * settings in ~/.ssh/config * authorized_keys file @@ -51,5 +50,5 @@ There are a number of advantages that should benefit us: * All developers can run the same commands, if the underlying command sequence for a task changes (after review, obv) the user does not have to care * Tasks can be combined either programmatically or on the commandline and run in series or parallel - * Whoee environemnts can be managed very effectively in conjunction with a configuration management system + * Whole environments can be managed very effectively in conjunction with a configuration management system diff --git a/fabfile/lib.py b/fabfile/lib.py index 4312607c..5317c57f 100644 --- a/fabfile/lib.py +++ b/fabfile/lib.py @@ -32,8 +32,7 @@ def coerce_bool(value): ): return True else: - print "Bad boolean value {}".format(value) - sys.exit(1) + sys.exit("Bad boolean value {}".format(value)) def flatten(data): diff --git a/fabfile/tasks.py b/fabfile/tasks.py index 6339183f..0b80bb86 100644 --- a/fabfile/tasks.py +++ b/fabfile/tasks.py @@ -89,7 +89,7 @@ def code_quality(top=10, verbose=True, details=False, fix=False, filename=None): Check code quality. By default this command will analyse each Python file in the project with a variety of tools and display the count - or details of the violations discovered, sorted by most iolations first. + or details of the violations discovered, sorted by most violations first. Default usage: diff --git a/src/bitmessagecli.py b/src/bitmessagecli.py index b6585ce1..e591ad4c 100644 --- a/src/bitmessagecli.py +++ b/src/bitmessagecli.py @@ -622,53 +622,6 @@ def genAdd(lbl, deterministic, passphrase, numOfAdd, addVNum, streamNum, ripe): return 'Entry Error' -def delMilAddr(): - """Delete address""" - - global usrPrompt - try: - response = api.listAddresses2() - # if api is too old just return then fail - if "API Error 0020" in response: - return - addresses = json.loads(response) - for entry in addresses['addresses']: - if entry['label'].decode('base64')[:6] == "random": - api.deleteAddress(entry['address']) - except: - print '\n Connection Error\n' - usrPrompt = 0 - main() - - -def genMilAddr(): - """Generate address""" - global usrPrompt - maxn = 0 - try: - response = api.listAddresses2() - if "API Error 0020" in response: - return - addresses = json.loads(response) - for entry in addresses['addresses']: - if entry['label'].decode('base64')[:6] == "random": - newn = int(entry['label'].decode('base64')[6:]) - if maxn < newn: - maxn = newn - except: - print "\n Some error\n" - print "\n Starting at " + str(maxn) + "\n" - for i in range(maxn, 10000): - lbl = "random" + str(i) - addressLabel = lbl.encode('base64') - try: - api.createRandomAddress(addressLabel) # generatedAddress = - except: - print '\n Connection Error\n' - usrPrompt = 0 - main() - - def saveFile(fileName, fileData): """Allows attachments and messages/broadcats to be saved"""