From 68c906aff9c6175ea0d8a2c4d5ffa105ef602ce0 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Mon, 12 Feb 2018 15:19:34 -0500 Subject: [PATCH] pylint --- lbrynet/core/Session.py | 2 +- lbrynet/database/migrator/migrate5to6.py | 7 ++++--- lbrynet/tests/functional/test_misc.py | 2 -- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lbrynet/core/Session.py b/lbrynet/core/Session.py index 33314f2a1..1cc7fe349 100644 --- a/lbrynet/core/Session.py +++ b/lbrynet/core/Session.py @@ -11,7 +11,7 @@ from lbrynet.core.server.DHTHashAnnouncer import DHTHashAnnouncer from lbrynet.core.utils import generate_id from lbrynet.core.PaymentRateManager import BasePaymentRateManager, NegotiatedPaymentRateManager from lbrynet.core.BlobAvailability import BlobAvailabilityTracker -from twisted.internet import threads, defer, reactor +from twisted.internet import threads, defer log = logging.getLogger(__name__) diff --git a/lbrynet/database/migrator/migrate5to6.py b/lbrynet/database/migrator/migrate5to6.py index c823c8094..fe523b35a 100644 --- a/lbrynet/database/migrator/migrate5to6.py +++ b/lbrynet/database/migrator/migrate5to6.py @@ -152,7 +152,7 @@ def do_migration(db_dir): # first migrate the blobs blobs = blobs_db_cursor.execute("select * from blobs").fetchall() - _populate_blobs(blobs) + _populate_blobs(blobs) # pylint: disable=no-value-for-parameter log.info("migrated %i blobs", new_db.execute("select count(*) from blob").fetchone()[0]) # used to store the query arguments if we need to try re-importing the lbry file later @@ -220,7 +220,8 @@ def do_migration(db_dir): for damaged_sd in damaged_sds_on_disk: try: decoded, sd_length = verify_sd_blob(damaged_sd, blob_dir) - _add_recovered_blobs(decoded['blobs'], damaged_sd, sd_length) + blobs = decoded['blobs'] + _add_recovered_blobs(blobs, damaged_sd, sd_length) # pylint: disable=no-value-for-parameter _import_file(*file_args[damaged_sd]) damaged_stream_sds.remove(damaged_sd) except (OSError, ValueError, TypeError, IOError, AssertionError, sqlite3.IntegrityError): @@ -245,7 +246,7 @@ def do_migration(db_dir): log.info("migrated %i content claims", new_db.execute("select count(*) from content_claim").fetchone()[0]) - _make_db() + _make_db() # pylint: disable=no-value-for-parameter connection.close() blobs_db.close() lbryfile_db.close() diff --git a/lbrynet/tests/functional/test_misc.py b/lbrynet/tests/functional/test_misc.py index 14ffb2742..dffb100ec 100644 --- a/lbrynet/tests/functional/test_misc.py +++ b/lbrynet/tests/functional/test_misc.py @@ -14,12 +14,10 @@ from lbrynet.file_manager.EncryptedFileManager import EncryptedFileManager from lbrynet.core.Session import Session from lbrynet.core.server.BlobAvailabilityHandler import BlobAvailabilityHandlerFactory from lbrynet.core.client.StandaloneBlobDownloader import StandaloneBlobDownloader -from lbrynet.core.StreamDescriptor import BlobStreamDescriptorWriter from lbrynet.core.StreamDescriptor import StreamDescriptorIdentifier from lbrynet.core.StreamDescriptor import download_sd_blob from lbrynet.file_manager.EncryptedFileCreator import create_lbry_file from lbrynet.lbry_file.client.EncryptedFileOptions import add_lbry_file_to_sd_identifier -from lbrynet.core.StreamDescriptor import get_sd_info from twisted.internet import defer, threads, task from twisted.trial.unittest import TestCase from twisted.python.failure import Failure