Starting new filesystem
Please, rename your whattobuy.database to default.database
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import json, os, shutil
|
import json, os, shutil
|
||||||
import curses
|
import curses, tkinter
|
||||||
|
|
||||||
os.system("title " + "GTA BuyBase")
|
os.system("title " + "GTA BuyBase")
|
||||||
|
|
||||||
@@ -239,14 +239,16 @@ def checkbelow(belowthis, dictionary):
|
|||||||
yesbelow[key] = dictionary[key]
|
yesbelow[key] = dictionary[key]
|
||||||
return yesbelow
|
return yesbelow
|
||||||
|
|
||||||
|
basename = 'default.database'
|
||||||
|
backname = str(os.path.splitext(basename)[0]) + ".databack"
|
||||||
|
|
||||||
if not os.path.isfile('whattobuy.database'):
|
if not os.path.isfile('default.database'):
|
||||||
basewrite = open('whattobuy.database', 'w+')
|
basewrite = open('default.database', 'w+')
|
||||||
empty = {}
|
empty = {}
|
||||||
json.dump(empty, basewrite, indent=3)
|
json.dump(empty, basewrite, indent=3)
|
||||||
basewrite.close()
|
basewrite.close()
|
||||||
|
|
||||||
baseread = open('whattobuy.database')
|
baseread = open('default.database')
|
||||||
database = json.load(baseread)
|
database = json.load(baseread)
|
||||||
baseread.close()
|
baseread.close()
|
||||||
|
|
||||||
@@ -280,11 +282,6 @@ shops = set(shops)
|
|||||||
shops = list(shops)
|
shops = list(shops)
|
||||||
shops = sorted(shops)
|
shops = sorted(shops)
|
||||||
|
|
||||||
# print(buyitems)
|
|
||||||
# print(bytype)
|
|
||||||
# print(byshop)
|
|
||||||
# print(byprice)
|
|
||||||
|
|
||||||
printlogo()
|
printlogo()
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
@@ -349,8 +346,9 @@ while True:
|
|||||||
basewrite.close()
|
basewrite.close()
|
||||||
|
|
||||||
elif doing == menulist["baseoptions"][0]:
|
elif doing == menulist["baseoptions"][0]:
|
||||||
shutil.copy("whattobuy.database", "whattobuy.databack")
|
print()
|
||||||
if os.path.isfile('whattobuy.databack'):
|
shutil.copy(basename, backname)
|
||||||
|
if os.path.isfile(backname):
|
||||||
print("Backup successful")
|
print("Backup successful")
|
||||||
print()
|
print()
|
||||||
input("To go back to menu press Enter...")
|
input("To go back to menu press Enter...")
|
||||||
|
|||||||
Reference in New Issue
Block a user