Skip to content

Commit

Permalink
ter 25 abr 2023 11:44:46 -03
Browse files Browse the repository at this point in the history
  • Loading branch information
RenatoBrittoAraujo committed Apr 25, 2023
1 parent e38e31c commit 2739ef6
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions avl_optmizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ def set_value(self, key: str, value: str):
def get_value(self, key: str):
d = self.structure
for label in key.split("."):
d = d[label]
if type(d) == list:
d = d[int(label)]
else:
d = d[label]
return d

def set_values(self, keys: list[str], values: list[str]):
Expand Down Expand Up @@ -184,7 +187,11 @@ def test():
# avl = AVL(AVL_ENV_PATH, AVL_OUTPUT_FILE, AVL_INPUT_FILE)
# avl.analyse_v1()
with open("geometria.txt") as f:
print(AVLFileParser(arquivo=f.read()).structure)
x = AVLFileParser(arquivo=f.read())
base_lbl = "children.sections"
for i in range(len(list(x.get_value(base_lbl)))):
lbl = base_lbl + "." + str(i)
print(lbl, "=", x.get_value(lbl))


def main():
Expand Down Expand Up @@ -249,5 +256,5 @@ def main():


if __name__ == "__main__":
main()
# test()
# main()
test()

0 comments on commit 2739ef6

Please sign in to comment.