-
Notifications
You must be signed in to change notification settings - Fork 0
/
core.py
34 lines (26 loc) · 805 Bytes
/
core.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
#!/usr/bin/env python3
#---
import DataEdit
import subprocess
#---
DATE = subprocess.check_output("date +%d.%m.%y", shell = True).decode("latin1").strip()
#---
def new_Expense(count, reason = None):
#----
All_Money = get_All_money()
All_Money -= int(count)
#----
DataEdit.set_field(date = DATE, money = count, reason = reason, all_money = All_Money, type = "Expense")
def new_Income(count, reason = None):
#----
All_Money = get_All_money()
All_Money += int(count)
#----
DataEdit.set_field(date = DATE, money = count, reason = reason, all_money = All_Money, type = "Income")
def get_All_money():
All_Money = DataEdit.get_field("all_money")
if not All_Money:
All_Money = 0
else:
All_Money = int(All_Money[-1])
return All_Money