-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.py
More file actions
87 lines (74 loc) · 2.32 KB
/
menu.py
File metadata and controls
87 lines (74 loc) · 2.32 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
76
77
78
79
80
81
82
83
84
85
86
87
from library import*
import json
import click
from click_shell import shell
@shell(prompt='Garden > ', intro='Starting simulation...')
def main():
global garden
garden = Garden()
garden.get_data_from_file()
click.echo("Вечера")
garden.show()
garden.next_day()
garden.set_data_in_file()
click.echo("Сегодня")
garden.show()
@main.command()
def add_bed():
garden.add_garden_bed()
garden.set_data_in_file()
garden.show()
@main.command(help = 'Plant tree: apple or pear')
@click.argument('type')
def plant_tree(type):
garden.plant_tree(type)
garden.set_data_in_file()
garden.show()
@main.command(help = 'Plant cultivated plant (tomato, potato or pepper) in garden bed №...')
@click.argument('type')
@click.argument('count')
def plant_cult(type, count):
garden.plant_cultivated_plant(type, int(count) - 1)
garden.set_data_in_file()
garden.show()
@main.command(help = 'Watering cultivated plant in garden bed №...')
@click.argument('count')
def watering(count):
garden.watering(int(count) - 1)
garden.set_data_in_file()
garden.show()
@main.command(help = 'Fertilize cultivated plant in garden bed №...')
@click.argument('count')
def fertilize(count):
garden.fertilize(int(count) - 1)
garden.set_data_in_file()
garden.show()
@main.command(help = 'Kill pest on plant (cult or tree) in garden bed №... or on tree №...')
@click.argument('type')
@click.argument('count')
def kill_pest(type, count):
garden.kill_pest(type, int(count) - 1)
garden.set_data_in_file()
garden.show()
@main.command(help = 'Treatment on plant (cult or tree) in garden bed №... or on tree №...')
@click.argument('type')
@click.argument('count')
def treatment(type, count):
garden.treatment(type, int(count) - 1)
garden.set_data_in_file()
garden.show()
@main.command(help = 'Weeding cultivated plant in garden bed №...')
@click.argument('count')
def weeding(count):
garden.weeding(int(count) - 1)
garden.set_data_in_file()
garden.show()
@main.command(help = 'Harvesting on plant (cult or tree) in garden bed №... or on tree №...')
@click.argument('type')
@click.argument('count')
def harvesting(type, count):
garden.harvesting(type, int(count) - 1)
garden.set_data_in_file()
garden.show()
if __name__ == '__main__':
main()