whitespace

This commit is contained in:
Jack Robison 2018-02-12 14:16:43 -05:00
parent 9d539aaa16
commit e9b9118c2a
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
5 changed files with 17 additions and 15 deletions

View file

@ -12,6 +12,7 @@ log = logging.getLogger(__name__)
MAX_BLOB_SIZE = 2 * 2 ** 20
class BlobFile(object):
"""
A chunk of data available on the network which is specified by a hashsum

View file

@ -16,3 +16,4 @@ class BlobInfo(object):
self.blob_hash = blob_hash
self.blob_num = blob_num
self.length = length

View file

@ -233,11 +233,13 @@ class Session(object):
# best not to rely on this external ip, the router can be behind layers of NATs
self.external_ip = external_ip
if self.peer_port:
self.upnp_redirects.append(get_port_mapping(u, self.peer_port, 'TCP',
'LBRY peer port'))
self.upnp_redirects.append(
get_port_mapping(u, self.peer_port, 'TCP', 'LBRY peer port')
)
if self.dht_node_port:
self.upnp_redirects.append(get_port_mapping(u, self.dht_node_port, 'UDP',
'LBRY DHT port'))
self.upnp_redirects.append(
get_port_mapping(u, self.dht_node_port, 'UDP', 'LBRY DHT port')
)
return True
return False
@ -320,14 +322,13 @@ class Session(object):
)
if self.blob_tracker is None:
self.blob_tracker = self.blob_tracker_class(self.blob_manager,
self.peer_finder,
self.dht_node)
self.blob_tracker = self.blob_tracker_class(
self.blob_manager, self.peer_finder, self.dht_node
)
if self.payment_rate_manager is None:
self.payment_rate_manager = self.payment_rate_manager_class(
self.base_payment_rate_manager,
self.blob_tracker,
self.is_generous)
self.base_payment_rate_manager, self.blob_tracker, self.is_generous
)
self.rate_limiter.start()
d = self.storage.setup()

View file

@ -128,7 +128,6 @@ class CryptStreamCreator(object):
d.addCallback(self._blob_finished)
self.finished_deferreds.append(d)
def _write(self, data):
while len(data) > 0:
if self.current_blob is None:

View file

@ -1,11 +1,11 @@
from lbrynet.lbry_file.StreamDescriptor import EncryptedFileStreamType
from lbrynet.lbry_file.StreamDescriptor import EncryptedFileStreamDescriptorValidator
from lbrynet.core.StreamDescriptor import EncryptedFileStreamType
from lbrynet.core.StreamDescriptor import EncryptedFileStreamDescriptorValidator
from lbrynet.core.DownloadOption import DownloadOption, DownloadOptionChoice
def add_lbry_file_to_sd_identifier(sd_identifier):
sd_identifier.add_stream_type(
EncryptedFileStreamType, EncryptedFileStreamDescriptorValidator, EncryptedFileOptions())
sd_identifier.add_stream_type(EncryptedFileStreamType, EncryptedFileStreamDescriptorValidator,
EncryptedFileOptions())
class EncryptedFileOptions(object):