whitespace
This commit is contained in:
parent
e1cdbdc91d
commit
85dee27c92
2 changed files with 6 additions and 6 deletions
|
@ -341,7 +341,6 @@ class HashBlobCreator(object):
|
||||||
else:
|
else:
|
||||||
self.blob_hash = self.hashsum.hexdigest()
|
self.blob_hash = self.hashsum.hexdigest()
|
||||||
d = self._close()
|
d = self._close()
|
||||||
|
|
||||||
if self.blob_hash is not None:
|
if self.blob_hash is not None:
|
||||||
d.addCallback(lambda _: self.blob_manager.creator_finished(self))
|
d.addCallback(lambda _: self.blob_manager.creator_finished(self))
|
||||||
d.addCallback(lambda _: self.blob_hash)
|
d.addCallback(lambda _: self.blob_hash)
|
||||||
|
|
|
@ -49,6 +49,7 @@ Client may now send another Client Info Request
|
||||||
"""
|
"""
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from twisted.protocols.basic import FileSender
|
from twisted.protocols.basic import FileSender
|
||||||
from twisted.internet.protocol import Protocol, ClientFactory
|
from twisted.internet.protocol import Protocol, ClientFactory
|
||||||
from twisted.internet import defer, error
|
from twisted.internet import defer, error
|
||||||
|
@ -62,9 +63,7 @@ class IncompleteResponseError(Exception):
|
||||||
|
|
||||||
|
|
||||||
class EncryptedFileReflectorClient(Protocol):
|
class EncryptedFileReflectorClient(Protocol):
|
||||||
|
|
||||||
# Protocol stuff
|
# Protocol stuff
|
||||||
|
|
||||||
def connectionMade(self):
|
def connectionMade(self):
|
||||||
self.blob_manager = self.factory.blob_manager
|
self.blob_manager = self.factory.blob_manager
|
||||||
self.response_buff = ''
|
self.response_buff = ''
|
||||||
|
@ -79,7 +78,8 @@ class EncryptedFileReflectorClient(Protocol):
|
||||||
self.streaming = False
|
self.streaming = False
|
||||||
d = self.get_blobs_to_send(self.factory.stream_info_manager, self.factory.stream_hash)
|
d = self.get_blobs_to_send(self.factory.stream_info_manager, self.factory.stream_hash)
|
||||||
d.addCallback(lambda _: self.send_handshake())
|
d.addCallback(lambda _: self.send_handshake())
|
||||||
d.addErrback(lambda err: log.warning("An error occurred immediately: %s", err.getTraceback()))
|
d.addErrback(
|
||||||
|
lambda err: log.warning("An error occurred immediately: %s", err.getTraceback()))
|
||||||
|
|
||||||
def dataReceived(self, data):
|
def dataReceived(self, data):
|
||||||
log.debug('Recieved %s', data)
|
log.debug('Recieved %s', data)
|
||||||
|
@ -206,7 +206,8 @@ class EncryptedFileReflectorClient(Protocol):
|
||||||
self.next_blob_to_send = blob
|
self.next_blob_to_send = blob
|
||||||
self.read_handle = read_handle
|
self.read_handle = read_handle
|
||||||
return None
|
return None
|
||||||
raise ValueError("Couldn't open that blob for some reason. blob_hash: {}".format(blob.blob_hash))
|
raise ValueError(
|
||||||
|
"Couldn't open that blob for some reason. blob_hash: {}".format(blob.blob_hash))
|
||||||
|
|
||||||
def send_blob_info(self):
|
def send_blob_info(self):
|
||||||
log.debug("Send blob info for %s", self.next_blob_to_send.blob_hash)
|
log.debug("Send blob info for %s", self.next_blob_to_send.blob_hash)
|
||||||
|
|
Loading…
Reference in a new issue