do not consider passwords as integer

This commit is contained in:
Yann Leboulanger 2005-01-06 12:45:57 +00:00
parent c78ff29ce7
commit b870a29f46
1 changed files with 8 additions and 5 deletions

View File

@ -42,12 +42,15 @@ class OptionsParser(ConfigParser.ConfigParser):
for option in self.options(section):
value = self.get(section, option, 1)
#convert to int options than can be
try:
i = string.atoi(value)
except ValueError:
self.tab[section][option] = value
if string.find(option, 'password') == -1:
try:
i = string.atoi(value)
except ValueError:
self.tab[section][option] = value
else:
self.tab[section][option] = i
else:
self.tab[section][option] = i
self.tab[section][option] = value
# setattr(self, str(section) + '_' + \
# str(option), value)