Show More
@@ -30,6 +30,8 b' class config(object):' | |||||
30 | return config(self) |
|
30 | return config(self) | |
31 | def __contains__(self, section): |
|
31 | def __contains__(self, section): | |
32 | return section in self._data |
|
32 | return section in self._data | |
|
33 | def hasitem(self, section, item): | |||
|
34 | return item in self._data.get(section, {}) | |||
33 | def __getitem__(self, section): |
|
35 | def __getitem__(self, section): | |
34 | return self._data.get(section, {}) |
|
36 | return self._data.get(section, {}) | |
35 | def __iter__(self): |
|
37 | def __iter__(self): |
@@ -507,6 +507,9 b' class ui(object):' | |||||
507 | result = default or [] |
|
507 | result = default or [] | |
508 | return result |
|
508 | return result | |
509 |
|
509 | |||
|
510 | def hasconfig(self, section, name, untrusted=False): | |||
|
511 | return self._data(untrusted).hasitem(section, name) | |||
|
512 | ||||
510 | def has_section(self, section, untrusted=False): |
|
513 | def has_section(self, section, untrusted=False): | |
511 | '''tell whether section exists in config.''' |
|
514 | '''tell whether section exists in config.''' | |
512 | return section in self._data(untrusted) |
|
515 | return section in self._data(untrusted) |
General Comments 0
You need to be logged in to leave comments.
Login now