-def repr_long(value):
- string_value = repr(value)
- if re.match('\d*L$', string_value): return string_value.strip("L")
- else: return string_value
-
-def getlong(config, section, option):
- try:
- return int(config.get(section, option).strip("L"))
- except ConfigParser.NoSectionError:
- config.add_section(section)
- return getlong(config, section, option)
- except ConfigParser.NoOptionError:
- setlong(config, section, option, 0)
- return getlong(config, section, option)
-
-def setlong(config, section, option, value):
- return config.set(section, option, repr_long(value))
-