fix python build without deprecated functions
This commit is contained in:
parent
21d1f6f649
commit
0961a3d1ba
|
@ -502,13 +502,17 @@ void bind_alert()
|
|||
.value("upload_payload", stats_alert::upload_payload)
|
||||
.value("upload_protocol", stats_alert::upload_protocol)
|
||||
.value("upload_ip_protocol", stats_alert::upload_ip_protocol)
|
||||
#ifndef TORRENT_NO_DEPRECATE
|
||||
.value("upload_dht_protocol", stats_alert::upload_dht_protocol)
|
||||
.value("upload_tracker_protocol", stats_alert::upload_tracker_protocol)
|
||||
#endif
|
||||
.value("download_payload", stats_alert::download_payload)
|
||||
.value("download_protocol", stats_alert::download_protocol)
|
||||
.value("download_ip_protocol", stats_alert::download_ip_protocol)
|
||||
#ifndef TORRENT_NO_DEPRECATE
|
||||
.value("download_dht_protocol", stats_alert::download_dht_protocol)
|
||||
.value("download_tracker_protocol", stats_alert::download_tracker_protocol)
|
||||
#endif
|
||||
;
|
||||
|
||||
class_<anonymous_mode_alert, bases<torrent_alert>, noncopyable>(
|
||||
|
|
|
@ -76,9 +76,9 @@ namespace
|
|||
|
||||
void bind_create_torrent()
|
||||
{
|
||||
void (file_storage::*add_file0)(std::string const&, size_type, int, std::time_t, std::string const&) = &file_storage::add_file;
|
||||
void (file_storage::*add_file0)(std::string const&, boost::int64_t, int, std::time_t, std::string const&) = &file_storage::add_file;
|
||||
#if TORRENT_USE_WSTRING && !defined TORRENT_NO_DEPRECATE
|
||||
void (file_storage::*add_file1)(std::wstring const&, size_type, int, std::time_t, std::string const&) = &file_storage::add_file;
|
||||
void (file_storage::*add_file1)(std::wstring const&, boost::int64_t, int, std::time_t, std::string const&) = &file_storage::add_file;
|
||||
#endif
|
||||
|
||||
void (file_storage::*set_name0)(std::string const&) = &file_storage::set_name;
|
||||
|
@ -155,7 +155,9 @@ void bind_create_torrent()
|
|||
.value("merkle", create_torrent::merkle)
|
||||
.value("modification_time", create_torrent::modification_time)
|
||||
.value("symlinks", create_torrent::symlinks)
|
||||
#if !defined TORRENT_NO_DEPRECATE
|
||||
.value("calculate_file_hashes", create_torrent::calculate_file_hashes)
|
||||
#endif
|
||||
;
|
||||
|
||||
def("add_files", add_files0, (arg("fs"), arg("path"), arg("flags") = 0));
|
||||
|
|
|
@ -612,12 +612,10 @@ void bind_session()
|
|||
.def_readonly("reads", &cache_status::reads)
|
||||
.def_readonly("queued_bytes", &cache_status::queued_bytes)
|
||||
.def_readonly("cache_size", &cache_status::cache_size)
|
||||
#endif
|
||||
.def_readonly("write_cache_size", &cache_status::write_cache_size)
|
||||
.def_readonly("read_cache_size", &cache_status::read_cache_size)
|
||||
.def_readonly("pinned_blocks", &cache_status::pinned_blocks)
|
||||
.def_readonly("total_used_buffers", &cache_status::total_used_buffers)
|
||||
#ifndef TORRENT_NO_DEPRECATE
|
||||
.def_readonly("average_read_time", &cache_status::average_read_time)
|
||||
.def_readonly("average_write_time", &cache_status::average_write_time)
|
||||
.def_readonly("average_hash_time", &cache_status::average_hash_time)
|
||||
|
@ -627,7 +625,6 @@ void bind_session()
|
|||
.def_readonly("cumulative_write_time", &cache_status::cumulative_write_time)
|
||||
.def_readonly("cumulative_hash_time", &cache_status::cumulative_hash_time)
|
||||
.def_readonly("total_read_back", &cache_status::total_read_back)
|
||||
#endif
|
||||
.def_readonly("read_queue_size", &cache_status::read_queue_size)
|
||||
.def_readonly("blocked_jobs", &cache_status::blocked_jobs)
|
||||
.def_readonly("queued_jobs", &cache_status::queued_jobs)
|
||||
|
@ -640,13 +637,13 @@ void bind_session()
|
|||
.def_readonly("arc_mru_ghost_size", &cache_status::arc_mru_ghost_size)
|
||||
.def_readonly("arc_mfu_size", &cache_status::arc_mfu_size)
|
||||
.def_readonly("arc_mfu_ghost_size", &cache_status::arc_mfu_ghost_size)
|
||||
#endif
|
||||
;
|
||||
|
||||
class_<lt::session, boost::noncopyable>("session", no_init)
|
||||
.def(
|
||||
init<settings_pack const&, fingerprint, int>((
|
||||
init<settings_pack const&, int>((
|
||||
arg("settings")
|
||||
, arg("fingerprint")=fingerprint("LT",0,1,0,0)
|
||||
, arg("flags")=lt::session::start_default_features | lt::session::add_default_plugins))
|
||||
)
|
||||
.def(
|
||||
|
@ -769,8 +766,8 @@ void bind_session()
|
|||
.def("stop_natpmp", allow_threads(<::session::stop_natpmp))
|
||||
.def("get_cache_status", &get_cache_status)
|
||||
.def("get_cache_info", &get_cache_info2)
|
||||
#endif
|
||||
.def("set_peer_id", allow_threads(<::session::set_peer_id))
|
||||
#endif // TORRENT_NO_DEPRECATE
|
||||
;
|
||||
|
||||
enum_<lt::session::save_state_flags_t>("save_state_flags_t")
|
||||
|
|
|
@ -79,7 +79,7 @@ namespace
|
|||
|
||||
list file_progress(torrent_handle& handle, int flags)
|
||||
{
|
||||
std::vector<size_type> p;
|
||||
std::vector<boost::int64_t> p;
|
||||
|
||||
{
|
||||
allow_threading_guard guard;
|
||||
|
@ -89,7 +89,7 @@ list file_progress(torrent_handle& handle, int flags)
|
|||
|
||||
list result;
|
||||
|
||||
for (std::vector<size_type>::iterator i(p.begin()), e(p.end()); i != e; ++i)
|
||||
for (std::vector<boost::int64_t>::iterator i(p.begin()), e(p.end()); i != e; ++i)
|
||||
result.append(*i);
|
||||
|
||||
return result;
|
||||
|
|
|
@ -57,14 +57,6 @@ namespace
|
|||
d["type"] = i->type;
|
||||
d["auth"] = i->auth;
|
||||
d["extra_headers"] = i->extra_headers;
|
||||
d["retry"] = total_seconds(i->retry - min_time());
|
||||
d["resolving"] = i->resolving;
|
||||
d["removed"] = i->removed;
|
||||
list endpoints;
|
||||
for (std::vector<tcp::endpoint>::const_iterator k = i->endpoints.begin()
|
||||
, end(i->endpoints.end()); k != end; ++k)
|
||||
endpoints.append(make_tuple(print_address(k->address()), k->port()));
|
||||
d["endpoints"] = endpoints;
|
||||
ret.append(d);
|
||||
}
|
||||
|
||||
|
@ -142,7 +134,7 @@ namespace
|
|||
return result;
|
||||
}
|
||||
|
||||
list map_block(torrent_info& ti, int piece, size_type offset, int size)
|
||||
list map_block(torrent_info& ti, int piece, boost::int64_t offset, int size)
|
||||
{
|
||||
std::vector<file_slice> p = ti.map_block(piece, offset, size);
|
||||
list result;
|
||||
|
@ -166,9 +158,9 @@ namespace
|
|||
bool get_send_stats(announce_entry const& ae) { return ae.send_stats; }
|
||||
|
||||
|
||||
size_type get_size(file_entry const& fe) { return fe.size; }
|
||||
size_type get_offset(file_entry const& fe) { return fe.offset; }
|
||||
size_type get_file_base(file_entry const& fe) { return fe.file_base; }
|
||||
boost::int64_t get_size(file_entry const& fe) { return fe.size; }
|
||||
boost::int64_t get_offset(file_entry const& fe) { return fe.offset; }
|
||||
boost::int64_t get_file_base(file_entry const& fe) { return fe.file_base; }
|
||||
void set_file_base(file_entry& fe, int b) { fe.file_base = b; }
|
||||
bool get_pad_file(file_entry const& fe) { return fe.pad_file; }
|
||||
bool get_executable_attribute(file_entry const& fe) { return fe.executable_attribute; }
|
||||
|
|
Loading…
Reference in New Issue