summaryrefslogtreecommitdiff
path: root/tradey.py
diff options
context:
space:
mode:
Diffstat (limited to 'tradey.py')
-rw-r--r--tradey.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/tradey.py b/tradey.py
index f2f5ac3..8ec6c6b 100644
--- a/tradey.py
+++ b/tradey.py
@@ -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.