-
Notifications
You must be signed in to change notification settings - Fork 0
/
magica.py
59 lines (46 loc) · 1.07 KB
/
magica.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# -*- coding:utf-8 -*-
import click
import magica_core.core as core
@click.group()
def cli():
pass
@cli.command()
def notes():
"""This function is intended to print all existing notes."""
data = core.notes()
for i in range(data[0]):
print('{:4d}| {:20} ({:d} books)'.format((i+1), data[1][i][0], data[1][i][1]))
print(' total {:d} notes'.format(data[0]))
@cli.command()
@click.argument('note')
def make(note):
"""This function is intended to make a new note.
:param str note: The name of the note to be created.
"""
core.make(note)
@cli.command()
@click.argument('note')
def add(note):
"""
Keyword arguments:
note -- note's name
:return:
"""
pass
@cli.command()
@click.argument('note')
@click.argument('title', required=False)
def info(note, title):
pass
@cli.command()
@click.argument('note')
@click.argument('title', required=False)
def remove(note, title):
pass
@cli.command()
@click.argument('note')
@click.option('--type', default='csv')
def save(note, type):
pass
if __name__=="__main__":
cli()