forked from s3bw/fool
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
75 lines (71 loc) · 2.38 KB
/
example.py
File metadata and controls
75 lines (71 loc) · 2.38 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
from datetime import datetime
from fool import console
from fool.console import ConsoleReturn
from examples.views import table_view
model = {
'entities': [
{
'title': 'first item',
'description': 'first item description',
'more': False,
'sub_items': [],
'created': datetime(2019, 10, 26),
},
{
'title': '2nd item',
'description': '2nd item description',
'more': False,
'sub_items': [],
'created': datetime(2019, 10, 26),
},
{
'title':
'3rd item',
'description':
'3rd item description',
'more':
True,
'sub_items': [{
'title': '13rd item',
'description': '3rd item description',
}],
'created':
datetime(2019, 10, 26),
},
{
'title': '23rd item',
'description': '3rd item description',
'more': False,
'sub_items': [],
'created': datetime(2019, 10, 26),
},
{
'title': '33rd item',
'description': '3rd item description',
'more': False,
'sub_items': [],
'created': datetime(2019, 10, 26),
},
],
'books': [
'lists', 'general', 'general', 'general', 'talks', 'talks', 'talks',
'general', 'general', 'general', 'general', 'general', 'general',
'general', 'general', 'general', 'talks', 'general', 'general',
'general', 'general', 'talks', 'design', 'talks', 'textbook', 'lists',
'general', 'general', 'general', 'lists', 'general', 'general',
'general', 'textbook', 'general', 'general', 'talks', 'general',
'general', 'general', 'general', 'general', 'general', 'general',
'general', 'talks', 'talks', 'general', 'general', 'textbook',
'textbook', 'general', 'design', 'textbook', 'general', 'general',
'talks', 'lists', 'general', 'general', 'general', 'general'
],
'book':
'general',
}
Actor = ConsoleReturn('running')
while Actor.action not in ['close', 'select']:
Actor = console.display(table_view, model, close='q')
if Actor.action in ['next', 'prev']:
model['book'] = Actor.key
if Actor.action != 'close':
print(model['entities'][Actor.value])