applied python binding patch for scraping trackers (fixes #226)

This commit is contained in:
Arvid Norberg 2007-12-15 23:26:38 +00:00
parent 0943c0d299
commit 00d5625b7e
3 changed files with 24 additions and 0 deletions

View File

@ -39,6 +39,8 @@ extern char const* portmap_error_alert_doc;
extern char const* portmap_alert_doc;
extern char const* fastresume_rejected_alert_doc;
extern char const* peer_blocked_alert_doc;
extern char const* scrape_reply_alert_doc;
extern char const* scrape_failed_alert_doc;
void bind_alert()
{
@ -210,4 +212,15 @@ void bind_alert()
)
.def_readonly("ip", &peer_blocked_alert::ip)
;
class_<scrape_reply_alert, bases<torrent_alert>, noncopyable>(
"scrape_reply_alert", scrape_reply_alert_doc, no_init
)
.def_readonly("incomplete", &scrape_reply_alert::incomplete)
.def_readonly("complete", &scrape_reply_alert::complete)
;
class_<scrape_failed_alert, bases<torrent_alert>, noncopyable>(
"scrape_failed_alert", scrape_failed_alert_doc, no_init
);
}

View File

@ -321,3 +321,13 @@ char const* fastresume_rejected_alert_doc =
char const* peer_blocked_alert_doc =
"";
char const* scrape_reply_alert_doc =
"This alert is generated when a scrape request succeeds.\n"
"incomplete and complete is the data returned in the scrape\n"
"response. These numbers may be -1 if the reponse was malformed.";
char const* scrape_failed_alert_doc =
"If a scrape request fails, this alert is generated. This might\n"
"be due to the tracker timing out, refusing connection or returning\n"
"an http response code indicating an error.";

View File

@ -190,6 +190,7 @@ void bind_torrent_handle()
.def("prioritize_files", prioritize_files)
.def("get_peer_info", get_peer_info)
.def("get_download_queue", get_download_queue)
.def("scrape_tracker", (&torrent_handle::scrape_tracker))
;
}