From d5a2cce1df57b8a7e09efdc2a44d50df492f792f Mon Sep 17 00:00:00 2001 From: Jephte CLAIN Date: Thu, 24 Dec 2015 12:16:57 +0400 Subject: [PATCH] cgilsxml.py: rajouter la variable env/query_vars --- lib/ulib/support/cgilsxml.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/ulib/support/cgilsxml.py b/lib/ulib/support/cgilsxml.py index 14ba866..a9e0c68 100755 --- a/lib/ulib/support/cgilsxml.py +++ b/lib/ulib/support/cgilsxml.py @@ -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: