Show More
@@ -127,16 +127,14 b' class ui(object):' | |||
|
127 | 127 | cdata.set(section, name, value) |
|
128 | 128 | self.fixconfig() |
|
129 | 129 | |
|
130 |
def _ |
|
|
131 | if untrusted: | |
|
132 | return self.ucdata | |
|
133 | return self.cdata | |
|
130 | def _data(self, untrusted): | |
|
131 | return untrusted and self.ucdata or self.cdata | |
|
134 | 132 | |
|
135 | 133 | def configsource(self, section, name, untrusted=False): |
|
136 |
return self._ |
|
|
134 | return self._data(untrusted).source(section, name) or 'none' | |
|
137 | 135 | |
|
138 | 136 | def config(self, section, name, default=None, untrusted=False): |
|
139 |
value = self._ |
|
|
137 | value = self._data(untrusted).get(section, name, default) | |
|
140 | 138 | if self.debugflag and not untrusted: |
|
141 | 139 | uvalue = self.ucdata.get(section, name) |
|
142 | 140 | if uvalue is not None and uvalue != value: |
@@ -164,10 +162,10 b' class ui(object):' | |||
|
164 | 162 | |
|
165 | 163 | def has_section(self, section, untrusted=False): |
|
166 | 164 | '''tell whether section exists in config.''' |
|
167 |
return section in self._ |
|
|
165 | return section in self._data(untrusted) | |
|
168 | 166 | |
|
169 | 167 | def configitems(self, section, untrusted=False): |
|
170 |
items = self._ |
|
|
168 | items = self._data(untrusted).items(section) | |
|
171 | 169 | if self.debugflag and not untrusted: |
|
172 | 170 | for k,v in self.ucdata.items(section): |
|
173 | 171 | if self.cdata.get(section, k) != v: |
@@ -176,7 +174,7 b' class ui(object):' | |||
|
176 | 174 | return items |
|
177 | 175 | |
|
178 | 176 | def walkconfig(self, untrusted=False): |
|
179 |
cdata = self._ |
|
|
177 | cdata = self._data(untrusted) | |
|
180 | 178 | for section in cdata.sections(): |
|
181 | 179 | for name, value in self.configitems(section, untrusted): |
|
182 | 180 | yield section, name, str(value).replace('\n', '\\n') |
General Comments 0
You need to be logged in to leave comments.
Login now