pylint: add check for missing-final-newline
This commit is contained in:
parent
14ac2bac39
commit
7bce37a720
34 changed files with 34 additions and 33 deletions
|
@ -15,4 +15,4 @@ class BlobInfo(object):
|
|||
def __init__(self, blob_hash, blob_num, length):
|
||||
self.blob_hash = blob_hash
|
||||
self.blob_num = blob_num
|
||||
self.length = length
|
||||
self.length = length
|
||||
|
|
|
@ -18,4 +18,4 @@ class DownloadOption(object):
|
|||
self.long_description = long_description
|
||||
self.short_description = short_description
|
||||
self.default_value = default_value
|
||||
self.default_value_description = default_value_description
|
||||
self.default_value_description = default_value_description
|
||||
|
|
|
@ -12,4 +12,4 @@ class DummyHashAnnouncer(object):
|
|||
pass
|
||||
|
||||
def immediate_announce(self, *args):
|
||||
pass
|
||||
pass
|
||||
|
|
|
@ -59,4 +59,4 @@ class Offer(object):
|
|||
elif reply_message == Offer.RATE_UNSET:
|
||||
self.unset()
|
||||
else:
|
||||
raise Exception("Unknown offer reply %s" % str(reply_message))
|
||||
raise Exception("Unknown offer reply %s" % str(reply_message))
|
||||
|
|
|
@ -16,4 +16,4 @@ class DummyPeerFinder(object):
|
|||
return defer.succeed([])
|
||||
|
||||
def get_most_popular_hashes(self, num_to_return):
|
||||
return []
|
||||
return []
|
||||
|
|
|
@ -11,4 +11,4 @@ class PeerManager(object):
|
|||
return peer
|
||||
peer = Peer(host, port)
|
||||
self.peers.append(peer)
|
||||
return peer
|
||||
return peer
|
||||
|
|
|
@ -4,4 +4,4 @@ Classes and functions which can be used by any application wishing to make use o
|
|||
This includes classes for connecting to other peers and downloading blobs from them, listening for
|
||||
connections from peers and responding to their requests, managing locally stored blobs, sending
|
||||
and receiving payments, and locating peers in the DHT.
|
||||
"""
|
||||
"""
|
||||
|
|
|
@ -24,4 +24,4 @@ class ClientBlobRequest(ClientPaidRequest):
|
|||
self.write = write_func
|
||||
self.finished_deferred = finished_deferred
|
||||
self.cancel = cancel_func
|
||||
self.blob = blob
|
||||
self.blob = blob
|
||||
|
|
|
@ -15,4 +15,4 @@ def sign_with_pass_phrase(m, pass_phrase):
|
|||
|
||||
|
||||
def verify_signature(m, signature, pub_key):
|
||||
return seccure.verify(m, signature, pub_key, curve="brainpoolp384r1")
|
||||
return seccure.verify(m, signature, pub_key, curve="brainpoolp384r1")
|
||||
|
|
|
@ -56,4 +56,4 @@ class BlobAvailabilityHandler(object):
|
|||
def _get_available_blobs(self, requested_blobs):
|
||||
d = self.blob_manager.completed_blobs(requested_blobs)
|
||||
|
||||
return d
|
||||
return d
|
||||
|
|
|
@ -91,4 +91,4 @@ class ServerProtocolFactory(ServerFactory):
|
|||
def __init__(self, rate_limiter, query_handler_factories, peer_manager):
|
||||
self.rate_limiter = rate_limiter
|
||||
self.query_handler_factories = query_handler_factories
|
||||
self.peer_manager = peer_manager
|
||||
self.peer_manager = peer_manager
|
||||
|
|
|
@ -20,4 +20,4 @@ def rerun_if_locked(f):
|
|||
d.addErrback(rerun, *args, **kwargs)
|
||||
return d
|
||||
|
||||
return wrapper
|
||||
return wrapper
|
||||
|
|
|
@ -5,4 +5,4 @@ Crypt Streams are encrypted blobs and metadata tying those blobs together. At le
|
|||
metadata is generally stored in a Stream Descriptor File, for example containing a public key
|
||||
used to bind blobs to the stream and a symmetric key used to encrypt the blobs. The list of blobs
|
||||
may or may not be present.
|
||||
"""
|
||||
"""
|
||||
|
|
|
@ -304,4 +304,4 @@
|
|||
# info_db.commit()
|
||||
# peer_db.commit()
|
||||
# info_db.close()
|
||||
# peer_db.close()
|
||||
# peer_db.close()
|
||||
|
|
|
@ -49,4 +49,4 @@ checkRefreshInterval = refreshTimeout/5
|
|||
#: be spread accross several UDP packets.
|
||||
udpDatagramMaxSize = 8192 # 8 KB
|
||||
|
||||
key_bits = 384
|
||||
key_bits = 384
|
||||
|
|
|
@ -32,4 +32,4 @@ class HashWatcher():
|
|||
|
||||
def _remove_old_hashes(self):
|
||||
remove_time = datetime.datetime.now() - datetime.timedelta(minutes=10)
|
||||
self.hashes = [h for h in self.hashes if h[1] < remove_time]
|
||||
self.hashes = [h for h in self.hashes if h[1] < remove_time]
|
||||
|
|
|
@ -100,4 +100,4 @@ def get_hosts_for_hash_in_dht():
|
|||
|
||||
|
||||
def announce_hash_to_dht():
|
||||
run_dht_script(announce_hash)
|
||||
run_dht_script(announce_hash)
|
||||
|
|
|
@ -36,4 +36,4 @@ class EncryptedFileMetadataHandler(object):
|
|||
else:
|
||||
log.debug("Setting _final_blob_num to %s", str(blob_num - 1))
|
||||
self._final_blob_num = blob_num - 1
|
||||
return infos
|
||||
return infos
|
||||
|
|
|
@ -3,4 +3,4 @@ class EncryptedFileStatusReport(object):
|
|||
self.name = name
|
||||
self.num_completed = num_completed
|
||||
self.num_known = num_known
|
||||
self.running_status = running_status
|
||||
self.running_status = running_status
|
||||
|
|
|
@ -4,4 +4,4 @@ Classes and functions used to create and download LBRY Files.
|
|||
LBRY Files are Crypt Streams created from any regular file. The whole file is read
|
||||
at the time that the LBRY File is created, so all constituent blobs are known and
|
||||
included in the stream descriptor file.
|
||||
"""
|
||||
"""
|
||||
|
|
|
@ -21,4 +21,4 @@ class LiveStreamBlobMaker(CryptStreamBlobMaker):
|
|||
|
||||
def _return_info(self, blob_hash):
|
||||
return LiveBlobInfo(blob_hash, self.blob_num, self.length, binascii.hexlify(self.iv),
|
||||
self.revision, None)
|
||||
self.revision, None)
|
||||
|
|
|
@ -174,4 +174,4 @@ class StdinStreamProducer(object):
|
|||
self.consumer.write(data)
|
||||
|
||||
def childConnectionLost(self, fd, reason):
|
||||
self.stopProducing()
|
||||
self.stopProducing()
|
||||
|
|
|
@ -387,4 +387,4 @@ class TempLiveStreamMetadataManager(DHTHashSupplier):
|
|||
if announce_time < current_time:
|
||||
self.streams[stream_hash]['announce_time'] = next_announce_time
|
||||
stream_hashes.append(stream_hash)
|
||||
return stream_hashes
|
||||
return stream_hashes
|
||||
|
|
|
@ -135,4 +135,4 @@ class LiveStreamDescriptorValidator(object):
|
|||
return info
|
||||
|
||||
def get_length_of_stream(self):
|
||||
return None
|
||||
return None
|
||||
|
|
|
@ -344,4 +344,4 @@ class LiveStreamMetadataHandler(object):
|
|||
peer.update_score(-10.0)
|
||||
if reason.check(ConnectionClosedBeforeResponseError):
|
||||
return
|
||||
return reason
|
||||
return reason
|
||||
|
|
|
@ -71,4 +71,4 @@ class LiveStreamOptions(object):
|
|||
"Allow"
|
||||
),
|
||||
]
|
||||
return options
|
||||
return options
|
||||
|
|
|
@ -88,4 +88,4 @@ class LiveStreamProgressManager(StreamProgressManager):
|
|||
reactor.callLater(0, self._output_loop)
|
||||
else:
|
||||
self.outputting_d.callback(True)
|
||||
self.outputting_d = None
|
||||
self.outputting_d = None
|
||||
|
|
|
@ -181,4 +181,4 @@ class CryptBlobInfoQueryHandler(object):
|
|||
|
||||
dl.addCallback(ensure_streams_match)
|
||||
dl.addCallback(lambda _: get_blob_infos())
|
||||
return dl
|
||||
return dl
|
||||
|
|
|
@ -64,4 +64,4 @@ def create_auth_session(root):
|
|||
portal_to_realm = portal.Portal(realm, [checker, ])
|
||||
factory = guard.BasicCredentialFactory('Login to lbrynet api')
|
||||
_lbrynet_server = guard.HTTPAuthSessionWrapper(portal_to_realm, [factory, ])
|
||||
return _lbrynet_server
|
||||
return _lbrynet_server
|
||||
|
|
|
@ -89,4 +89,4 @@ def initialize_api_key_file(key_path):
|
|||
|
||||
|
||||
def get_auth_message(message_dict):
|
||||
return json.dumps(message_dict, sort_keys=True)
|
||||
return json.dumps(message_dict, sort_keys=True)
|
||||
|
|
|
@ -65,4 +65,4 @@ class Autofetcher(object):
|
|||
|
||||
def run(api):
|
||||
fetcher = Autofetcher(api)
|
||||
fetcher.start()
|
||||
fetcher.start()
|
||||
|
|
|
@ -7,4 +7,4 @@ registering. The public key is used to spend points, and also used as an address
|
|||
are sent. To spend points, the public key signs a message containing the amount and the destination
|
||||
public key and sends it to the point trader server. To check for payments, the recipient sends a
|
||||
signed message asking the point trader server for its balance.
|
||||
"""
|
||||
"""
|
||||
|
|
|
@ -9,4 +9,5 @@ pylint -E --disable=inherit-non-class --disable=no-member \
|
|||
--enable=bad-whitespace \
|
||||
--enable=line-too-long \
|
||||
--enable=trailing-whitespace \
|
||||
--enable=missing-final-newline \
|
||||
lbrynet $@
|
||||
|
|
|
@ -239,4 +239,4 @@ def suite():
|
|||
|
||||
if __name__ == '__main__':
|
||||
# If this module is executed from the commandline, run all its tests
|
||||
unittest.TextTestRunner().run(suite())
|
||||
unittest.TextTestRunner().run(suite())
|
||||
|
|
Loading…
Reference in a new issue