updated imports in tests

This commit is contained in:
ilvalle
2016-06-02 14:28:21 +02:00
parent 01bab81432
commit a1fd92b7f8
45 changed files with 182 additions and 169 deletions
+3 -2
View File
@@ -42,6 +42,7 @@ revision3.com
viddler.com
"""
from __future__ import print_function
from gluon._compat import FancyURLopener, urllib_quote
import re
import cgi
@@ -94,7 +95,7 @@ def video(url):
def googledoc_viewer(url):
return '<iframe src="https://docs.google.com/viewer?url=%s&embedded=true" style="max-width:100%%"></iframe>' % urllib.quote(url)
return '<iframe src="https://docs.google.com/viewer?url=%s&embedded=true" style="max-width:100%%"></iframe>' % urllib_quote(url)
def web2py_component(url):
@@ -136,7 +137,7 @@ EXTENSION_MAPS = {
}
class VimeoURLOpener(urllib.FancyURLopener):
class VimeoURLOpener(FancyURLopener):
"Vimeo blocks the urllib user agent for some reason"
version = "Mozilla/4.0"
urllib._urlopener = VimeoURLOpener()
+2 -2
View File
@@ -7,7 +7,7 @@ from __future__ import print_function
import re
import urllib
from cgi import escape
from string import maketrans
from gluon._compat import maketrans, urllib_quote
try:
from ast import parse as ast_parse
@@ -1418,7 +1418,7 @@ def render(text,
return '[' + ','.join('<a href="#%s" class="%s">%s</a>' %
(id_prefix + d, b, d) for d in escape(code).split(',')) + ']'
elif b == 'latex':
return LATEX % urllib.quote(code)
return LATEX % urllib_quote(code)
elif b in html_colors:
return '<span style="color: %s">%s</span>' \
% (b, render(code, {}, {}, 'br', URL, environment, latex,