pylint: add check for missing-final-newline

This commit is contained in:
Job Evers-Meltzer 2016-12-13 17:16:12 -06:00
parent 14ac2bac39
commit 7bce37a720
34 changed files with 34 additions and 33 deletions

View file

@ -15,4 +15,4 @@ class BlobInfo(object):
def __init__(self, blob_hash, blob_num, length): def __init__(self, blob_hash, blob_num, length):
self.blob_hash = blob_hash self.blob_hash = blob_hash
self.blob_num = blob_num self.blob_num = blob_num
self.length = length self.length = length

View file

@ -18,4 +18,4 @@ class DownloadOption(object):
self.long_description = long_description self.long_description = long_description
self.short_description = short_description self.short_description = short_description
self.default_value = default_value self.default_value = default_value
self.default_value_description = default_value_description self.default_value_description = default_value_description

View file

@ -12,4 +12,4 @@ class DummyHashAnnouncer(object):
pass pass
def immediate_announce(self, *args): def immediate_announce(self, *args):
pass pass

View file

@ -59,4 +59,4 @@ class Offer(object):
elif reply_message == Offer.RATE_UNSET: elif reply_message == Offer.RATE_UNSET:
self.unset() self.unset()
else: else:
raise Exception("Unknown offer reply %s" % str(reply_message)) raise Exception("Unknown offer reply %s" % str(reply_message))

View file

@ -16,4 +16,4 @@ class DummyPeerFinder(object):
return defer.succeed([]) return defer.succeed([])
def get_most_popular_hashes(self, num_to_return): def get_most_popular_hashes(self, num_to_return):
return [] return []

View file

@ -11,4 +11,4 @@ class PeerManager(object):
return peer return peer
peer = Peer(host, port) peer = Peer(host, port)
self.peers.append(peer) self.peers.append(peer)
return peer return peer

View file

@ -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 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 connections from peers and responding to their requests, managing locally stored blobs, sending
and receiving payments, and locating peers in the DHT. and receiving payments, and locating peers in the DHT.
""" """

View file

@ -24,4 +24,4 @@ class ClientBlobRequest(ClientPaidRequest):
self.write = write_func self.write = write_func
self.finished_deferred = finished_deferred self.finished_deferred = finished_deferred
self.cancel = cancel_func self.cancel = cancel_func
self.blob = blob self.blob = blob

View file

@ -15,4 +15,4 @@ def sign_with_pass_phrase(m, pass_phrase):
def verify_signature(m, signature, pub_key): 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")

View file

@ -56,4 +56,4 @@ class BlobAvailabilityHandler(object):
def _get_available_blobs(self, requested_blobs): def _get_available_blobs(self, requested_blobs):
d = self.blob_manager.completed_blobs(requested_blobs) d = self.blob_manager.completed_blobs(requested_blobs)
return d return d

View file

@ -91,4 +91,4 @@ class ServerProtocolFactory(ServerFactory):
def __init__(self, rate_limiter, query_handler_factories, peer_manager): def __init__(self, rate_limiter, query_handler_factories, peer_manager):
self.rate_limiter = rate_limiter self.rate_limiter = rate_limiter
self.query_handler_factories = query_handler_factories self.query_handler_factories = query_handler_factories
self.peer_manager = peer_manager self.peer_manager = peer_manager

View file

@ -20,4 +20,4 @@ def rerun_if_locked(f):
d.addErrback(rerun, *args, **kwargs) d.addErrback(rerun, *args, **kwargs)
return d return d
return wrapper return wrapper

View file

@ -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 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 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. may or may not be present.
""" """

View file

@ -304,4 +304,4 @@
# info_db.commit() # info_db.commit()
# peer_db.commit() # peer_db.commit()
# info_db.close() # info_db.close()
# peer_db.close() # peer_db.close()

View file

@ -49,4 +49,4 @@ checkRefreshInterval = refreshTimeout/5
#: be spread accross several UDP packets. #: be spread accross several UDP packets.
udpDatagramMaxSize = 8192 # 8 KB udpDatagramMaxSize = 8192 # 8 KB
key_bits = 384 key_bits = 384

View file

@ -32,4 +32,4 @@ class HashWatcher():
def _remove_old_hashes(self): def _remove_old_hashes(self):
remove_time = datetime.datetime.now() - datetime.timedelta(minutes=10) 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]

View file

@ -100,4 +100,4 @@ def get_hosts_for_hash_in_dht():
def announce_hash_to_dht(): def announce_hash_to_dht():
run_dht_script(announce_hash) run_dht_script(announce_hash)

View file

@ -36,4 +36,4 @@ class EncryptedFileMetadataHandler(object):
else: else:
log.debug("Setting _final_blob_num to %s", str(blob_num - 1)) log.debug("Setting _final_blob_num to %s", str(blob_num - 1))
self._final_blob_num = blob_num - 1 self._final_blob_num = blob_num - 1
return infos return infos

