mirror of
https://github.com/r4sas/PBinCLI
synced 2025-01-24 21:44:27 +00:00
add code comments
This commit is contained in:
parent
70f386193a
commit
8d7a9235b8
@ -53,7 +53,8 @@ def send(args, api_client):
|
|||||||
|
|
||||||
if args.debug: print("Response:\t{}\n".format(result))
|
if args.debug: print("Response:\t{}\n".format(result))
|
||||||
|
|
||||||
if result['status'] == 0:
|
# Paste was sent. Checking for returned status code
|
||||||
|
if not result['status']: # return code is zero
|
||||||
passphrase = paste.getHash()
|
passphrase = paste.getHash()
|
||||||
|
|
||||||
print("Paste uploaded!\nPasteID:\t{}\nPassword:\t{}\nDelete token:\t{}\n\nLink:\t\t{}?{}#{}".format(
|
print("Paste uploaded!\nPasteID:\t{}\nPassword:\t{}\nDelete token:\t{}\n\nLink:\t\t{}?{}#{}".format(
|
||||||
@ -63,10 +64,10 @@ def send(args, api_client):
|
|||||||
api_client.server,
|
api_client.server,
|
||||||
result['id'],
|
result['id'],
|
||||||
passphrase))
|
passphrase))
|
||||||
elif result['status']:
|
elif result['status']: # return code is other then zero
|
||||||
print("Something went wrong...\nError:\t\t{}".format(result['message']))
|
print("Something went wrong...\nError:\t\t{}".format(result['message']))
|
||||||
exit(1)
|
exit(1)
|
||||||
else:
|
else: # or here no status field in response or it is empty
|
||||||
print("Something went wrong...\nError: Empty response.")
|
print("Something went wrong...\nError: Empty response.")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
@ -96,7 +97,8 @@ def get(args, api_client):
|
|||||||
|
|
||||||
if args.debug: print("Response:\t{}\n".format(result))
|
if args.debug: print("Response:\t{}\n".format(result))
|
||||||
|
|
||||||
if result['status'] == 0:
|
# Paste was received. Checking received status code
|
||||||
|
if not result['status']: # return code is zero
|
||||||
print("Paste received!")
|
print("Paste received!")
|
||||||
|
|
||||||
version = result['v'] if 'v' in result else 1
|
version = result['v'] if 'v' in result else 1
|
||||||
@ -137,10 +139,10 @@ def get(args, api_client):
|
|||||||
print("Burn afrer reading flag found. Deleting paste...")
|
print("Burn afrer reading flag found. Deleting paste...")
|
||||||
api_client.delete(json_encode({'pasteid':pasteid,'deletetoken':'burnafterreading'}))
|
api_client.delete(json_encode({'pasteid':pasteid,'deletetoken':'burnafterreading'}))
|
||||||
|
|
||||||
elif result['status']:
|
elif result['status']: # return code is other then zero
|
||||||
print("Something went wrong...\nError:\t\t{}".format(result['message']))
|
print("Something went wrong...\nError:\t\t{}".format(result['message']))
|
||||||
exit(1)
|
exit(1)
|
||||||
else:
|
else: # or here no status field in response or it is empty
|
||||||
print("Something went wrong...\nError: Empty response.")
|
print("Something went wrong...\nError: Empty response.")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user