Starting development owning options

This commit is contained in:
BarsTiger
2021-08-21 11:20:43 +03:00
parent f68adc94b6
commit 66d18b0560

View File

@@ -1,5 +1,5 @@
import json, os, shutil import json, os, shutil
import curses, tkinter import curses
os.system("title " + "GTA BuyBase") os.system("title " + "GTA BuyBase")
@@ -64,7 +64,7 @@ doing = 0
menulist = {"main": ['Data output', 'Database loading and options', 'Add new item', 'Owning options', 'Exit'], menulist = {"main": ['Data output', 'Database loading and options', 'Add new item', 'Owning options', 'Exit'],
"output": ['Print all database', 'Print all items', 'Print all items by type', 'Print all items by shop', 'Print all items by price below this', 'Back'], "output": ['Print all database', 'Print all items', 'Print all items by type', 'Print all items by shop', 'Print all items by price below this', 'Back'],
"baseoptions": ['Create backup of opened database', 'Open another database', 'Create new database', 'Back'], "baseoptions": ['Create backup of opened database', 'Open another database', 'Create new database', 'Back'],
"ownoptions": ['Edit own or not (in dev)', 'Show only owned (in dev)', 'Show only unowned (in dev)', 'Show all (in dev)', 'Back'], "ownoptions": ['Edit own or not', 'Show only owned', 'Show only unowned', 'Show all', 'Back'],
"exit": ["Exit", "Back"]} "exit": ["Exit", "Back"]}
def exitmenu(stdscr): def exitmenu(stdscr):
@@ -240,9 +240,10 @@ def dictsortedkey(dictionary):
def printbase(dictionary): def printbase(dictionary):
keys = list(dictionary) keys = list(dictionary)
for key in keys: if showown == "All":
print(key + ": " + dictionary[key][0] + " " + dictionary[key][1] + " " + "{:,}".format(dictionary[key][2])) for key in keys:
print() print(key + ": " + dictionary[key][0] + " " + dictionary[key][1] + " " + "{:,}".format(dictionary[key][2]))
print()
def checkbelow(belowthis, dictionary): def checkbelow(belowthis, dictionary):
yesbelow = {} yesbelow = {}
@@ -253,6 +254,7 @@ def checkbelow(belowthis, dictionary):
basename = 'default.database' basename = 'default.database'
backname = str(os.path.splitext(basename)[0]) + ".databack" backname = str(os.path.splitext(basename)[0]) + ".databack"
showown = "All"
if not os.path.isfile(basename): if not os.path.isfile(basename):
basewrite = open(basename, 'w+') basewrite = open(basename, 'w+')