summaryrefslogtreecommitdiff
path: root/examples/tabs.py
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2026-01-22 00:35:39 +0100
committerMitja Felicijan <mitja.felicijan@gmail.com>2026-01-22 00:35:39 +0100
commit52040cc19cbdca48f91d4eb91e9b7a782bb5fbd0 (patch)
tree8c6a61f5a6db99c4c7a663e1e2c0f069c3794c4b /examples/tabs.py
parent8ab1da7853f6dd309f2d3677ca109737f929ab4a (diff)
downloadcrep-52040cc19cbdca48f91d4eb91e9b7a782bb5fbd0.tar.gz
Add Rust, Go and rename examples to tests
Diffstat (limited to 'examples/tabs.py')
-rw-r--r--examples/tabs.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/examples/tabs.py b/examples/tabs.py
deleted file mode 100644
index 4479f5c..0000000
--- a/examples/tabs.py
+++ /dev/null
@@ -1,32 +0,0 @@
-def set_password(args):
- password = args.password
- while not password :
- password1 = getpass("" if args.quiet else "Provide password: ")
- password_repeat = getpass("" if args.quiet else "Repeat password: ")
- if password1 != password_repeat:
- print("Passwords do not match, try again")
- elif len(password1) < 4:
- print("Please provide at least 4 characters")
- else:
- password = password1
-
- password_hash = passwd(password)
- cfg = BaseJSONConfigManager(config_dir=jupyter_config_dir())
- cfg.update('jupyter_notebook_config', {
- 'NotebookApp': {
- 'password': password_hash,
- }
- })
- if not args.quiet:
- print("password stored in config dir: %s" % jupyter_config_dir())
-
-def main(argv):
- parser = argparse.ArgumentParser(argv[0])
- subparsers = parser.add_subparsers()
- parser_password = subparsers.add_parser('password', help='sets a password for your notebook server')
- parser_password.add_argument("password", help="password to set, if not given, a password will be queried for (NOTE: this may not be safe)",
- nargs="?")
- parser_password.add_argument("--quiet", help="suppress messages", action="store_true")
- parser_password.set_defaults(function=set_password)
- args = parser.parse_args(argv[1:])
- args.function(args)