PY3&PY2 thing
This commit is contained in:
@@ -4,12 +4,14 @@ import logging
|
|||||||
import re
|
import re
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
|
from future.backports.http.cookies import SimpleCookie
|
||||||
|
import six
|
||||||
|
|
||||||
from saml2.extension.pefim import SPCertEnc
|
from saml2.extension.pefim import SPCertEnc
|
||||||
from saml2.metadata import create_metadata_string
|
from saml2.metadata import create_metadata_string
|
||||||
import service_conf
|
import service_conf
|
||||||
|
|
||||||
from Cookie import SimpleCookie
|
from six.moves.urllib.parse import parse_qs
|
||||||
from urlparse import parse_qs
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from saml2 import BINDING_HTTP_REDIRECT, element_to_extension_element
|
from saml2 import BINDING_HTTP_REDIRECT, element_to_extension_element
|
||||||
@@ -59,7 +61,7 @@ def dict_to_table(ava, lev=0, width=1):
|
|||||||
txt = ['<table border=%s bordercolor="black">\n' % width]
|
txt = ['<table border=%s bordercolor="black">\n' % width]
|
||||||
for prop, valarr in ava.items():
|
for prop, valarr in ava.items():
|
||||||
txt.append("<tr>\n")
|
txt.append("<tr>\n")
|
||||||
if isinstance(valarr, basestring):
|
if isinstance(valarr, six.string_types):
|
||||||
txt.append("<th>%s</th>\n" % str(prop))
|
txt.append("<th>%s</th>\n" % str(prop))
|
||||||
try:
|
try:
|
||||||
txt.append("<td>%s</td>\n" % valarr.encode("utf8"))
|
txt.append("<td>%s</td>\n" % valarr.encode("utf8"))
|
||||||
|
Reference in New Issue
Block a user