cgilsxml.py: cosmetic

This commit is contained in:
Jephté Clain 2016-06-09 16:29:24 +04:00
parent 0204a21aeb
commit d8ab7f74ac
1 changed files with 13 additions and 4 deletions

View File

@ -251,12 +251,17 @@ def print_files(files, fgroups=None, select_group=None, script_name=None, xslt=N
if script_name is not None:
ET.SubElement(xenv, "script_name").text = _u(script_name)
ET.SubElement(xenv, "script_base").text = _u(re.sub(r'[^/]+$', '', script_name))
if query_string is not None:
fquery_string = filter_query_string(query_string, includes, excludes, prefix)
query_string = _u(query_string)
orig_query_string = query_string
if orig_query_string is not None:
query_string = orig_query_string
params = urlparse.parse_qsl(query_string, keep_blank_values=True)
fquery_string = _u(fquery_string)
query_string = _u(query_string)
fquery_string = filter_query_string(orig_query_string, includes, excludes, prefix)
fparams = urlparse.parse_qsl(fquery_string, keep_blank_values=True)
fquery_string = _u(fquery_string)
if includes or excludes or prefix:
xorig = ET.SubElement(xenv, "orig")
if query_string:
@ -267,12 +272,15 @@ def print_files(files, fgroups=None, select_group=None, script_name=None, xslt=N
ET.SubElement(xvars, name).text = value
query_string = fquery_string
params = fparams
if query_string:
ET.SubElement(xenv, "query_string").text = u'?%s' % query_string
ET.SubElement(xenv, "squery_string").text = u'&%s' % query_string
xvars = ET.SubElement(xenv, "query_vars")
for name, value in params:
ET.SubElement(xvars, name).text = value
xfgroups = ET.SubElement(xresult, "fgroups")
if fgroups is not None:
for fgroup in fgroups:
@ -280,6 +288,7 @@ def print_files(files, fgroups=None, select_group=None, script_name=None, xslt=N
xfgroup.text = _u(fgroup)
if fgroup == select_group:
xfgroup.set('selected', 'selected')
xfiles = ET.SubElement(xresult, "files")
first = True
last_classifier = (None, None)