cgilsxml.py: rajouter la variable env/query_vars
This commit is contained in:
parent
b7d109bed3
commit
d5a2cce1df
|
@ -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.
|
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 os import path
|
||||||
from time import time, localtime
|
from time import time, localtime
|
||||||
from types import UnicodeType, StringTypes
|
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:
|
if script_name is not None:
|
||||||
ET.SubElement(xenv, "script_name").text = _u(script_name)
|
ET.SubElement(xenv, "script_name").text = _u(script_name)
|
||||||
if query_string is not None:
|
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")
|
xfgroups = ET.SubElement(xresult, "fgroups")
|
||||||
if fgroups is not None:
|
if fgroups is not None:
|
||||||
for fgroup in fgroups:
|
for fgroup in fgroups:
|
||||||
|
|
Loading…
Reference in New Issue