From 18bbfd16b0d33dee4da2fb8077ac7d59914498de Mon Sep 17 00:00:00 2001 From: Gaurav Bansal Date: Sun, 2 Oct 2022 23:06:20 -0700 Subject: [PATCH] CAN NOW EDIT THE INTERNAL DATA HOLDER AND THE STORAGE THAT IS PROCESSED AND TAKEN FROM, AS WELL AS THE FILE DURING RUNTIME TABTAN --- data.stoic | 10 +++++----- main.py | 9 ++++----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/data.stoic b/data.stoic index 4ee90ab..41cbf85 100644 --- a/data.stoic +++ b/data.stoic @@ -1,12 +1,12 @@ -among - -sheesh: 2 +among: + -sheesh: 2 potato: 4 test: 8 -testtest: 4 -thsisbelopw: 3 - haugh + haugh: sheeash: 4 -shee +shee: pog: 0 - test: 3 + test: 7 green: 2 diff --git a/main.py b/main.py index d8a9d2f..afeb75f 100644 --- a/main.py +++ b/main.py @@ -130,12 +130,11 @@ def getBase(self, name): return x def reload(self, newData): + file = open(self.pathe, "r+") lList = file.readlines() for index, key in enumerate(newData.sections): - for indexo, keyo in enumerate(self.data.sections): - if key != keyo and int(index) == int(indexo): - lList[index] = (" " * newData.levels[index]) + key[0] + ": " + str(key[1]) + "\n" + lList[index] = (" " * newData.levels[index]) + key[0] + ": " + str(key[1]) + "\n" with open(self.pathe, "w") as f: f.writelines(lList) @@ -220,8 +219,8 @@ def printOut(self): #i just realized theres an error print(zx) -stoic.getBase('shee').getSubsection('pog').getSubsection('test').setValue(5, stoic) -stoic.printOut() +stoic.getBase('shee').getSubsection('pog').getSubsection('test').setValue(7, stoic) +# stoic.printOut() zx = stoic.getBase('shee').getSubsection('pog').getSubsection('test').getValue() print(zx)