Tree prefs test persistance

This commit is contained in:
Bryan Schumaker 2010-11-14 17:50:57 -05:00
parent a53f2740c3
commit 56ffa217e5
1 changed files with 3 additions and 17 deletions

View File

@ -2,24 +2,9 @@
from libsaria import trees
t = trees.PersPrefTree("prefs")
t = trees.get_pref_tree("prefs")
t.disp()
#def init_pref(key, val):
# path = key.split('.')
# if t.lookup(path) == None:
# t.insert2(path + [val])
#def get_pref(key):
# val = t.lookup(key.split('.'))[0]
# print val
#def set_pref(key, val):
# path = key.split('.')
# t.insert2(path + [val])
#t.init_pref("libsaria.random", True)
t.set_pref("libsaria.random", True)
t.init_pref("libsaria.a.b", 42)
@ -29,3 +14,4 @@ print t.get_pref("libsaria.a.b")
t.set_pref("libsaria.random", False)
print t.get_pref("libsaria.random")
t.disp()