mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-10 04:09:58 +00:00
Port to Python 3.
This commit is contained in:
parent
0de48ba5b2
commit
d0bdf1fc8a
@ -119,6 +119,7 @@ PORTED_MODULES = [
|
||||
"allmydata.web.common",
|
||||
"allmydata.web.directory",
|
||||
"allmydata.web.logs",
|
||||
"allmydata.web.operations",
|
||||
"allmydata.webish",
|
||||
]
|
||||
|
||||
|
@ -1,4 +1,14 @@
|
||||
from past.builtins import unicode
|
||||
"""
|
||||
Ported to Python 3.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from future.utils import PY2
|
||||
if PY2:
|
||||
from future.builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, bytes, dict, list, object, range, str, max, min # noqa: F401
|
||||
|
||||
import time
|
||||
from hyperlink import (
|
||||
@ -91,7 +101,7 @@ class OphandleTable(resource.Resource, service.Service):
|
||||
"""
|
||||
ophandle = get_arg(req, "ophandle").decode("utf-8")
|
||||
assert ophandle
|
||||
here = DecodedURL.from_text(unicode(URLPath.fromRequest(req)))
|
||||
here = DecodedURL.from_text(str(URLPath.fromRequest(req)))
|
||||
target = here.click(u"/").child(u"operations", ophandle)
|
||||
output = get_arg(req, "output")
|
||||
if output:
|
||||
@ -102,7 +112,7 @@ class OphandleTable(resource.Resource, service.Service):
|
||||
def getChild(self, name, req):
|
||||
ophandle = name
|
||||
if ophandle not in self.handles:
|
||||
raise WebError("unknown/expired handle '%s'" % escape(unicode(ophandle, "utf-8")),
|
||||
raise WebError("unknown/expired handle '%s'" % escape(str(ophandle, "utf-8")),
|
||||
NOT_FOUND)
|
||||
(monitor, renderer, when_added) = self.handles[ophandle]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user