mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-21 10:01:54 +00:00
Merge pull request #838 from tahoe-lafs/3452.immutable-downloader-more-python-3
Port more of allmydata.immutable.downloader to Python 3 Fixes ticket:3452
This commit is contained in:
commit
6fcec69435
0
newsfragments/3452.minor
Normal file
0
newsfragments/3452.minor
Normal file
@ -0,0 +1,13 @@
|
||||
"""
|
||||
Ported to Python 3.
|
||||
"""
|
||||
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
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
|
||||
|
@ -1,3 +1,15 @@
|
||||
"""
|
||||
Ported to Python 3.
|
||||
"""
|
||||
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
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
|
||||
|
||||
(AVAILABLE, PENDING, OVERDUE, COMPLETE, CORRUPT, DEAD, BADSEGNUM) = \
|
||||
("AVAILABLE", "PENDING", "OVERDUE", "COMPLETE", "CORRUPT", "DEAD", "BADSEGNUM")
|
||||
|
@ -1,3 +1,14 @@
|
||||
"""
|
||||
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
|
||||
now = time.time
|
||||
|
@ -1,3 +1,14 @@
|
||||
"""
|
||||
Ported to Python 3.
|
||||
"""
|
||||
from __future__ import division
|
||||
from __future__ import absolute_import
|
||||
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 itertools
|
||||
from zope.interface import implementer
|
||||
@ -9,8 +20,8 @@ class ReadEvent(object):
|
||||
self._ev = ev
|
||||
self._ds = ds
|
||||
|
||||
def update(self, bytes, decrypttime, pausetime):
|
||||
self._ev["bytes_returned"] += bytes
|
||||
def update(self, bytes_returned, decrypttime, pausetime):
|
||||
self._ev["bytes_returned"] += bytes_returned
|
||||
self._ev["decrypt_time"] += decrypttime
|
||||
self._ev["paused_time"] += pausetime
|
||||
|
||||
@ -257,7 +268,7 @@ class DownloadStatus(object):
|
||||
# else ignore completed requests
|
||||
if not total_outstanding:
|
||||
return 1.0
|
||||
return 1.0 * total_received / total_outstanding
|
||||
return total_received / total_outstanding
|
||||
|
||||
def using_helper(self):
|
||||
return False
|
||||
|
@ -32,9 +32,13 @@ PORTED_MODULES = [
|
||||
"allmydata.crypto.rsa",
|
||||
"allmydata.crypto.util",
|
||||
"allmydata.hashtree",
|
||||
"allmydata.immutable.downloader",
|
||||
"allmydata.immutable.downloader.common",
|
||||
"allmydata.immutable.downloader.fetcher",
|
||||
"allmydata.immutable.downloader.finder",
|
||||
"allmydata.immutable.downloader.node",
|
||||
"allmydata.immutable.downloader.segmentation",
|
||||
"allmydata.immutable.downloader.status",
|
||||
"allmydata.immutable.happiness_upload",
|
||||
"allmydata.immutable.literal",
|
||||
"allmydata.interfaces",
|
||||
|
Loading…
x
Reference in New Issue
Block a user