Compare commits

...

3 Commits

Author SHA1 Message Date
viogq d0e4671000
Merge d1c63b6517 into 18b8f9ab4b 2024-03-10 12:51:12 -07:00
viogq d1c63b6517
fix err: 1 arg missing corner case 2019-09-18 14:23:36 +00:00
viogq 09d1feab80
error unless TRY used 2019-09-18 13:00:29 +00:00
1 changed files with 5 additions and 3 deletions

View File

@ -226,11 +226,13 @@ class EditConf(Grammar):
conffile = self[1]
options = []
eq = "="
if self[3] and "-s" in self[3].string: eq = " "
for opt in re.split("\s+", self[4].string):
k, v = opt.split("=", 1)
if self[3] and "-s" in self[3].string: eq = " "
try:
for opt in re.split("\s+", self[4].string):
k, v = opt.split("=", 1) # try except , else err: 1 arg missing
v = re.sub(r"\n+", "", fixup_tokens(v)) # not sure why newlines are getting doubled
options.append("%s%s%s" % (k, eq, v))
except: pass
return "<div class='write-to'><div class='filename'>" + self[1].string + " <span>(change settings)</span></div><pre>" + "\n".join(cgi.escape(s) for s in options) + "</pre></div>\n"
class CaptureOutput(Grammar):