equal
deleted
inserted
replaced
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.errors import ConfigError |
16 from VirtualMailManager.errors import ConfigError, VMMError |
17 from VirtualMailManager.cli import w_err, w_std |
17 from VirtualMailManager.cli import w_err, w_std |
18 from VirtualMailManager.constants import CONF_ERROR, VMM_TOO_MANY_FAILURES |
18 from VirtualMailManager.constants import CONF_ERROR, VMM_TOO_MANY_FAILURES |
19 |
19 |
20 _ = lambda msg: msg |
20 _ = lambda msg: msg |
21 |
21 |
44 if newval and newval != val: |
44 if newval and newval != val: |
45 try: |
45 try: |
46 LazyConfig.set(self, '%s.%s' % (section, opt), |
46 LazyConfig.set(self, '%s.%s' % (section, opt), |
47 newval) |
47 newval) |
48 break |
48 break |
49 except (ValueError, ConfigValueError), err: |
49 except (ValueError, ConfigValueError, VMMError), err: |
50 w_err(0, _(u'Warning: %s') % err) |
50 w_err(0, _(u'Warning: %s') % err) |
51 failures += 1 |
51 failures += 1 |
52 if failures > 2: |
52 if failures > 2: |
53 raise ConfigError(_(u'Too many failures - try ' |
53 raise ConfigError(_(u'Too many failures - try ' |
54 u'again later.'), |
54 u'again later.'), |