From 7bce37a720d20f2620a0826fedbd5f2c27bca640 Mon Sep 17 00:00:00 2001 From: Job Evers-Meltzer Date: Tue, 13 Dec 2016 17:16:12 -0600 Subject: [PATCH] pylint: add check for missing-final-newline --- lbrynet/core/BlobInfo.py | 2 +- lbrynet/core/DownloadOption.py | 2 +- lbrynet/core/HashAnnouncer.py | 2 +- lbrynet/core/Offer.py | 2 +- lbrynet/core/PeerFinder.py | 2 +- lbrynet/core/PeerManager.py | 2 +- lbrynet/core/__init__.py | 2 +- lbrynet/core/client/ClientRequest.py | 2 +- lbrynet/core/cryptoutils.py | 2 +- lbrynet/core/server/BlobAvailabilityHandler.py | 2 +- lbrynet/core/server/ServerProtocol.py | 2 +- lbrynet/core/sqlite_helpers.py | 2 +- lbrynet/cryptstream/__init__.py | 2 +- lbrynet/db_migrator/migrate0to1.py | 2 +- lbrynet/dht/constants.py | 2 +- lbrynet/dht/hashwatcher.py | 2 +- lbrynet/dht_scripts.py | 2 +- lbrynet/lbryfile/client/EncryptedFileMetadataHandler.py | 2 +- lbrynet/lbryfilemanager/EncryptedFileStatusReport.py | 2 +- lbrynet/lbryfilemanager/__init__.py | 2 +- lbrynet/lbrylive/LiveBlob.py | 2 +- lbrynet/lbrylive/LiveStreamCreator.py | 2 +- lbrynet/lbrylive/LiveStreamMetadataManager.py | 2 +- lbrynet/lbrylive/StreamDescriptor.py | 2 +- lbrynet/lbrylive/client/LiveStreamMetadataHandler.py | 2 +- lbrynet/lbrylive/client/LiveStreamOptions.py | 2 +- lbrynet/lbrylive/client/LiveStreamProgressManager.py | 2 +- lbrynet/lbrylive/server/LiveBlobInfoQueryHandler.py | 2 +- lbrynet/lbrynet_daemon/DaemonServer.py | 2 +- lbrynet/lbrynet_daemon/auth/util.py | 2 +- lbrynet/lbrynet_daemon/daemon_scripts/Autofetcher.py | 2 +- lbrynet/pointtraderclient/__init__.py | 2 +- run_pylint.sh | 1 + tests/dht/testProtocol.py | 2 +- 34 files changed, 34 insertions(+), 33 deletions(-) diff --git a/lbrynet/core/BlobInfo.py b/lbrynet/core/BlobInfo.py index d0e66c641..19fe72253 100644 --- a/lbrynet/core/BlobInfo.py +++ b/lbrynet/core/BlobInfo.py @@ -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 \ No newline at end of file + self.length = length diff --git a/lbrynet/core/DownloadOption.py b/lbrynet/core/DownloadOption.py index 87964fa46..6a4446b20 100644 --- a/lbrynet/core/DownloadOption.py +++ b/lbrynet/core/DownloadOption.py @@ -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 \ No newline at end of file + self.default_value_description = default_value_description diff --git a/lbrynet/core/HashAnnouncer.py b/lbrynet/core/HashAnnouncer.py index dd0efaf54..841f685b6 100644 --- a/lbrynet/core/HashAnnouncer.py +++ b/lbrynet/core/HashAnnouncer.py @@ -12,4 +12,4 @@ class DummyHashAnnouncer(object): pass def immediate_announce(self, *args): - pass \ No newline at end of file + pass diff --git a/lbrynet/core/Offer.py b/lbrynet/core/Offer.py index 48b4b56fa..fb4641d57 100644 --- a/lbrynet/core/Offer.py +++ b/lbrynet/core/Offer.py @@ -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)) \ No newline at end of file + raise Exception("Unknown offer reply %s" % str(reply_message)) diff --git a/lbrynet/core/PeerFinder.py b/lbrynet/core/PeerFinder.py index 461d1804e..3f2339de2 100644 --- a/lbrynet/core/PeerFinder.py +++ b/lbrynet/core/PeerFinder.py @@ -16,4 +16,4 @@ class DummyPeerFinder(object): return defer.succeed([]) def get_most_popular_hashes(self, num_to_return): - return [] \ No newline at end of file + return [] diff --git a/lbrynet/core/PeerManager.py b/lbrynet/core/PeerManager.py index bf83d3e1f..1c5816158 100644 --- a/lbrynet/core/PeerManager.py +++ b/lbrynet/core/PeerManager.py @@ -11,4 +11,4 @@ class PeerManager(object): return peer peer = Peer(host, port) self.peers.append(peer) - return peer \ No newline at end of file + return peer diff --git a/lbrynet/core/__init__.py b/lbrynet/core/__init__.py index 2dff7714f..6ac1f3432 100644 --- a/lbrynet/core/__init__.py +++ b/lbrynet/core/__init__.py @@ -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. -""" \ No newline at end of file +""" diff --git a/lbrynet/core/client/ClientRequest.py b/lbrynet/core/client/ClientRequest.py index 106982ccc..6dcd89455 100644 --- a/lbrynet/core/client/ClientRequest.py +++ b/lbrynet/core/client/ClientRequest.py @@ -24,4 +24,4 @@ class ClientBlobRequest(ClientPaidRequest): self.write = write_func self.finished_deferred = finished_deferred self.cancel = cancel_func - self.blob = blob \ No newline at end of file + self.blob = blob diff --git a/lbrynet/core/cryptoutils.py b/lbrynet/core/cryptoutils.py index d77013c92..7c0c5c40c 100644 --- a/lbrynet/core/cryptoutils.py +++ b/lbrynet/core/cryptoutils.py @@ -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") \ No newline at end of file + return seccure.verify(m, signature, pub_key, curve="brainpoolp384r1") diff --git a/lbrynet/core/server/BlobAvailabilityHandler.py b/lbrynet/core/server/BlobAvailabilityHandler.py index dbd373a36..e8530d612 100644 --- a/lbrynet/core/server/BlobAvailabilityHandler.py +++ b/lbrynet/core/server/BlobAvailabilityHandler.py @@ -56,4 +56,4 @@ class BlobAvailabilityHandler(object): def _get_available_blobs(self, requested_blobs): d = self.blob_manager.completed_blobs(requested_blobs) - return d \ No newline at end of file + return d diff --git a/lbrynet/core/server/ServerProtocol.py b/lbrynet/core/server/ServerProtocol.py index 42043779b..df52dedb0 100644 --- a/lbrynet/core/server/ServerProtocol.py +++ b/lbrynet/core/server/ServerProtocol.py @@ -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 \ No newline at end of file + self.peer_manager = peer_manager diff --git a/lbrynet/core/sqlite_helpers.py b/lbrynet/core/sqlite_helpers.py index c75e7ae48..14d81d716 100644 --- a/lbrynet/core/sqlite_helpers.py +++ b/lbrynet/core/sqlite_helpers.py @@ -20,4 +20,4 @@ def rerun_if_locked(f): d.addErrback(rerun, *args, **kwargs) return d - return wrapper \ No newline at end of file + return wrapper diff --git a/lbrynet/cryptstream/__init__.py b/lbrynet/cryptstream/__init__.py index df825f573..ff8842a67 100644 --- a/lbrynet/cryptstream/__init__.py +++ b/lbrynet/cryptstream/__init__.py @@ -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. -""" \ No newline at end of file +""" diff --git a/lbrynet/db_migrator/migrate0to1.py b/lbrynet/db_migrator/migrate0to1.py index 21edef1f6..562137ea5 100644 --- a/lbrynet/db_migrator/migrate0to1.py +++ b/lbrynet/db_migrator/migrate0to1.py @@ -304,4 +304,4 @@ # info_db.commit() # peer_db.commit() # info_db.close() -# peer_db.close() \ No newline at end of file +# peer_db.close() diff --git a/lbrynet/dht/constants.py b/lbrynet/dht/constants.py index d2e21bcae..9c1119546 100644 --- a/lbrynet/dht/constants.py +++ b/lbrynet/dht/constants.py @@ -49,4 +49,4 @@ checkRefreshInterval = refreshTimeout/5 #: be spread accross several UDP packets. udpDatagramMaxSize = 8192 # 8 KB -key_bits = 384 \ No newline at end of file +key_bits = 384 diff --git a/lbrynet/dht/hashwatcher.py b/lbrynet/dht/hashwatcher.py index fbe37202a..f7270eea2 100644 --- a/lbrynet/dht/hashwatcher.py +++ b/lbrynet/dht/hashwatcher.py @@ -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] \ No newline at end of file + self.hashes = [h for h in self.hashes if h[1] < remove_time] diff --git a/lbrynet/dht_scripts.py b/lbrynet/dht_scripts.py index 7d6dec167..dc8709015 100644 --- a/lbrynet/dht_scripts.py +++ b/lbrynet/dht_scripts.py @@ -100,4 +100,4 @@ def get_hosts_for_hash_in_dht(): def announce_hash_to_dht(): - run_dht_script(announce_hash) \ No newline at end of file + run_dht_script(announce_hash) diff --git a/lbrynet/lbryfile/client/EncryptedFileMetadataHandler.py b/lbrynet/lbryfile/client/EncryptedFileMetadataHandler.py index 1444a61a3..bd09dfdfc 100644 --- a/lbrynet/lbryfile/client/EncryptedFileMetadataHandler.py +++ b/lbrynet/lbryfile/client/EncryptedFileMetadataHandler.py @@ -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 \ No newline at end of file + return infos diff --git a/lbrynet/lbryfilemanager/EncryptedFileStatusReport.py b/lbrynet/lbryfilemanager/EncryptedFileStatusReport.py index 2062c5ff7..61d61a2a3 100644 --- a/lbrynet/lbryfilemanager/EncryptedFileStatusReport.py +++ b/lbrynet/lbryfilemanager/EncryptedFileStatusReport.py @@ -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 \ No newline at end of file + self.running_status = running_status diff --git a/lbrynet/lbryfilemanager/__init__.py b/lbrynet/lbryfilemanager/__init__.py index 6f2017173..e41afc21b 100644 --- a/lbrynet/lbryfilemanager/__init__.py +++ b/lbrynet/lbryfilemanager/__init__.py @@ -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. -""" \ No newline at end of file +""" diff --git a/lbrynet/lbrylive/LiveBlob.py b/lbrynet/lbrylive/LiveBlob.py index e1e5448a7..46bf54f7a 100644 --- a/lbrynet/lbrylive/LiveBlob.py +++ b/lbrynet/lbrylive/LiveBlob.py @@ -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) \ No newline at end of file + self.revision, None) diff --git a/lbrynet/lbrylive/LiveStreamCreator.py b/lbrynet/lbrylive/LiveStreamCreator.py index 393c2fda0..169f4668d 100644 --- a/lbrynet/lbrylive/LiveStreamCreator.py +++ b/lbrynet/lbrylive/LiveStreamCreator.py @@ -174,4 +174,4 @@ class StdinStreamProducer(object): self.consumer.write(data) def childConnectionLost(self, fd, reason): - self.stopProducing() \ No newline at end of file + self.stopProducing() diff --git a/lbrynet/lbrylive/LiveStreamMetadataManager.py b/lbrynet/lbrylive/LiveStreamMetadataManager.py index b7591a7ce..76bb6f906 100644 --- a/lbrynet/lbrylive/LiveStreamMetadataManager.py +++ b/lbrynet/lbrylive/LiveStreamMetadataManager.py @@ -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 \ No newline at end of file + return stream_hashes diff --git a/lbrynet/lbrylive/StreamDescriptor.py b/lbrynet/lbrylive/StreamDescriptor.py index f9e2b496e..1977c263c 100644 --- a/lbrynet/lbrylive/StreamDescriptor.py +++ b/lbrynet/lbrylive/StreamDescriptor.py @@ -135,4 +135,4 @@ class LiveStreamDescriptorValidator(object): return info def get_length_of_stream(self): - return None \ No newline at end of file + return None diff --git a/lbrynet/lbrylive/client/LiveStreamMetadataHandler.py b/lbrynet/lbrylive/client/LiveStreamMetadataHandler.py index 2a5dcc40e..d3856898d 100644 --- a/lbrynet/lbrylive/client/LiveStreamMetadataHandler.py +++ b/lbrynet/lbrylive/client/LiveStreamMetadataHandler.py @@ -344,4 +344,4 @@ class LiveStreamMetadataHandler(object): peer.update_score(-10.0) if reason.check(ConnectionClosedBeforeResponseError): return - return reason \ No newline at end of file + return reason diff --git a/lbrynet/lbrylive/client/LiveStreamOptions.py b/lbrynet/lbrylive/client/LiveStreamOptions.py index 4b57bd5fb..21961c746 100644 --- a/lbrynet/lbrylive/client/LiveStreamOptions.py +++ b/lbrynet/lbrylive/client/LiveStreamOptions.py @@ -71,4 +71,4 @@ class LiveStreamOptions(object): "Allow" ), ] - return options \ No newline at end of file + return options diff --git a/lbrynet/lbrylive/client/LiveStreamProgressManager.py b/lbrynet/lbrylive/client/LiveStreamProgressManager.py index ac277ed76..2869ada61 100644 --- a/lbrynet/lbrylive/client/LiveStreamProgressManager.py +++ b/lbrynet/lbrylive/client/LiveStreamProgressManager.py @@ -88,4 +88,4 @@ class LiveStreamProgressManager(StreamProgressManager): reactor.callLater(0, self._output_loop) else: self.outputting_d.callback(True) - self.outputting_d = None \ No newline at end of file + self.outputting_d = None diff --git a/lbrynet/lbrylive/server/LiveBlobInfoQueryHandler.py b/lbrynet/lbrylive/server/LiveBlobInfoQueryHandler.py index c2fc47277..2fce90b6b 100644 --- a/lbrynet/lbrylive/server/LiveBlobInfoQueryHandler.py +++ b/lbrynet/lbrylive/server/LiveBlobInfoQueryHandler.py @@ -181,4 +181,4 @@ class CryptBlobInfoQueryHandler(object): dl.addCallback(ensure_streams_match) dl.addCallback(lambda _: get_blob_infos()) - return dl \ No newline at end of file + return dl diff --git a/lbrynet/lbrynet_daemon/DaemonServer.py b/lbrynet/lbrynet_daemon/DaemonServer.py index 9231221c5..12bd17499 100644 --- a/lbrynet/lbrynet_daemon/DaemonServer.py +++ b/lbrynet/lbrynet_daemon/DaemonServer.py @@ -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 \ No newline at end of file + return _lbrynet_server diff --git a/lbrynet/lbrynet_daemon/auth/util.py b/lbrynet/lbrynet_daemon/auth/util.py index c1de700b5..eaef0896b 100644 --- a/lbrynet/lbrynet_daemon/auth/util.py +++ b/lbrynet/lbrynet_daemon/auth/util.py @@ -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) \ No newline at end of file + return json.dumps(message_dict, sort_keys=True) diff --git a/lbrynet/lbrynet_daemon/daemon_scripts/Autofetcher.py b/lbrynet/lbrynet_daemon/daemon_scripts/Autofetcher.py index cd7ed02cb..fc73373f2 100644 --- a/lbrynet/lbrynet_daemon/daemon_scripts/Autofetcher.py +++ b/lbrynet/lbrynet_daemon/daemon_scripts/Autofetcher.py @@ -65,4 +65,4 @@ class Autofetcher(object): def run(api): fetcher = Autofetcher(api) - fetcher.start() \ No newline at end of file + fetcher.start() diff --git a/lbrynet/pointtraderclient/__init__.py b/lbrynet/pointtraderclient/__init__.py index f6337cb30..4c5b43dde 100644 --- a/lbrynet/pointtraderclient/__init__.py +++ b/lbrynet/pointtraderclient/__init__.py @@ -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. -""" \ No newline at end of file +""" diff --git a/run_pylint.sh b/run_pylint.sh index 99ee24924..47cb2cee8 100755 --- a/run_pylint.sh +++ b/run_pylint.sh @@ -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 $@ diff --git a/tests/dht/testProtocol.py b/tests/dht/testProtocol.py index 91758c1cc..b6329f639 100644 --- a/tests/dht/testProtocol.py +++ b/tests/dht/testProtocol.py @@ -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()) \ No newline at end of file + unittest.TextTestRunner().run(suite())