~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

  • Committer: Erik Bågfors
  • Date: 2006-02-22 20:33:25 UTC
  • mto: (1558.1.9 Aaron's integration)
  • mto: This revision was merged to the branch mainline in revision 1574.
  • Revision ID: erik@bagfors.nu-20060222203325-33baad9691a8ed45
remove AliasConfig, based on input from abentley

Show diffs side-by-side

added added

removed removed

Lines of Context:
205
205
            return True
206
206
        return False
207
207
 
 
208
    def get_alias(self, value):
 
209
        return self._get_alias(value)
 
210
 
 
211
    def _get_alias(self, value):
 
212
        pass
 
213
 
208
214
 
209
215
class IniBasedConfig(Config):
210
216
    """A configuration policy that draws from ini files."""
272
278
        raise errors.BzrError("Invalid signatures policy '%s'"
273
279
                              % signature_string)
274
280
 
 
281
    def _get_alias(self, value):
 
282
        try:
 
283
            return self._get_parser().get_value("ALIASES", 
 
284
                                                value)
 
285
        except KeyError:
 
286
            pass
 
287
 
275
288
 
276
289
class GlobalConfig(IniBasedConfig):
277
290
    """The configuration that should be used for a specific location."""
282
295
    def __init__(self):
283
296
        super(GlobalConfig, self).__init__(config_filename)
284
297
 
285
 
class AliasConfig(IniBasedConfig):
286
 
    def get_alias(self, value):
287
 
        return self._get_user_option(value)
288
 
 
289
 
    def _get_section(self):
290
 
        return "ALIASES"
291
 
 
292
 
    def __init__(self):
293
 
        super(AliasConfig, self).__init__(config_filename)
294
298
 
295
299
class LocationConfig(IniBasedConfig):
296
300
    """A configuration object that gives the policy for a location."""
455
459
        """See Config.log_format."""
456
460
        return self._get_location_config()._log_format()
457
461
 
 
462
 
458
463
def ensure_config_dir_exists(path=None):
459
464
    """Make sure a configuration directory exists.
460
465
    This makes sure that the directory exists.