[FIX] _extensions: p3 compatibility (4)
This commit is contained in:
parent
32b30c9579
commit
1dcc9b8b0a
@ -1,7 +1,12 @@
|
|||||||
import collections
|
import collections
|
||||||
import threading
|
import threading
|
||||||
import urllib
|
import werkzeug
|
||||||
import xmlrpclib
|
|
||||||
|
try:
|
||||||
|
import xmlrpclib
|
||||||
|
except ImportError:
|
||||||
|
# P3
|
||||||
|
import xmlrpc.client as xmlrpclib
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import Queue
|
import Queue
|
||||||
@ -94,7 +99,7 @@ class Action(Directive):
|
|||||||
external_id = self.arguments[0]
|
external_id = self.arguments[0]
|
||||||
text = "action button"
|
text = "action button"
|
||||||
node = nodes.reference(
|
node = nodes.reference(
|
||||||
refuri='https://demo.odoo.com?{}'.format(urllib.urlencode({
|
refuri='https://demo.odoo.com?{}'.format(werkzeug.urls.url_encode({
|
||||||
'module': external_id
|
'module': external_id
|
||||||
})),
|
})),
|
||||||
classes=['btn', 'btn-primary', 'btn-lg', 'btn-block', 'center-block']
|
classes=['btn', 'btn-primary', 'btn-lg', 'btn-block', 'center-block']
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import inspect
|
import inspect
|
||||||
import importlib
|
import importlib
|
||||||
import os.path
|
import os.path
|
||||||
from urlparse import urlunsplit
|
import werkzeug
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
* adds github_link(mode) context variable: provides URL (in relevant mode) of
|
* adds github_link(mode) context variable: provides URL (in relevant mode) of
|
||||||
@ -81,7 +82,7 @@ def make_github_link(app, path, line=None, mode="blob"):
|
|||||||
path=path,
|
path=path,
|
||||||
mode=mode,
|
mode=mode,
|
||||||
)
|
)
|
||||||
return urlunsplit((
|
return werkzeug.urls.url_unparse((
|
||||||
'https',
|
'https',
|
||||||
'github.com',
|
'github.com',
|
||||||
urlpath,
|
urlpath,
|
||||||
|
Loading…
Reference in New Issue
Block a user