View file

@ -3,4 +3,4 @@ class EncryptedFileStatusReport(object):
self.name = name self.name = name
self.num_completed = num_completed self.num_completed = num_completed
self.num_known = num_known self.num_known = num_known
self.running_status = running_status self.running_status = running_status

View file

@ -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 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 at the time that the LBRY File is created, so all constituent blobs are known and
included in the stream descriptor file. included in the stream descriptor file.
""" """

View file

@ -21,4 +21,4 @@ class LiveStreamBlobMaker(CryptStreamBlobMaker):
def _return_info(self, blob_hash): def _return_info(self, blob_hash):
return LiveBlobInfo(blob_hash, self.blob_num, self.length, binascii.hexlify(self.iv), return LiveBlobInfo(blob_hash, self.blob_num, self.length, binascii.hexlify(self.iv),
self.revision, None) self.revision, None)

View file

@ -174,4 +174,4 @@ class StdinStreamProducer(object):
self.consumer.write(data) self.consumer.write(data)
def childConnectionLost(self, fd, reason): def childConnectionLost(self, fd, reason):
self.stopProducing() self.stopProducing()

View file

@ -387,4 +387,4 @@ class TempLiveStreamMetadataManager(DHTHashSupplier):
if announce_time < current_time: if announce_time < current_time:
self.streams[stream_hash]['announce_time'] = next_announce_time self.streams[stream_hash]['announce_time'] = next_announce_time
stream_hashes.append(stream_hash) stream_hashes.append(stream_hash)
return stream_hashes return stream_hashes

View file

@ -135,4 +135,4 @@ class LiveStreamDescriptorValidator(object):
return info return info
def get_length_of_stream(self): def get_length_of_stream(self):
return None return None

View file

@ -344,4 +344,4 @@ class LiveStreamMetadataHandler(object):
peer.update_score(-10.0) peer.update_score(-10.0)
if reason.check(ConnectionClosedBeforeResponseError): if reason.check(ConnectionClosedBeforeResponseError):
return return
return reason return reason

View file

@ -71,4 +71,4 @@ class LiveStreamOptions(object):
"Allow" "Allow"
), ),
] ]
return options return options

View file

@ -88,4 +88,4 @@ class LiveStreamProgressManager(StreamProgressManager):
reactor.callLater(0, self._output_loop) reactor.callLater(0, self._output_loop)
else: else:
self.outputting_d.callback(True) self.outputting_d.callback(True)
self.outputting_d = None self.outputting_d = None

View file

@ -181,4 +181,4 @@ class CryptBlobInfoQueryHandler(object):
dl.addCallback(ensure_streams_match) dl.addCallback(ensure_streams_match)
dl.addCallback(lambda _: get_blob_infos()) dl.addCallback(lambda _: get_blob_infos())
return dl return dl

View file

@ -64,4 +64,4 @@ def create_auth_session(root):
portal_to_realm = portal.Portal(realm, [checker, ]) portal_to_realm = portal.Portal(realm, [checker, ])
factory = guard.BasicCredentialFactory('Login to lbrynet api') factory = guard.BasicCredentialFactory('Login to lbrynet api')
_lbrynet_server = guard.HTTPAuthSessionWrapper(portal_to_realm, [factory, ]) _lbrynet_server = guard.HTTPAuthSessionWrapper(portal_to_realm, [factory, ])
return _lbrynet_server return _lbrynet_server

View file

@ -89,4 +89,4 @@ def initialize_api_key_file(key_path):
def get_auth_message(message_dict): def get_auth_message(message_dict):
return json.dumps(message_dict, sort_keys=True) return json.dumps(message_dict, sort_keys=True)

View file

@ -65,4 +65,4 @@ class Autofetcher(object):
def run(api): def run(api):
fetcher = Autofetcher(api) fetcher = Autofetcher(api)
fetcher.start() fetcher.start()

View file

@ -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 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 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. signed message asking the point trader server for its balance.
""" """

View file

@ -9,4 +9,5 @@ pylint -E --disable=inherit-non-class --disable=no-member \
--enable=bad-whitespace \ --enable=bad-whitespace \
--enable=line-too-long \ --enable=line-too-long \
--enable=trailing-whitespace \ --enable=trailing-whitespace \
--enable=missing-final-newline \
lbrynet $@ lbrynet $@

View file

@ -239,4 +239,4 @@ def suite():
if __name__ == '__main__': if __name__ == '__main__':
# If this module is executed from the commandline, run all its tests # If this module is executed from the commandline, run all its tests
unittest.TextTestRunner().run(suite()) unittest.TextTestRunner().run(suite())