From a49d6e2a2410df11247159f591793730d13c69cd Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Fri, 10 Jun 2016 01:34:38 +0400 Subject: [PATCH] =?UTF-8?q?les=20valeurs=20None=20ne=20sont=20pas=20affich?= =?UTF-8?q?=C3=A9es.=20=20n'a=20pas=20de=20valeur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/ulib/support/cgilsxml.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/ulib/support/cgilsxml.py b/lib/ulib/support/cgilsxml.py index b494726..3ec1cdb 100755 --- a/lib/ulib/support/cgilsxml.py +++ b/lib/ulib/support/cgilsxml.py @@ -15,7 +15,8 @@ import xml.etree.ElementTree as ET # _u() et datef() sont des fonctions de pyulib, recopiées ici pour ne pas devoir # dépendre d'une librairie extérieure def _u(u): - if type(u) not in StringTypes: u = unicode(str(u), 'utf-8', 'strict') + if u is None: return None + elif type(u) not in StringTypes: u = unicode(str(u), 'utf-8', 'strict') elif type(u) is not UnicodeType: u = unicode(u, 'utf-8', 'strict') return u DATEF_MAP = {'%Y': '%(y)04i', '%m': '%(m)02i', '%d': '%(d)02i', '%H': '%(H)02i', '%M': '%(M)02i', '%S': '%(S)02i'} @@ -255,12 +256,16 @@ def print_files(files, fgroups=None, select_group=None, script_name=None, xslt=N 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) - 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) + params = [] + if query_string is not None: + params = urlparse.parse_qsl(query_string, keep_blank_values=True) + query_string = _u(query_string) + fquery_string = orig_query_string + fparams = [] + if fquery_string is not None: + fquery_string = filter_query_string(fquery_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") @@ -295,7 +300,8 @@ def print_files(files, fgroups=None, select_group=None, script_name=None, xslt=N for file in files: if file.dontlist: continue current_classifier = (file.group, file.break_on) - file.break_here = first or current_classifier != last_classifier + if first or current_classifier != last_classifier: + file.break_here = None last_classifier = current_classifier first = False xfile = ET.SubElement(xfiles, "file")