diff --git a/lbrynet/blob/blob_file.py b/lbrynet/blob/blob_file.py index c73f14ca1..993a77400 100644 --- a/lbrynet/blob/blob_file.py +++ b/lbrynet/blob/blob_file.py @@ -144,6 +144,10 @@ class BlobFile(object): return False def read(self, write_func): + """ + This function is only used in StreamBlobDecryptor + and should be deprecated in favor of open_for_reading() + """ def close_self(*args): self.close_read_handle(file_handle) return args[0] @@ -158,6 +162,15 @@ class BlobFile(object): d = defer.fail(IOError("Could not read the blob")) return d + def close_read_handle(self, file_handle): + """ + This function is only used in StreamBlobDecryptor + and should be deprecated in favor of open_for_reading() + """ + if file_handle is not None: + file_handle.close() + self.readers -= 1 + def reader_finished(self, reader): self.readers -= 1 return defer.succeed(True) @@ -206,11 +219,6 @@ class BlobFile(object): d.addBoth(lambda _: writer.close_handle()) return d - def close_read_handle(self, file_handle): - if file_handle is not None: - file_handle.close() - self.readers -= 1 - @defer.inlineCallbacks def _save_verified_blob(self, writer): with self.setting_verified_blob_lock: diff --git a/lbrynet/blob/reader.py b/lbrynet/blob/reader.py index fb4724d3a..292516a02 100644 --- a/lbrynet/blob/reader.py +++ b/lbrynet/blob/reader.py @@ -6,6 +6,10 @@ log = logging.getLogger(__name__) class HashBlobReader_v0(object): + """ + This is a class that is only used in StreamBlobDecryptor + and should be deprecated + """ implements(interfaces.IConsumer) def __init__(self, write_func): @@ -30,6 +34,10 @@ class HashBlobReader_v0(object): reactor.callLater(0, self.producer.resumeProducing) class HashBlobReader(object): + """ + This is a file like reader class that supports + read(size) and close() + """ def __init__(self, file_path, finished_cb): self.finished_cb = finished_cb self.finished_cb_d = None