+
+ def get_size_settings(self):
+ # defaults = {'width':480,'height':230}
+ # options: w 798 700 600 500 480 400
+ # options: h 420 360 310 270 240 200
+ print "checking to see if config file is available"
+ if os.path.isfile(sizefile) == True:
+ print "found " + sizefile
+ dbf = open(sizefile, 'r')
+ dbr = csv.reader(dbf)
+ try:
+ cfg = dbr.next()
+ except:
+ dbf.close()
+ print "empty config file"
+ return defaults
+ dbf.close()
+
+ sizes = {'width':int(cfg[0]),'height':int(cfg[1])}
+ if sizes['width'] > 798:
+ sizes['width'] = 798
+ if sizes['width'] < 400:
+ sizes['width'] = 400
+ if sizes['height'] > 420:
+ sizes['height'] = 420
+ if sizes['height'] < 200:
+ sizes['height'] = 200
+
+ return sizes
+
+
+ # if not, copy it.
+ else:
+ print "no config file"
+ return defaults