It works!
[drlaunch] / src / config.py
index ac61424..50ae471 100755 (executable)
@@ -54,7 +54,7 @@ def get_config_fn():
 
     return(ret)
 
-class Config:
+class Config(object):
     def __init__(self, id):
        self.id=id
 
@@ -92,6 +92,7 @@ class Config:
        self.iconpadding=12
        self.iconmargin=6
 
+    # Return the maximum grid size
     def getMaxSize(self):
        isf=self.getIconSizeFull()
        retx=int(800/isf)
@@ -99,6 +100,16 @@ class Config:
        maxsz=(retx, rety)
        return(maxsz)
 
+    # Return the maxmimum icon size
+    def getIconSizeRange(self):
+       return((48,128))
+
+    def getIconPaddingRange(self):
+       return((0,32))
+
+    def getIconMarginRange(self):
+       return((0,16))
+
     def getIconSize(self):
        return(self.iconsize)
 
@@ -339,5 +350,14 @@ class Config:
            print "config.init() not done"
            sys.exit(1)
 
+def dump(obj):
+    attrs=[attr for attr in dir(obj) if not callable(getattr(obj,attr))]
+
+    print "obj:", obj
+    for attr in attrs:
+       if attr=='__gdoc__' or attr=='__doc__':
+           continue
+       print "  ", attr, ":", getattr(obj, attr)
+
 # vim: set ts=8 sts=4 sw=4 noet formatoptions=r ai nocindent: