diff --git a/bindings/python/src/alert.cpp b/bindings/python/src/alert.cpp index e48b787d6..5fbefff94 100755 --- a/bindings/python/src/alert.cpp +++ b/bindings/python/src/alert.cpp @@ -43,6 +43,9 @@ 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; +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() { @@ -90,17 +93,17 @@ void bind_alert() .def_readonly("status_code", &tracker_error_alert::status_code) ; - class_, noncopyable>( + class_, noncopyable>( "tracker_warning_alert", tracker_warning_alert_doc, no_init ); - class_, noncopyable>( + class_, noncopyable>( "tracker_reply_alert", tracker_reply_alert_doc, no_init ) .def_readonly("num_peers", &tracker_reply_alert::num_peers) ; - class_, noncopyable>( + class_, noncopyable>( "tracker_announce_alert", tracker_announce_alert_doc, no_init ); @@ -187,7 +190,9 @@ void bind_alert() class_, noncopyable>( "file_error_alert", file_error_alert_doc, no_init - ); + ) + .def_readonly("file", &file_error_alert::file) + ; class_, noncopyable>( "metadata_failed_alert", metadata_failed_alert_doc, no_init @@ -209,11 +214,18 @@ void bind_alert() class_, noncopyable>( "portmap_error_alert", portmap_error_alert_doc, no_init - ); - + ) + .def_readonly("mapping", &portmap_error_alert::mapping) + .def_readonly("type", &portmap_error_alert::type) + ; + class_, noncopyable>( "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_, noncopyable>( "fastresume_rejected_alert", fastresume_rejected_alert_doc, no_init @@ -225,14 +237,33 @@ void bind_alert() .def_readonly("ip", &peer_blocked_alert::ip) ; - class_, noncopyable>( + class_, 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_, noncopyable>( + class_, noncopyable>( "scrape_failed_alert", scrape_failed_alert_doc, no_init ); + + class_, noncopyable>( + "udp_error_alert", udp_error_alert_doc, no_init + ) + .def_readonly("endpoint", &udp_error_alert::endpoint) + ; + + class_, noncopyable>( + "external_ip_alert", external_ip_alert_doc, no_init + ) + .def_readonly("external_address", &external_ip_alert::external_address) + ; + + class_, noncopyable>( + "save_resume_data_alert", save_resume_data_alert_doc, no_init + ) + .def_readonly("resume_data", &save_resume_data_alert::resume_data) + ; + } diff --git a/bindings/python/src/docstrings.cpp b/bindings/python/src/docstrings.cpp index 0721127a4..b1d28670d 100755 --- a/bindings/python/src/docstrings.cpp +++ b/bindings/python/src/docstrings.cpp @@ -342,3 +342,13 @@ 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."; + +char const* udp_error_alert_doc = + ""; + +char const* external_ip_alert_doc = + ""; + +char const* save_resume_data_alert_doc = + ""; +