~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/debug.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-08-09 12:34:00 UTC
  • mfrom: (6056.2.5 option-registry)
  • Revision ID: pqm@pqm.ubuntu.com-20110809123400-x521f2j9jkxx8ze2
(vila) Introduce OptionRegistry (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
def set_debug_flags_from_config():
32
32
    """Turn on debug flags based on the global configuration"""
33
33
 
34
 
    from bzrlib import config
 
34
    from bzrlib.config import GlobalConfig
35
35
 
36
 
    c = config.GlobalStack()
37
 
    for f in c.get('debug_flags'):
38
 
        debug_flags.add(f)
 
36
    c = GlobalConfig()
 
37
    value = c.get_user_option("debug_flags")
 
38
    if value is not None:
 
39
        # configobject gives us either a string if there's just one or a list
 
40
        # if there's multiple
 
41
        if isinstance(value, basestring):
 
42
            value = [value]
 
43
        for w in value:
 
44
            w = w.strip()
 
45
            debug_flags.add(w)