cgilsxml.py: rajouter la variable env/query_vars

This commit is contained in:
Jephté Clain 2015-12-24 12:16:57 +04:00
parent b7d109bed3
commit d5a2cce1df
1 changed files with 6 additions and 2 deletions

View File

@ -6,7 +6,7 @@ u"""Ce script est prévu pour être utilisé dans un script CGI.
Il permet de lister le contenu d'un répertoire au format XML, et de télécharger les fichiers trouvés.
"""
import os, sys, re, shutil, mimetypes
import os, sys, re, shutil, mimetypes, urlparse
from os import path
from time import time, localtime
from types import UnicodeType, StringTypes
@ -184,7 +184,11 @@ def print_files(files, fgroups=None, select_group=None, script_name=None, query_
if script_name is not None:
ET.SubElement(xenv, "script_name").text = _u(script_name)
if query_string is not None:
ET.SubElement(xenv, "query_string").text = _u(query_string)
query_string = _u(query_string)
ET.SubElement(xenv, "query_string").text = query_string
xvars = ET.SubElement(xenv, "query_vars")
for name, value in urlparse.parse_qsl(query_string, keep_blank_values=True):
ET.SubElement(xvars, "var", name=name, value=value)
xfgroups = ET.SubElement(xresult, "fgroups")
if fgroups is not None:
for fgroup in fgroups: