Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

guess URL with `last-visited-url`, if installed

  • Loading branch information...
commit e150d901c6cf5bd5c82fc85d4e7b00e5de4accf4 1 parent 5f8f62e
@gfxmonk authored
View
12 platform/supergenpass_platform/command.py
@@ -80,11 +80,6 @@ def run(self):
print >> sys.stderr, "sgp: assuming --print since stdout is not a TTY"
opts.print_password = True
- if not url:
- url = self.do(guess_url)
- if not url:
- url = ui.get_input('Enter domain / URL: ')
-
pass_ = None
if not opts.ask:
try:
@@ -93,6 +88,11 @@ def run(self):
if not pass_:
pass_ = ui.get_password('Enter master password: ')
+ if not url:
+ url = self.do(guess_url)
+ if not url:
+ url = ui.get_input('Enter domain / URL: ')
+
if opts.save:
try:
done = self.do(save_pass, pass_)
@@ -110,7 +110,7 @@ def run(self):
else:
print >> sys.stderr, "Generated password of length %s for '%s'" % (opts.length, domain_)
if self.do(save_clip, generated_pass) is False:
- print >> sys.stderr, "could not save clipboard. your passowrd is: %s" % (generated_pass)
+ print >> sys.stderr, "could not save clipboard. your password is: %s" % (generated_pass)
if opts.notify:
self.do(notify, domain_)
if opts.forget:
View
7 platform/supergenpass_platform/gnome/main.py
@@ -46,6 +46,13 @@ def notify(domain):
notification.show()
def guess_url():
+ import subprocess
+ proc = subprocess.Popen(['last-visited-url'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ out, err = proc.communicate()
+ if proc.returncode == 0:
+ return out.strip()
+ else:
+ print err
return None
def get_password():
Please sign in to comment.
Something went wrong with that request. Please try again.