Show More
@@ -505,7 +505,7 class ui(object): | |||||
505 | v = os.path.join(base, os.path.expanduser(v)) |
|
505 | v = os.path.join(base, os.path.expanduser(v)) | |
506 | return v |
|
506 | return v | |
507 |
|
507 | |||
508 |
def configbool(self, section, name, default= |
|
508 | def configbool(self, section, name, default=_unset, untrusted=False): | |
509 | """parse a configuration element as a boolean |
|
509 | """parse a configuration element as a boolean | |
510 |
|
510 | |||
511 | >>> u = ui(); s = 'foo' |
|
511 | >>> u = ui(); s = 'foo' | |
@@ -526,8 +526,10 class ui(object): | |||||
526 | ConfigError: foo.invalid is not a boolean ('somevalue') |
|
526 | ConfigError: foo.invalid is not a boolean ('somevalue') | |
527 | """ |
|
527 | """ | |
528 |
|
528 | |||
529 |
v = self.config(section, name, |
|
529 | v = self.config(section, name, default, untrusted=untrusted) | |
530 | if v is None: |
|
530 | if v is None: | |
|
531 | if default is _unset: | |||
|
532 | return False | |||
531 | return default |
|
533 | return default | |
532 | if isinstance(v, bool): |
|
534 | if isinstance(v, bool): | |
533 | return v |
|
535 | return v |
General Comments 0
You need to be logged in to leave comments.
Login now