@ -139,7 +139,7 @@ class Torrent:
results = m . call ( ) [ 0 ] # only sent one call, only need first result
offset_method_index = retriever_methods . index (
rtorrent . rpc . find_method ( " f.get_ offset " ) )
rtorrent . rpc . find_method ( " f.offset " ) )
# make a list of the offsets of all the files, sort appropriately
offset_list = sorted ( [ r [ offset_method_index ] for r in results ] )
@ -168,7 +168,7 @@ class Torrent:
"""
m = rtorrent . rpc . Multicall ( self )
self . multicall_add ( m , " d.try_stop " )
self . multicall_add ( m , " d.set_ directory " , d )
self . multicall_add ( m , " d.directory.set " , d )
self . directory = m . call ( ) [ - 1 ]
@ -181,7 +181,7 @@ class Torrent:
"""
m = rtorrent . rpc . Multicall ( self )
self . multicall_add ( m , " d.try_stop " )
self . multicall_add ( m , " d.set_ directory_base " , d )
self . multicall_add ( m , " d.directory_base.set " , d )
def start ( self ) :
""" Start the torrent """
@ -304,7 +304,7 @@ class Torrent:
m = rtorrent . rpc . Multicall ( self )
field = " custom {0} " . format ( key )
self . multicall_add ( m , " d.get_ {0} " . format ( field ) )
self . multicall_add ( m , " d. {0} " . format ( field ) )
setattr ( self , field , m . call ( ) [ - 1 ] )
return ( getattr ( self , field ) )
@ -326,7 +326,7 @@ class Torrent:
self . _assert_custom_key_valid ( key )
m = rtorrent . rpc . Multicall ( self )
self . multicall_add ( m , " d.set_ custom {0} " . format ( key ) , value )
self . multicall_add ( m , " d.custom {0} .set " . format ( key ) , value )
return ( m . call ( ) [ - 1 ] )
@ -355,7 +355,7 @@ class Torrent:
@note : Variable where the result for this method is stored Torrent . hash_checking_queued """
m = rtorrent . rpc . Multicall ( self )
self . multicall_add ( m , " d.get_ hashing " )
self . multicall_add ( m , " d.hashing " )
self . multicall_add ( m , " d.is_hash_checking " )
results = m . call ( )
@ -397,86 +397,86 @@ methods = [
Method ( Torrent , ' is_hash_checking ' , ' d.is_hash_checking ' ,
boolean = True ,
) ,
Method ( Torrent , ' get_peers_max ' , ' d.get_ peers_max ' ) ,
Method ( Torrent , ' get_tracker_focus ' , ' d.get_ tracker_focus ' ) ,
Method ( Torrent , ' get_skip_total ' , ' d.get_skip_ total ' ) ,
Method ( Torrent , ' get_state ' , ' d.get_ state ' ) ,
Method ( Torrent , ' get_peer_exchange ' , ' d.get_ peer_exchange ' ) ,
Method ( Torrent , ' get_down_rate ' , ' d.get_down_ rate ' ) ,
Method ( Torrent , ' get_connection_seed ' , ' d.get_ connection_seed ' ) ,
Method ( Torrent , ' get_uploads_max ' , ' d.get_ uploads_max ' ) ,
Method ( Torrent , ' get_priority_str ' , ' d.get_ priority_str ' ) ,
Method ( Torrent , ' get_peers_max ' , ' d.peers_max ' ) ,
Method ( Torrent , ' get_tracker_focus ' , ' d.tracker_focus ' ) ,
Method ( Torrent , ' get_skip_total ' , ' d.skip. total ' ) ,
Method ( Torrent , ' get_state ' , ' d.state ' ) ,
Method ( Torrent , ' get_peer_exchange ' , ' d.peer_exchange ' ) ,
Method ( Torrent , ' get_down_rate ' , ' d.down. rate ' ) ,
Method ( Torrent , ' get_connection_seed ' , ' d.connection_seed ' ) ,
Method ( Torrent , ' get_uploads_max ' , ' d.uploads_max ' ) ,
Method ( Torrent , ' get_priority_str ' , ' d.priority_str ' ) ,
Method ( Torrent , ' is_open ' , ' d.is_open ' ,
boolean = True ,
) ,
Method ( Torrent , ' get_peers_min ' , ' d.get_ peers_min ' ) ,
Method ( Torrent , ' get_peers_complete ' , ' d.get_ peers_complete ' ) ,
Method ( Torrent , ' get_tracker_numwant ' , ' d.get_ tracker_numwant ' ) ,
Method ( Torrent , ' get_connection_current ' , ' d.get_ connection_current ' ) ,
Method ( Torrent , ' is_complete ' , ' d.get_ complete ' ,
Method ( Torrent , ' get_peers_min ' , ' d.peers_min ' ) ,
Method ( Torrent , ' get_peers_complete ' , ' d.peers_complete ' ) ,
Method ( Torrent , ' get_tracker_numwant ' , ' d.tracker_numwant ' ) ,
Method ( Torrent , ' get_connection_current ' , ' d.connection_current ' ) ,
Method ( Torrent , ' is_complete ' , ' d.complete ' ,
boolean = True ,
) ,
Method ( Torrent , ' get_peers_connected ' , ' d.get_ peers_connected ' ) ,
Method ( Torrent , ' get_chunk_size ' , ' d.get_ chunk_size ' ) ,
Method ( Torrent , ' get_state_counter ' , ' d.get_ state_counter ' ) ,
Method ( Torrent , ' get_base_filename ' , ' d.get_ base_filename ' ) ,
Method ( Torrent , ' get_state_changed ' , ' d.get_ state_changed ' ) ,
Method ( Torrent , ' get_peers_not_connected ' , ' d.get_ peers_not_connected ' ) ,
Method ( Torrent , ' get_directory ' , ' d.get_ directory ' ) ,
Method ( Torrent , ' get_peers_connected ' , ' d.peers_connected ' ) ,
Method ( Torrent , ' get_chunk_size ' , ' d.chunk_size ' ) ,
Method ( Torrent , ' get_state_counter ' , ' d.state_counter ' ) ,
Method ( Torrent , ' get_base_filename ' , ' d.base_filename ' ) ,
Method ( Torrent , ' get_state_changed ' , ' d.state_changed ' ) ,
Method ( Torrent , ' get_peers_not_connected ' , ' d.peers_not_connected ' ) ,
Method ( Torrent , ' get_directory ' , ' d.directory ' ) ,
Method ( Torrent , ' is_incomplete ' , ' d.incomplete ' ,
boolean = True ,
) ,
Method ( Torrent , ' get_tracker_size ' , ' d.get_ tracker_size ' ) ,
Method ( Torrent , ' get_tracker_size ' , ' d.tracker_size ' ) ,
Method ( Torrent , ' is_multi_file ' , ' d.is_multi_file ' ,
boolean = True ,
) ,
Method ( Torrent , ' get_local_id ' , ' d.get_ local_id ' ) ,
Method ( Torrent , ' get_ratio ' , ' d.get_ ratio ' ,
Method ( Torrent , ' get_local_id ' , ' d.local_id ' ) ,
Method ( Torrent , ' get_ratio ' , ' d.ratio ' ,
post_process_func = lambda x : x / 1000.0 ,
) ,
Method ( Torrent , ' get_loaded_file ' , ' d.get_ loaded_file ' ) ,
Method ( Torrent , ' get_max_file_size ' , ' d.get_ max_file_size ' ) ,
Method ( Torrent , ' get_size_chunks ' , ' d.get_ size_chunks ' ) ,
Method ( Torrent , ' get_loaded_file ' , ' d.loaded_file ' ) ,
Method ( Torrent , ' get_max_file_size ' , ' d.max_file_size ' ) ,
Method ( Torrent , ' get_size_chunks ' , ' d.size_chunks ' ) ,
Method ( Torrent , ' is_pex_active ' , ' d.is_pex_active ' ,
boolean = True ,
) ,
Method ( Torrent , ' get_hashing ' , ' d.get_ hashing ' ) ,
Method ( Torrent , ' get_bitfield ' , ' d.get_ bitfield ' ) ,
Method ( Torrent , ' get_local_id_html ' , ' d.get_ local_id_html ' ) ,
Method ( Torrent , ' get_connection_leech ' , ' d.get_ connection_leech ' ) ,
Method ( Torrent , ' get_peers_accounted ' , ' d.get_ peers_accounted ' ) ,
Method ( Torrent , ' get_message ' , ' d.get_ message ' ) ,
Method ( Torrent , ' get_hashing ' , ' d.hashing ' ) ,
Method ( Torrent , ' get_bitfield ' , ' d.bitfield ' ) ,
Method ( Torrent , ' get_local_id_html ' , ' d.local_id_html ' ) ,
Method ( Torrent , ' get_connection_leech ' , ' d.connection_leech ' ) ,
Method ( Torrent , ' get_peers_accounted ' , ' d.peers_accounted ' ) ,
Method ( Torrent , ' get_message ' , ' d.message ' ) ,
Method ( Torrent , ' is_active ' , ' d.is_active ' ,
boolean = True ,
) ,
Method ( Torrent , ' get_size_bytes ' , ' d.get_ size_bytes ' ) ,
Method ( Torrent , ' get_ignore_commands ' , ' d.get_ ignore_commands ' ) ,
Method ( Torrent , ' get_creation_date ' , ' d.get_ creation_date ' ) ,
Method ( Torrent , ' get_base_path ' , ' d.get_ base_path ' ) ,
Method ( Torrent , ' get_left_bytes ' , ' d.get_ left_bytes ' ) ,
Method ( Torrent , ' get_size_files ' , ' d.get_ size_files ' ) ,
Method ( Torrent , ' get_size_pex ' , ' d.get_ size_pex ' ) ,
Method ( Torrent , ' get_size_bytes ' , ' d.size_bytes ' ) ,
Method ( Torrent , ' get_ignore_commands ' , ' d.ignore_commands ' ) ,
Method ( Torrent , ' get_creation_date ' , ' d.creation_date ' ) ,
Method ( Torrent , ' get_base_path ' , ' d.base_path ' ) ,
Method ( Torrent , ' get_left_bytes ' , ' d.left_bytes ' ) ,
Method ( Torrent , ' get_size_files ' , ' d.size_files ' ) ,
Method ( Torrent , ' get_size_pex ' , ' d.size_pex ' ) ,
Method ( Torrent , ' is_private ' , ' d.is_private ' ,
boolean = True ,
) ,
Method ( Torrent , ' get_max_size_pex ' , ' d.get_ max_size_pex ' ) ,
Method ( Torrent , ' get_num_chunks_hashed ' , ' d.get_ chunks_hashed ' ,
Method ( Torrent , ' get_max_size_pex ' , ' d.max_size_pex ' ) ,
Method ( Torrent , ' get_num_chunks_hashed ' , ' d.chunks_hashed ' ,
aliases = ( " get_chunks_hashed " , ) ) ,
Method ( Torrent , ' get_num_chunks_wanted ' , ' d.wanted_chunks ' ) ,
Method ( Torrent , ' get_priority ' , ' d.get_ priority ' ) ,
Method ( Torrent , ' get_skip_rate ' , ' d.get_skip_ rate ' ) ,
Method ( Torrent , ' get_completed_bytes ' , ' d.get_ completed_bytes ' ) ,
Method ( Torrent , ' get_name ' , ' d.get_ name ' ) ,
Method ( Torrent , ' get_completed_chunks ' , ' d.get_ completed_chunks ' ) ,
Method ( Torrent , ' get_throttle_name ' , ' d.get_ throttle_name ' ) ,
Method ( Torrent , ' get_free_diskspace ' , ' d.get_ free_diskspace ' ) ,
Method ( Torrent , ' get_directory_base ' , ' d.get_ directory_base ' ) ,
Method ( Torrent , ' get_hashing_failed ' , ' d.get_ hashing_failed ' ) ,
Method ( Torrent , ' get_tied_to_file ' , ' d.get_ tied_to_file ' ) ,
Method ( Torrent , ' get_down_total ' , ' d.get_down_ total ' ) ,
Method ( Torrent , ' get_bytes_done ' , ' d.get_ bytes_done ' ) ,
Method ( Torrent , ' get_up_rate ' , ' d.get_up_ rate ' ) ,
Method ( Torrent , ' get_up_total ' , ' d.get_up_ total ' ) ,
Method ( Torrent , ' get_priority ' , ' d.priority ' ) ,
Method ( Torrent , ' get_skip_rate ' , ' d.skip. rate ' ) ,
Method ( Torrent , ' get_completed_bytes ' , ' d.completed_bytes ' ) ,
Method ( Torrent , ' get_name ' , ' d.name ' ) ,
Method ( Torrent , ' get_completed_chunks ' , ' d.completed_chunks ' ) ,
Method ( Torrent , ' get_throttle_name ' , ' d.throttle_name ' ) ,
Method ( Torrent , ' get_free_diskspace ' , ' d.free_diskspace ' ) ,
Method ( Torrent , ' get_directory_base ' , ' d.directory_base ' ) ,
Method ( Torrent , ' get_hashing_failed ' , ' d.hashing_failed ' ) ,
Method ( Torrent , ' get_tied_to_file ' , ' d.tied_to_file ' ) ,
Method ( Torrent , ' get_down_total ' , ' d.down. total ' ) ,
Method ( Torrent , ' get_bytes_done ' , ' d.bytes_done ' ) ,
Method ( Torrent , ' get_up_rate ' , ' d.up. rate ' ) ,
Method ( Torrent , ' get_up_total ' , ' d.up. total ' ) ,
Method ( Torrent , ' is_accepting_seeders ' , ' d.accepting_seeders ' ,
boolean = True ,
) ,
@ -490,28 +490,28 @@ methods = [
boolean = True ,
) ,
Method ( Torrent , " get_time_started " , " d.timestamp.started " ) ,
Method ( Torrent , " get_custom1 " , " d.get_ custom1 " ) ,
Method ( Torrent , " get_custom2 " , " d.get_ custom2 " ) ,
Method ( Torrent , " get_custom3 " , " d.get_ custom3 " ) ,
Method ( Torrent , " get_custom4 " , " d.get_ custom4 " ) ,
Method ( Torrent , " get_custom5 " , " d.get_ custom5 " ) ,
Method ( Torrent , " get_custom1 " , " d.custom1 " ) ,
Method ( Torrent , " get_custom2 " , " d.custom2 " ) ,
Method ( Torrent , " get_custom3 " , " d.custom3 " ) ,
Method ( Torrent , " get_custom4 " , " d.custom4 " ) ,
Method ( Torrent , " get_custom5 " , " d.custom5 " ) ,
# MODIFIERS
Method ( Torrent , ' set_uploads_max ' , ' d.set_ uploads_max ' ) ,
Method ( Torrent , ' set_tied_to_file ' , ' d.set_ tied_to_file ' ) ,
Method ( Torrent , ' set_tracker_numwant ' , ' d.set_ tracker_numwant ' ) ,
Method ( Torrent , ' set_priority ' , ' d.set_ priority ' ) ,
Method ( Torrent , ' set_peers_max ' , ' d.set_ peers_max ' ) ,
Method ( Torrent , ' set_hashing_failed ' , ' d.set_ hashing_failed ' ) ,
Method ( Torrent , ' set_message ' , ' d.set_ message ' ) ,
Method ( Torrent , ' set_throttle_name ' , ' d.set_ throttle_name ' ) ,
Method ( Torrent , ' set_peers_min ' , ' d.set_ peers_min ' ) ,
Method ( Torrent , ' set_ignore_commands ' , ' d.set_ ignore_commands ' ) ,
Method ( Torrent , ' set_max_file_size ' , ' d.set_ max_file_size ' ) ,
Method ( Torrent , ' set_custom5 ' , ' d.set_ custom5 ' ) ,
Method ( Torrent , ' set_custom4 ' , ' d.set_ custom4 ' ) ,
Method ( Torrent , ' set_custom2 ' , ' d.set_ custom2 ' ) ,
Method ( Torrent , ' set_custom1 ' , ' d.set_ custom1 ' ) ,
Method ( Torrent , ' set_custom3 ' , ' d.set_ custom3 ' ) ,
Method ( Torrent , ' set_connection_current ' , ' d.set_ connection_current ' ) ,
Method ( Torrent , ' set_uploads_max ' , ' d.uploads_max.set ' ) ,
Method ( Torrent , ' set_tied_to_file ' , ' d.tied_to_file.set ' ) ,
Method ( Torrent , ' set_tracker_numwant ' , ' d.tracker_numwant.se t ' ) ,
Method ( Torrent , ' set_priority ' , ' d.priority.set ' ) ,
Method ( Torrent , ' set_peers_max ' , ' d.peers_max.set ' ) ,
Method ( Torrent , ' set_hashing_failed ' , ' d.hashing_failed.set ' ) ,
Method ( Torrent , ' set_message ' , ' d.message.set ' ) ,
Method ( Torrent , ' set_throttle_name ' , ' d.throttle_name.set ' ) ,
Method ( Torrent , ' set_peers_min ' , ' d.peers_min.set ' ) ,
Method ( Torrent , ' set_ignore_commands ' , ' d.ignore_commands.set ' ) ,
Method ( Torrent , ' set_max_file_size ' , ' d.max_file_size.set ' ) ,
Method ( Torrent , ' set_custom5 ' , ' d.custom5.set ' ) ,
Method ( Torrent , ' set_custom4 ' , ' d.custom4.set ' ) ,
Method ( Torrent , ' set_custom2 ' , ' d.custom2.set ' ) ,
Method ( Torrent , ' set_custom1 ' , ' d.custom1.set ' ) ,
Method ( Torrent , ' set_custom3 ' , ' d.custom3.set ' ) ,
Method ( Torrent , ' set_connection_current ' , ' d.connection_current.se t ' ) ,
]