escape ',' in queries to work around firefox break

This commit is contained in:
Sean Dague 2014-06-02 16:15:06 -04:00
parent f8003276f5
commit 41eeed4022
1 changed files with 8 additions and 2 deletions

View File

@ -19,6 +19,11 @@ import sys
import urllib
def escape_comma(buff):
"""Because otherwise Firefox is a sad panda."""
return buff.replace(',', '%2c')
def get_title(fname):
title = ""
foreach = ""
@ -29,7 +34,7 @@ def get_title(fname):
m = re.match("foreach = (.+)", line)
if m:
foreach = m.group(1)
foreach = escape_comma(m.group(1))
fileinput.close()
return title, foreach
@ -44,7 +49,8 @@ def get_sections(fname):
elif sname:
m = re.match("query = (.+)", line)
if m:
query = m.group(1)
query = escape_comma(m.group(1))
sections.append({'title': sname, 'query': query})
fileinput.close()
return sections