##// END OF EJS Templates
config: improve code readability
Andrey -
r9339:9be91129 default
parent child Browse files
Show More
@@ -80,7 +80,7 class config(object):
80 section = ""
80 section = ""
81 item = None
81 item = None
82 line = 0
82 line = 0
83 cont = 0
83 cont = False
84
84
85 for l in data.splitlines(True):
85 for l in data.splitlines(True):
86 line += 1
86 line += 1
@@ -114,7 +114,7 class config(object):
114 m = itemre.match(l)
114 m = itemre.match(l)
115 if m:
115 if m:
116 item = m.group(1)
116 item = m.group(1)
117 cont = 1
117 cont = True
118 if sections and section not in sections:
118 if sections and section not in sections:
119 continue
119 continue
120 self.set(section, item, m.group(2), "%s:%d" % (src, line))
120 self.set(section, item, m.group(2), "%s:%d" % (src, line))
@@ -128,7 +128,7 class config(object):
128 del self._data[section][name]
128 del self._data[section][name]
129 continue
129 continue
130
130
131 raise error.ConfigError(_('config error at %s:%d: \'%s\'')
131 raise error.ConfigError(_("config error at %s:%d: '%s'")
132 % (src, line, l.rstrip()))
132 % (src, line, l.rstrip()))
133
133
134 def read(self, path, fp=None, sections=None, remap=None):
134 def read(self, path, fp=None, sections=None, remap=None):
General Comments 0
You need to be logged in to leave comments. Login now