-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Password Generator #86
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No cmd
or type: shell
.
Nice readable python script - no malicious code apparent.
The naming convention for the package should be password-generator-win
.
A few questions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this file do? Is it needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite long but nice and readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the other hand, you could dispense with the separate script and make package.yml
something like:
- regex: :genpass\((?P<myvar>\d*)\)
replace: "{{output}}"
vars:
- name: output
type: script
params:
args:
- python
- -c
- |
import random, string, pyperclip
characters = string.ascii_letters + string.punctuation + string.digits
n = max(4, int('{{myvar}}') if '{{myvar}}'.isdigit() else 12)
while True:
password = ''.join(random.choice(characters) for _ in range(n))
if (any(c.islower() for c in password) and any(c.isupper() for c in password) and any(c in string.punctuation for c in password) and any(c.isdigit() for c in password)):
break
pyperclip.copy(password)
print(password)
which should work in all OSs that have Python installed as there are no paths required.
Triggered by :genpass()
for 12-character passwords, and :genpass(n)
for n-length passwords.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be included in README.md
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this file do? Is it needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah - it's a reference to another package.
@@ -0,0 +1,22 @@ | |||
# passwordgeneratorwin | |||
[Espanso](https://espanso.org) extension for generating passwords and copy it to cliboard. For now this extension is only supported on windows systems, beacause of the difference of path between `dos` an `unix` systems. If your are looking this extension for `linux` or `mac` go to [passwordgeneratorlinux](https://github.com/viera97/passwordgeneratorlinux). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Windows will use forward slashes in paths - you could use that format for an OS-independent package.
Apologies for the presumption, @viera97, but I wanted to see if I could fork a fork and submit updates. I've implemented the various suggestions I made at espanso#86, for your interest, and perhaps onward submission to espanso/hub.
I'm sorry it's been so long, @viera97, and I wouldn't be suprised if you've lost interest in this PR. |
Espanso extension for generating passwords on windows systems