|
|
__init__(self,
storage,
request_size,
hashes,
piece_sizes,
datalength,
finished,
failed,
statusfunc=<function dummy_status at 0x2b55193a3b18>,
flag=<DebTorrent.BT1.StorageWrapper.fakeflag instance at 0x2b55193a...,
check_hashes=True,
data_flunked=<function <lambda> at 0x2b55198ce230>,
backfunc=None,
config={},
unpauseflag=<DebTorrent.BT1.StorageWrapper.fakeflag instance at 0x2b55193a...)
Initialize the instance and begin the background initialization
tasks. |
source code
|
|
|
|
_bgsync(self)
Periodically flush the files to disk. |
source code
|
|
boolean
|
|
|
|
|
|
|
_initialize(self)
Perform the background initialization of the storage. |
source code
|
|
boolean
|
|
|
|
|
float
|
|
boolean
|
|
float
|
|
boolean
|
|
int
|
|
float
|
|
boolean
|
|
|
|
_bgalloc(self)
Allocate the file storage in the background. |
source code
|
|
boolean
|
|
int
|
|
long
|
|
boolean
|
|
boolean
|
|
string
|
|
(string, list of int)
|
|
boolean
|
|
string
|
|
long, long
|
|
|
|
|
boolean
|
|
|
|
|
boolean
|
|
boolean
|
|
int, int
|
|
|
|
|
boolean
|
|
boolean
|
|
boolean
|
|
|
|
sync(self)
Flush all the buffered pieces to disk in order by their current
place in the download. |
source code
|
|
int
|
|
boolean
|
|
boolean
|
|
DebTorrent.piecebuffer.SingleBuffer or
string
|
|
|
DebTorrent.piecebuffer.SingleBuffer
|
read_raw(self,
piece,
begin,
length,
flush_first=True)
Read some piece data from the disk. |
source code
|
|
|
|
|
boolean
|
|
boolean
|
|
|
|
reblock(self,
new_blocked)
Recreate the various blocked lists based on new blocked
pieces. |
source code
|
|
dictionary
|
|
list of int
|
|
string
|
alloc_buf
dummy data to write to allocated but not downloaded piece
locations
|
string
|
alloc_type
the type of allocation to do, always 'pre-allocate'
|
long
|
amount_desired
the amount of the total download that is desired
|
length
|
amount_inactive
the amount of data that is still in inactive requests
|
long
|
amount_left
the amount of the total download that is still left to
download
|
long
|
amount_obtained
the amount of the desired download that has been received
|
method
|
backfunc
method to call to schedule future invocation of requester
functions
|
boolean
|
bgalloc_active
whether background allocation is in process
|
boolean
|
bgalloc_enabled
whether the allocation of all pieces has been enabled
|
list of boolean
|
blocked
whether the piece location is blocked
|
list of int
|
blocked_holes
the holes that have been blocked
|
|
Olist
|
blocked_movein
the piece locations that are currently blocking a piece from
moving into its proper place
|
|
Olist
|
blocked_moveout
the pieces that are currently blocked from moving into their
proper place
|
boolean
|
check_hashes
whether to re-check hashes of data already downloaded, during
startup
|
list of int
|
check_list
the pieces needing hash checking during initialization
|
float
|
check_numchecked
not used
|
dictionary
|
check_targets
keys are piece hashes, values are a list of potential pieces
|
int
|
check_total
the number of pieces needing hash checking during
initialization
|
dictionary
|
config
the configuration parameters
|
method
|
data_flunked
method to call when a hash check fails for a piece
|
long
|
datalength
the total length of the download
|
dictionary
|
dirty
keys are the pieces that have received partial downloads, values
are a list of the offset within the piece and length of the partial
downloads received
|
boolean
|
double_check
whether to double-check data being written to the disk for
errors
|
dictionary
|
download_history
keys are downloaded pieces, values are dictionaries with keys of
the request offset within the piece and values of the source of the
download
|
method
|
failed
method to call when a critical failure occurs
|
dictionary
|
failed_pieces
keys are downloaded pieces, values are dictionaries with keys of
the source of the download
|
method
|
finished
method to call when the download is complete
|
threading.Event
|
flag
the flag that indicates when the program is to be shutdown
|
list of string
|
hashes
the hashes of the pieces
|
|
DebTorrent.bitfield.Bitfield
|
have
the bitfield that this peer has
|
(string, list of int)
|
have_cloaked_data
the cached incomplete bitfiled as a binary string, and the haves
needed to complete it, or None if it has not yet been generated
|
list of int
|
holes
the piece locations that are currently empty and unallocated
|
list of int or list of
(int, int)
|
inactive_requests
for each piece, the inactive requests remaining for the piece.
|
method
|
initialize_done
method to call when the background initialization is complete
|
method
|
initialize_next
current method to call in the initialization tasks
|
list of [string, int,
method, method]
|
initialize_tasks
the initialization tasks to perform, the status message, initial
fraction done, method to call to initialize the task, and the
task
|
list of int
|
movelist
for sparse allocation, the pieces that need to be moved during
initialization
|
list of int
|
numactive
the number of active requests pending for a piece
|
float
|
numchecked
the number of pieces that have been hash checked during
initialization
|
int
|
numholes
the number of holes that need to be filled by allocation during
initialization
|
int
|
out_of_place
for sparse allocation, the number of pieces that are out of place
during initialization
|
list of long
|
piece_begins
the beginning offset of the pieces in the total download
|
list of int
|
piece_lengths
the lengths of the pieces
|
list of int
|
piece_sizes
the lengths of the pieces
|
dictionary
|
places
keys are the pieces, values are their current piece locations
|
int
|
request_size
the number of bytes to query for per request
|
dictionary
|
stat_active
keys are the pieces that currently have active requests
|
dictionary
|
stat_new
keys are the pieces that have a newly sent request but have not
downloaded anything
|
int
|
stat_numdownloaded
total number of pieces that have successfully downloaded
|
int
|
stat_numflunked
the number of downloaded pieces that have failed a hash check
|
int
|
stat_numfound
number of pieces that were found from a previous download
|
method
|
statusfunc
the method to use to diplay status updates
|
|
BT1.Storage.Storage
|
storage
the file storage instance
|
float
|
tomove
for sparse allocation, the numebr of pieces that still need to be
moved during initialization
|
long
|
total_length
the total length of the download
|
boolean
|
triple_check
whether to thoroughly check data being written to the disk
|
threading.Event
|
unpauseflag
the flag to unset to pause the download
|
list of boolean
|
waschecked
whether the piece has been hash checked
|
dictionary
|
write_buf
keys are pieces in the piece buffer, values are lists of the
offset within the piece and the piece data: [(start, data), ...]
|
list of int
|
write_buf_list
the pieces currently in the piece buffer, ordered so that the most
recently received piece is at the end of the list
|
long
|
write_buf_max
the maximum number of bytes to store in the piece buffer
|
long
|
write_buf_size
the current number of bytes stored in the piece buffer
|