web_config: fix output if no abbreviations defined

This commit is contained in:
David Adam
2014-10-07 12:20:28 +08:00
parent 3c8b344a41
commit 3f0210dc96

View File

@@ -687,8 +687,12 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
lines = (x for x in out.rstrip().split('\n'))
# Turn the output into something we can use
abbrout = (line[len('abbr -a '):].strip('\'') for line in lines)
abbrs = (x.split('=') for x in abbrout)
result = [{'word': x, 'phrase': y} for x, y in abbrs]
abbrs = [x.split('=') for x in abbrout]
if abbrs[0][0]:
result = [{'word': x, 'phrase': y} for x, y in abbrs]
else:
result = []
return result
def secure_startswith(self, haystack, needle):