Sync up alerts in the python bindings

This commit is contained in:
Andrew Resch 2008-04-29 21:43:25 +00:00
parent 2a00af8781
commit 88c20df380
2 changed files with 50 additions and 9 deletions

View File

@ -43,6 +43,9 @@ extern char const* fastresume_rejected_alert_doc;
extern char const* peer_blocked_alert_doc; extern char const* peer_blocked_alert_doc;
extern char const* scrape_reply_alert_doc; extern char const* scrape_reply_alert_doc;
extern char const* scrape_failed_alert_doc; extern char const* scrape_failed_alert_doc;
extern char const* udp_error_alert_doc;
extern char const* external_ip_alert_doc;
extern char const* save_resume_data_alert_doc;
void bind_alert() void bind_alert()
{ {
@ -90,17 +93,17 @@ void bind_alert()
.def_readonly("status_code", &tracker_error_alert::status_code) .def_readonly("status_code", &tracker_error_alert::status_code)
; ;
class_<tracker_warning_alert, bases<torrent_alert>, noncopyable>( class_<tracker_warning_alert, bases<tracker_alert>, noncopyable>(
"tracker_warning_alert", tracker_warning_alert_doc, no_init "tracker_warning_alert", tracker_warning_alert_doc, no_init
); );
class_<tracker_reply_alert, bases<torrent_alert>, noncopyable>( class_<tracker_reply_alert, bases<tracker_alert>, noncopyable>(
"tracker_reply_alert", tracker_reply_alert_doc, no_init "tracker_reply_alert", tracker_reply_alert_doc, no_init
) )
.def_readonly("num_peers", &tracker_reply_alert::num_peers) .def_readonly("num_peers", &tracker_reply_alert::num_peers)
; ;
class_<tracker_announce_alert, bases<torrent_alert>, noncopyable>( class_<tracker_announce_alert, bases<tracker_alert>, noncopyable>(
"tracker_announce_alert", tracker_announce_alert_doc, no_init "tracker_announce_alert", tracker_announce_alert_doc, no_init
); );
@ -187,7 +190,9 @@ void bind_alert()
class_<file_error_alert, bases<torrent_alert>, noncopyable>( class_<file_error_alert, bases<torrent_alert>, noncopyable>(
"file_error_alert", file_error_alert_doc, no_init "file_error_alert", file_error_alert_doc, no_init
); )
.def_readonly("file", &file_error_alert::file)
;
class_<metadata_failed_alert, bases<torrent_alert>, noncopyable>( class_<metadata_failed_alert, bases<torrent_alert>, noncopyable>(
"metadata_failed_alert", metadata_failed_alert_doc, no_init "metadata_failed_alert", metadata_failed_alert_doc, no_init
@ -209,11 +214,18 @@ void bind_alert()
class_<portmap_error_alert, bases<alert>, noncopyable>( class_<portmap_error_alert, bases<alert>, noncopyable>(
"portmap_error_alert", portmap_error_alert_doc, no_init "portmap_error_alert", portmap_error_alert_doc, no_init
); )
.def_readonly("mapping", &portmap_error_alert::mapping)
.def_readonly("type", &portmap_error_alert::type)
;
class_<portmap_alert, bases<alert>, noncopyable>( class_<portmap_alert, bases<alert>, noncopyable>(
"portmap_alert", portmap_alert_doc, no_init "portmap_alert", portmap_alert_doc, no_init
); )
.def_readonly("mapping", &portmap_alert::mapping)
.def_readonly("external_port", &portmap_alert::external_port)
.def_readonly("type", &portmap_alert::type)
;
class_<fastresume_rejected_alert, bases<torrent_alert>, noncopyable>( class_<fastresume_rejected_alert, bases<torrent_alert>, noncopyable>(
"fastresume_rejected_alert", fastresume_rejected_alert_doc, no_init "fastresume_rejected_alert", fastresume_rejected_alert_doc, no_init
@ -225,14 +237,33 @@ void bind_alert()
.def_readonly("ip", &peer_blocked_alert::ip) .def_readonly("ip", &peer_blocked_alert::ip)
; ;
class_<scrape_reply_alert, bases<torrent_alert>, noncopyable>( class_<scrape_reply_alert, bases<tracker_alert>, noncopyable>(
"scrape_reply_alert", scrape_reply_alert_doc, no_init "scrape_reply_alert", scrape_reply_alert_doc, no_init
) )
.def_readonly("incomplete", &scrape_reply_alert::incomplete) .def_readonly("incomplete", &scrape_reply_alert::incomplete)
.def_readonly("complete", &scrape_reply_alert::complete) .def_readonly("complete", &scrape_reply_alert::complete)
; ;
class_<scrape_failed_alert, bases<torrent_alert>, noncopyable>( class_<scrape_failed_alert, bases<tracker_alert>, noncopyable>(
"scrape_failed_alert", scrape_failed_alert_doc, no_init "scrape_failed_alert", scrape_failed_alert_doc, no_init
); );
class_<udp_error_alert, bases<alert>, noncopyable>(
"udp_error_alert", udp_error_alert_doc, no_init
)
.def_readonly("endpoint", &udp_error_alert::endpoint)
;
class_<external_ip_alert, bases<alert>, noncopyable>(
"external_ip_alert", external_ip_alert_doc, no_init
)
.def_readonly("external_address", &external_ip_alert::external_address)
;
class_<save_resume_data_alert, bases<torrent_alert>, noncopyable>(
"save_resume_data_alert", save_resume_data_alert_doc, no_init
)
.def_readonly("resume_data", &save_resume_data_alert::resume_data)
;
} }

View File

@ -342,3 +342,13 @@ char const* scrape_failed_alert_doc =
"If a scrape request fails, this alert is generated. This might\n" "If a scrape request fails, this alert is generated. This might\n"
"be due to the tracker timing out, refusing connection or returning\n" "be due to the tracker timing out, refusing connection or returning\n"
"an http response code indicating an error."; "an http response code indicating an error.";
char const* udp_error_alert_doc =
"";
char const* external_ip_alert_doc =
"";
char const* save_resume_data_alert_doc =
"";