X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=functions.py;h=2909a4449b9f8f2aeb48aa7eb8e2a00e24d26cbf;hp=2165f334b328c24c01dd686425c824ab7d1c4d0f;hb=ebaa7c5d0ddfb75fb535f8383acb37beafd91993;hpb=b0333175cc68917ceb33589b0b354bf931fec245 diff --git a/functions.py b/functions.py index 2165f33..2909a44 100644 --- a/functions.py +++ b/functions.py @@ -10,6 +10,7 @@ from ConfigParser import ConfigParser from subprocess import Popen, call, PIPE import thread import os +import ast import sys import csv import platform @@ -130,6 +131,12 @@ class DoConf : for option in self.conf.options(section) : if self.conf.get(section, option).isdigit() : parametres[option] = int(self.conf.get(section, option)) + elif self.conf.get(section, option) == 'False' : + parametres[option] = False + elif self.conf.get(section, option) == 'True' : + parametres[option] = True + elif self.conf.get(section, option).startswith('(') and self.conf.get(section, option).endswith(')') : + parametres[option] = ast.literal_eval(self.conf.get(section, option)) else : parametres[option] = self.conf.get(section, option) if 'type' not in parametres : @@ -145,6 +152,10 @@ class DoConf : self.conf.set(section, option, `parametres[i][option]`) elif isinstance(parametres[i][option], basestring) : self.conf.set(section, option, parametres[i][option].encode('utf8')) + elif isinstance(parametres[i][option], wx.Colour) : + self.conf.set(section, option, str(parametres[i][option])) + else : + self.conf.set(section, option, `parametres[i][option]`) if outfile is None : outfile = self.configfile print outfile