little refactoring

This commit is contained in:
r4sas
2019-06-21 11:49:20 +00:00
parent d37e573d9e
commit 70f386193a
2 changed files with 24 additions and 26 deletions

View File

@@ -53,7 +53,7 @@ def send(args, api_client):
if args.debug: print("Response:\t{}\n".format(result))
if 'status' in result and not result['status']:
if result['status'] == 0:
passphrase = paste.getHash()
print("Paste uploaded!\nPasteID:\t{}\nPassword:\t{}\nDelete token:\t{}\n\nLink:\t\t{}?{}#{}".format(
@@ -63,7 +63,7 @@ def send(args, api_client):
api_client.server,
result['id'],
passphrase))
elif 'status' in result and result['status']:
elif result['status']:
print("Something went wrong...\nError:\t\t{}".format(result['message']))
exit(1)
else:
@@ -96,7 +96,7 @@ def get(args, api_client):
if args.debug: print("Response:\t{}\n".format(result))
if 'status' in result and not result['status']:
if result['status'] == 0:
print("Paste received!")
version = result['v'] if 'v' in result else 1
@@ -137,7 +137,7 @@ def get(args, api_client):
print("Burn afrer reading flag found. Deleting paste...")
api_client.delete(json_encode({'pasteid':pasteid,'deletetoken':'burnafterreading'}))
elif 'status' in result and result['status']:
elif result['status']:
print("Something went wrong...\nError:\t\t{}".format(result['message']))
exit(1)
else: