Files
DeOldify/set_password.py
T
Alexandre Vicenzi 6f6b622a5c Check for missing and empty password
In #139 only empty password was being caught.

This patch includes the case where password might
not even be set.
2019-08-19 21:40:27 +02:00

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()