equal
deleted
inserted
replaced
25 """ |
25 """ |
26 |
26 |
27 def configure(self, sections): |
27 def configure(self, sections): |
28 """Interactive method for configuring all options of the given |
28 """Interactive method for configuring all options of the given |
29 iterable ``sections`` object.""" |
29 iterable ``sections`` object.""" |
30 input_fmt = _(u'Enter new value for option %(option)s \ |
30 input_fmt = _(u'Enter new value for option %(option)s ' |
31 [%(current_value)s]: ') |
31 u'[%(current_value)s]: ') |
32 failures = 0 |
32 failures = 0 |
33 |
33 |
34 w_std(_(u'Using configuration file: %s\n') % self._cfg_filename) |
34 w_std(_(u'Using configuration file: %s\n') % self._cfg_filename) |
35 for s in sections: |
35 for s in sections: |
36 w_std(_(u'* Configuration section: %r') % s) |
36 w_std(_(u'* Configuration section: %r') % s) |
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 ConfigError( |
50 raise ConfigError(_(u'Too many failures - try ' |
51 _(u'Too many failures - try again later.'), |
51 u'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: |