summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsgp.py18
1 files changed, 5 insertions, 13 deletions
diff --git a/sgp.py b/sgp.py
index 5003cb1..a3ad76f 100755
--- a/sgp.py
+++ b/sgp.py
@@ -17,6 +17,7 @@
# along with spg.py If not, see <http://www.gnu.org/licenses/>.
import hashlib
+import getpass
import base64
import re
import subprocess
@@ -261,16 +262,6 @@ def verify_masterpassword(masterpassword):
else:
return(False)
-def call_zenity(*args):
- args = [ '--' + arg for arg in args ]
- try:
- out = subprocess.check_output(['zenity', '--title=superpassgen'] +
- args)
- except subprocess.CalledProcessError:
- sys.exit(0)
- out = out.decode('UTF-8').rstrip('\n')
- return(out)
-
def output_console(masterpassword):
verify_salt = base64.b64encode(os.urandom(48)).decode('UTF-8')
masterpassword = verify_salt + masterpassword
@@ -287,14 +278,15 @@ def output_console(masterpassword):
print("}")
def main():
- masterpassword = call_zenity('password')
+ masterpassword = getpass.getpass()
verification = verify_masterpassword(masterpassword)
if verification == False:
- call_zenity('error', 'text=Wrong password!')
+ print("Error: Wrong password!")
+ sys.exit(1)
if '--setup' in sys.argv:
output_console(masterpassword)
else:
- url = call_zenity('entry')
+ url = input("Enter URL: ")
print(sgp(url, masterpassword) + '\n')
if __name__ == '__main__':