dabo Commit
Revision 3226
Date: 2007-07-05 16:30:13 -0700 (Thu, 05 Jul 2007)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/3226
Changed:
U trunk/dabo/dPref.py
Log:
Added support for dictionaries as a preference setting type. There was no
reason this wasn't done before, except that it was an oversight.
Diff:
Modified: trunk/dabo/dPref.py
===================================================================
--- trunk/dabo/dPref.py 2007-07-04 21:09:08 UTC (rev 3225)
+++ trunk/dabo/dPref.py 2007-07-05 23:30:13 UTC (rev 3226)
@@ -61,7 +61,7 @@
self._parent = None
self._noneType = type(None)
self._typeDict = {int: "int", float: "float", long: "long",
str: "str", unicode: "unicode",
- bool: "bool", list: "list", tuple: "tuple",
datetime.date: "date",
+ bool: "bool", list: "list", tuple: "tuple",
datetime.date: "date", dict: "dict",
datetime.datetime: "datetime", self._noneType:
"none"}
if crs is None:
prefdir = utils.getUserAppDataDirectory(appName)
@@ -177,7 +177,7 @@
ret = long(val)
elif typ == "bool":
ret = (val == "True")
- elif typ in ("list", "tuple"):
+ elif typ in ("list", "tuple", "dict"):
ret = eval(val)
elif typ == "date":
ret = eval("datetime.date%s" % val)
@@ -469,7 +469,6 @@
print "'a' prefs and all sub-prefs:"
print a.getPrefs(True)
-
zz=a.getSubPrefKeys()
print "SUB PREFS", zz
zz = a.getPrefKeys()
@@ -488,4 +487,3 @@
print "DELETE ALL"
a.deleteAllPrefs()
print a.getPrefs(True)
-
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/dabo-dev/[EMAIL PROTECTED]