mirror of
https://github.com/jantic/DeOldify.git
synced 2026-08-30 18:02:24 +08:00
6f6b622a5c
In #139 only empty password was being caught. This patch includes the case where password might not even be set.
26 lines
408 B
Python
Executable File
26 lines
408 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import sys
|
|
|
|
from notebook.auth import passwd
|
|
|
|
|
|
def run():
|
|
args = sys.argv[1:]
|
|
|
|
if not args:
|
|
print('Error: Missing password.', file=sys.stderr)
|
|
return
|
|
|
|
password = args[0]
|
|
|
|
if not password:
|
|
print('Error: Empty password.', file=sys.stderr)
|
|
else:
|
|
encoded = passwd(password)
|
|
print(encoded)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
run()
|