diff options
-rw-r--r-- | tradey.py | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -44,9 +44,7 @@ class UserTree: def save(self): # Be sure to call save() after any changes to the tree. self.tree = ElementTree(self.root) - f=open("data/user.xml","w") - f.write(etree.tostring(root, pretty_print=True)) - f.close() + self.tree.write("data/user.xml") class ItemTree: def __init__(self): @@ -97,9 +95,7 @@ class ItemTree: def save(self): # Be sure to call save() after any changes to the tree. self.tree = ElementTree(self.root) - f = open("data/sale.xml", "w") - f.write(etree.tostring(root, pretty_print=True)) - f.close() + self.tree.write("data/sale.xml") def saveData(commitmessage = "commit"): # This assumes the current working directory is the tradey directory. |