[perf] misc script
This commit is contained in:
parent
cb2d3fd580
commit
76f9191b1b
1 changed files with 16 additions and 2 deletions
18
misc.py
18
misc.py
|
@ -5,10 +5,15 @@ import click
|
|||
|
||||
from Crypto.PublicKey import RSA
|
||||
from demo import config
|
||||
from demo.boxes import send_note
|
||||
|
||||
@click.group()
|
||||
def misc():
|
||||
pass
|
||||
|
||||
|
||||
@click.command()
|
||||
def gen_key():
|
||||
def gen_key(self):
|
||||
"""Generate key."""
|
||||
if config.KEY_PATH.exists():
|
||||
print("Key is existing!")
|
||||
|
@ -20,5 +25,14 @@ def gen_key():
|
|||
print("Done!")
|
||||
|
||||
|
||||
@click.command()
|
||||
@click.option("--content", prompt="Note content")
|
||||
def creat_note(content):
|
||||
send_note(content)
|
||||
|
||||
|
||||
misc.add_command(gen_key)
|
||||
misc.add_command(creat_note)
|
||||
|
||||
if __name__ == "__main__":
|
||||
gen_key()
|
||||
misc()
|
||||
|
|
Loading…
Reference in a new issue