VirtualMailManager/cli/Config.py
branchv0.6.x
changeset 216 0c8c053b451c
parent 215 33f727efa7c4
child 290 e2785e04f92e
equal deleted inserted replaced
215:33f727efa7c4 216:0c8c053b451c
    11 from ConfigParser import RawConfigParser
    11 from ConfigParser import RawConfigParser
    12 from shutil import copy2
    12 from shutil import copy2
    13 
    13 
    14 from VirtualMailManager import ENCODING
    14 from VirtualMailManager import ENCODING
    15 from VirtualMailManager.Config import Config, ConfigValueError, LazyConfig
    15 from VirtualMailManager.Config import Config, ConfigValueError, LazyConfig
    16 from VirtualMailManager.Exceptions import VMMConfigException
    16 from VirtualMailManager.errors import ConfigError
    17 from VirtualMailManager.cli import w_std
    17 from VirtualMailManager.cli import w_std
    18 from VirtualMailManager.constants.ERROR import VMM_TOO_MANY_FAILURES
    18 from VirtualMailManager.constants.ERROR import VMM_TOO_MANY_FAILURES
    19 
    19 
    20 
    20 
    21 class CliConfig(Config):
    21 class CliConfig(Config):
    45                             break
    45                             break
    46                         except (ValueError, ConfigValueError), e:
    46                         except (ValueError, ConfigValueError), e:
    47                             w_std(_(u'Warning: %s') % e)
    47                             w_std(_(u'Warning: %s') % e)
    48                             failures += 1
    48                             failures += 1
    49                             if failures > 2:
    49                             if failures > 2:
    50                                 raise VMMConfigException(
    50                                 raise ConfigError(
    51                                     _(u'Too many failures - try again later.'),
    51                                     _(u'Too many failures - try again later.'),
    52                                                          VMM_TOO_MANY_FAILURES)
    52                                                   VMM_TOO_MANY_FAILURES)
    53                     else:
    53                     else:
    54                         break
    54                         break
    55             print
    55             print
    56         if self._modified:
    56         if self._modified:
    57             self.__saveChanges()
    57             self.__saveChanges()