update rst readme, remove unused import

This commit is contained in:
r4sas
2019-06-21 13:32:46 +00:00
parent 5d988e01fc
commit dc034b1d55
5 changed files with 23 additions and 31 deletions

View File

@@ -76,7 +76,7 @@ def get(args, api_client):
try:
pasteid, passphrase = args.pasteinfo.split("#")
except:
except ValueError:
print("PBinCLI error: provided info hasn't contain valid PasteID#Passphrase string")
exit(1)

View File

@@ -19,7 +19,7 @@ class PrivateBin:
try:
return result.json()
except:
except ValueError:
print("ERROR: Unable parse response as json. Received (size = {}):\n{}".format(len(result.text), result.text))
exit(1)
@@ -40,7 +40,7 @@ class PrivateBin:
headers = self.headers,
proxies = self.proxy,
data = request).json()
except:
except ValueError:
# unable parse response as json because it can be empty (1.2), so simulate correct answer
print("NOTICE: Received empty response. We interpret that as our paste has already been deleted.")
from json import loads as json_loads

View File

@@ -186,7 +186,6 @@ class Paste:
self._attachment = cipher_message['attachment']
self._attachment_name = cipher_message['attachment_name']
else:
from hashlib import sha256
from sjcl import SJCL
password = self.__preparePassKey()