Tree prefs test

This was used for developing the preferences tree.
This commit is contained in:
Bryan Schumaker 2010-11-14 17:33:08 -05:00
parent 63211fb1c8
commit 133a5eb63d
1 changed files with 31 additions and 0 deletions

31
tests/tree_prefs.py Normal file
View File

@ -0,0 +1,31 @@
# Bryan Schumaker (11/14/2010)
from libsaria import trees
t = trees.PersPrefTree("prefs")
#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)
print t.get_pref("libsaria.random")
print t.get_pref("libsaria.a.b")
t.set_pref("libsaria.random", False)
print t.get_pref("libsaria.random")