Fix choking on passwords with <x> syntax in them
This commit is contained in:
parent
b169a1c802
commit
a9a7f5da45
@ -80,6 +80,7 @@ group.add_argument('--username-only', '-e',
|
|||||||
group.add_argument('--password-only', '-w',
|
group.add_argument('--password-only', '-w',
|
||||||
action='store_true', help='Only insert password')
|
action='store_true', help='Only insert password')
|
||||||
|
|
||||||
|
CMD_DELAY = 50
|
||||||
|
|
||||||
class ExitCodes(enum.IntEnum):
|
class ExitCodes(enum.IntEnum):
|
||||||
"""Stores various exit codes groups to use."""
|
"""Stores various exit codes groups to use."""
|
||||||
@ -191,15 +192,18 @@ def run(args):
|
|||||||
|
|
||||||
insert_mode = ';; enter-mode insert' if args.insert_mode else ''
|
insert_mode = ';; enter-mode insert' if args.insert_mode else ''
|
||||||
if args.username_only:
|
if args.username_only:
|
||||||
qute_command('fake-key {}{}'.format(username, insert_mode))
|
qute_command('insert-text {}{}'.format(username, insert_mode))
|
||||||
elif args.password_only:
|
elif args.password_only:
|
||||||
qute_command('fake-key {}{}'.format(password, insert_mode))
|
qute_command('insert-text {}{}'.format(password, insert_mode))
|
||||||
else:
|
else:
|
||||||
# Enter username and password using fake-key and <Tab> (which seems to
|
# Enter username and password using fake-key and <Tab> (which seems to
|
||||||
# work almost universally), then switch back into insert-mode, so the
|
# work almost universally), then switch back into insert-mode, so the
|
||||||
# form can be directly submitted by hitting enter afterwards
|
# form can be directly submitted by hitting enter afterwards
|
||||||
qute_command('fake-key {} ;; fake-key <Tab> ;; fake-key {}{}'
|
qute_command('insert-text {} ;;'
|
||||||
.format(username, password, insert_mode))
|
'later {} fake-key <Tab> ;;'
|
||||||
|
'later {} insert-text {}{}'
|
||||||
|
.format(username, CMD_DELAY,
|
||||||
|
CMD_DELAY * 2, password, insert_mode))
|
||||||
|
|
||||||
return ExitCodes.SUCCESS
|
return ExitCodes.SUCCESS
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user