Update the alerts bindings.

This commit is contained in:
Andrew Resch 2007-09-25 07:15:35 +00:00
parent b72a79332d
commit 20f76b4eaa
2 changed files with 149 additions and 89 deletions

View File

@ -12,24 +12,33 @@ using namespace libtorrent;
extern char const* alert_doc;
extern char const* alert_msg_doc;
extern char const* alert_severity_doc;
extern char const* listen_failed_alert_doc;
extern char const* file_error_alert_doc;
extern char const* tracker_announce_alert_doc;
extern char const* torrent_alert_doc;
extern char const* tracker_alert_doc;
extern char const* tracker_reply_alert_doc;
extern char const* tracker_warning_alert_doc;
extern char const* url_seed_alert_doc;
extern char const* tracker_reply_alert_doc;
extern char const* tracker_announce_alert_doc;
extern char const* hash_failed_alert_doc;
extern char const* peer_ban_alert_doc;
extern char const* peer_error_alert_doc;
extern char const* invalid_request_alert_doc;
extern char const* peer_request_doc;
extern char const* torrent_finished_alert_doc;
extern char const* torrent_paused_alert_doc;
extern char const* piece_finished_alert_doc;
extern char const* block_finished_alert_doc;
extern char const* block_downloading_alert_doc;
extern char const* storage_moved_alert_doc;
extern char const* torrent_paused_alert_doc;
extern char const* torrent_checked_alert_doc;
extern char const* url_seed_alert_doc;
extern char const* file_error_alert_doc;
extern char const* metadata_failed_alert_doc;
extern char const* metadata_received_alert_doc;
extern char const* listen_failed_alert_doc;
extern char const* listen_succeeded_alert_doc;
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;
void bind_alert()
{
@ -58,60 +67,41 @@ void bind_alert()
;
}
class_<listen_failed_alert, bases<alert>, noncopyable>(
"listen_failed_alert", listen_failed_alert_doc, no_init
);
class_<file_error_alert, bases<alert>, noncopyable>(
"file_error_alert", file_error_alert_doc, no_init
class_<torrent_alert, bases<alert>, noncopyable>(
"torrent_alert", torrent_alert_doc, no_init
)
.def_readonly("handle", &file_error_alert::handle)
.def_readonly("handle", &torrent_alert::handle)
;
class_<tracker_announce_alert, bases<alert>, noncopyable>(
"tracker_announce_alert", tracker_announce_alert_doc, no_init
)
.def_readonly("handle", &tracker_announce_alert::handle)
;
class_<tracker_alert, bases<alert>, noncopyable>(
class_<tracker_alert, bases<torrent_alert>, noncopyable>(
"tracker_alert", tracker_alert_doc, no_init
)
.def_readonly("handle", &tracker_alert::handle)
.def_readonly("times_in_row", &tracker_alert::times_in_row)
.def_readonly("status_code", &tracker_alert::status_code)
;
class_<tracker_reply_alert, bases<alert>, noncopyable>(
"tracker_reply_alert", tracker_reply_alert_doc, no_init
)
.def_readonly("handle", &tracker_reply_alert::handle)
;
class_<tracker_warning_alert, bases<alert>, noncopyable>(
class_<tracker_warning_alert, bases<torrent_alert>, noncopyable>(
"tracker_warning_alert", tracker_warning_alert_doc, no_init
)
.def_readonly("handle", &tracker_warning_alert::handle)
;
);
class_<url_seed_alert, bases<alert>, noncopyable>(
"url_seed_alert", url_seed_alert_doc, no_init
)
.def_readonly("url", &url_seed_alert::url)
;
class_<tracker_reply_alert, bases<torrent_alert>, noncopyable>(
"tracker_reply_alert", tracker_reply_alert_doc, no_init
);
class_<hash_failed_alert, bases<alert>, noncopyable>(
class_<tracker_announce_alert, bases<torrent_alert>, noncopyable>(
"tracker_announce_alert", tracker_announce_alert_doc, no_init
);
class_<hash_failed_alert, bases<torrent_alert>, noncopyable>(
"hash_failed_alert", hash_failed_alert_doc, no_init
)
.def_readonly("handle", &hash_failed_alert::handle)
.def_readonly("piece_index", &hash_failed_alert::piece_index)
;
class_<peer_ban_alert, bases<alert>, noncopyable>(
class_<peer_ban_alert, bases<torrent_alert>, noncopyable>(
"peer_ban_alert", peer_ban_alert_doc, no_init
)
.def_readonly("ip", &peer_ban_alert::ip)
.def_readonly("handle", &peer_ban_alert::handle)
;
class_<peer_error_alert, bases<alert>, noncopyable>(
@ -121,10 +111,9 @@ void bind_alert()
.def_readonly("pid", &peer_error_alert::pid)
;
class_<invalid_request_alert, bases<alert>, noncopyable>(
class_<invalid_request_alert, bases<torrent_alert>, noncopyable>(
"invalid_request_alert", invalid_request_alert_doc, no_init
)
.def_readonly("handle", &invalid_request_alert::handle)
.def_readonly("ip", &invalid_request_alert::ip)
.def_readonly("request", &invalid_request_alert::request)
.def_readonly("pid", &invalid_request_alert::pid)
@ -137,40 +126,86 @@ void bind_alert()
.def(self == self)
;
class_<torrent_finished_alert, bases<alert>, noncopyable>(
class_<torrent_finished_alert, bases<torrent_alert>, noncopyable>(
"torrent_finished_alert", torrent_finished_alert_doc, no_init
);
class_<piece_finished_alert, bases<torrent_alert>, noncopyable>(
"piece_finished_alert", piece_finished_alert_doc, no_init
)
.def_readonly("handle", &torrent_finished_alert::handle)
.def_readonly("piece_index", &piece_finished_alert::piece_index)
;
class_<torrent_paused_alert, bases<alert>, noncopyable>(
"torrent_paused_alert", torrent_paused_alert_doc, no_init
class_<block_finished_alert, bases<torrent_alert>, noncopyable>(
"block_finished_alert", block_finished_alert_doc, no_init
)
.def_readonly("handle", &torrent_paused_alert::handle)
.def_readonly("block_index", &block_finished_alert::block_index)
.def_readonly("piece_index", &block_finished_alert::piece_index)
;
class_<storage_moved_alert, bases<alert>, noncopyable>(
class_<block_downloading_alert, bases<torrent_alert>, noncopyable>(
"block_downloading_alert", block_downloading_alert_doc, no_init
)
.def_readonly("peer_speedmsg", &block_downloading_alert::peer_speedmsg)
.def_readonly("block_index", &block_downloading_alert::block_index)
.def_readonly("piece_index", &block_downloading_alert::piece_index)
;
class_<storage_moved_alert, bases<torrent_alert>, noncopyable>(
"storage_moved_alert", storage_moved_alert_doc, no_init
);
class_<torrent_paused_alert, bases<torrent_alert>, noncopyable>(
"torrent_paused_alert", torrent_paused_alert_doc, no_init
);
class_<torrent_checked_alert, bases<torrent_alert>, noncopyable>(
"torrent_checked_alert", torrent_checked_alert_doc, no_init
);
class_<url_seed_alert, bases<torrent_alert>, noncopyable>(
"url_seed_alert", url_seed_alert_doc, no_init
)
.def_readonly("handle", &storage_moved_alert::handle)
.def_readonly("url", &url_seed_alert::url)
;
class_<metadata_failed_alert, bases<alert>, noncopyable>(
class_<file_error_alert, bases<torrent_alert>, noncopyable>(
"file_error_alert", file_error_alert_doc, no_init
);
class_<metadata_failed_alert, bases<torrent_alert>, noncopyable>(
"metadata_failed_alert", metadata_failed_alert_doc, no_init
)
.def_readonly("handle", &metadata_failed_alert::handle)
;
);
class_<metadata_received_alert, bases<alert>, noncopyable>(
class_<metadata_received_alert, bases<torrent_alert>, noncopyable>(
"metadata_received_alert", metadata_received_alert_doc, no_init
)
.def_readonly("handle", &metadata_received_alert::handle)
;
);
class_<fastresume_rejected_alert, bases<alert>, noncopyable>(
"fastresume_rejected_alert", fastresume_rejected_alert_doc, no_init
class_<listen_failed_alert, bases<alert>, noncopyable>(
"listen_failed_alert", listen_failed_alert_doc, no_init
);
class_<listen_succeeded_alert, bases<alert>, noncopyable>(
"listen_succeeded_alert", listen_succeeded_alert_doc, no_init
)
.def_readonly("handle", &fastresume_rejected_alert::handle)
.def_readonly("endpoint", &listen_succeeded_alert::endpoint)
;
class_<portmap_error_alert, bases<alert>, noncopyable>(
"portmap_error_alert", portmap_error_alert_doc, no_init
);
class_<portmap_alert, bases<alert>, noncopyable>(
"portmap_alert", portmap_alert_doc, no_init
);
class_<fastresume_rejected_alert, bases<torrent_alert>, noncopyable>(
"fastresume_rejected_alert", fastresume_rejected_alert_doc, no_init
);
class_<peer_blocked_alert, bases<alert>, noncopyable>(
"peer_blocked_alert", peer_blocked_alert_doc, no_init
)
.def_readonly("ip", &peer_blocked_alert::ip)
;
}

View File

@ -184,19 +184,8 @@ char const* alert_msg_doc =
char const* alert_severity_doc =
"Returns the severity level for this alert, one of `alert.severity_levels`.";
char const* listen_failed_alert_doc =
"This alert is generated when none of the ports, given in the\n"
"port range, to `session` can be opened for listening. This alert\n"
"is generated as severity level `alert.severity_levels.fatal`.";
char const* file_error_alert_doc =
"If the storage fails to read or write files that it needs access\n"
"to, this alert is generated and the torrent is paused. It is\n"
"generated as severity level `alert.severity_levels.fatal`.";
char const* tracker_announce_alert_doc =
"This alert is generated each time a tracker announce is sent\n"
"(or attempted to be sent). It is generated at severity level `alert.severity_levels.info`.";
char const* torrent_alert_doc =
"";
char const* tracker_alert_doc =
"This alert is generated on tracker time outs, premature\n"
@ -205,21 +194,21 @@ char const* tracker_alert_doc =
"the tracker belongs to. This alert is generated as severity level\n"
"`alert.severity_levels.warning`.";
char const* tracker_reply_alert_doc =
"This alert is only for informational purpose. It is generated when\n"
"a tracker announce succeeds. It is generated with severity level\n"
"`alert.severity_levels.info`.";
char const* tracker_warning_alert_doc =
"This alert is triggered if the tracker reply contains a warning\n"
"field. Usually this means that the tracker announce was successful\n"
", but the tracker has a message to the client. The message string in\n"
"the alert will contain the warning message from the tracker. It is\n"
"generated with severity level `alert.severity_levels.warning`.";
char const* tracker_reply_alert_doc =
"This alert is only for informational purpose. It is generated when\n"
"a tracker announce succeeds. It is generated with severity level\n"
"`alert.severity_levels.info`.";
char const* url_seed_alert_doc =
"This alert is generated when a HTTP seed name lookup fails. This\n"
"alert is generated as severity level `alert.severity_levels.warning`.";
char const* tracker_announce_alert_doc =
"This alert is generated each time a tracker announce is sent\n"
"(or attempted to be sent). It is generated at severity level `alert.severity_levels.info`.";
char const* hash_failed_alert_doc =
"This alert is generated when a finished piece fails its hash check.\n"
@ -258,17 +247,38 @@ char const* torrent_finished_alert_doc =
"It contains a `torrent_handle` to the torrent in question. This alert\n"
"is generated as severity level `alert.severity_levels.info`.";
char const* torrent_paused_alert_doc =
"This alert is generated when a torrent switches from being a\n"
"active to paused.\n"
"It contains a `torrent_handle` to the torrent in question. This alert\n"
"is generated as severity level `alert.severity_levels.warning`.";
char const* piece_finished_alert_doc =
"";
char const* block_finished_alert_doc =
"";
char const* block_downloading_alert_doc =
"";
char const* storage_moved_alert_doc =
"This alert is generated when a torrent moves storage.\n"
"It contains a `torrent_handle` to the torrent in question. This alert\n"
"is generated as severity level `alert.severity_levels.warning`.";
char const* torrent_paused_alert_doc =
"This alert is generated when a torrent switches from being a\n"
"active to paused.\n"
"It contains a `torrent_handle` to the torrent in question. This alert\n"
"is generated as severity level `alert.severity_levels.warning`.";
char const* torrent_checked_alert_doc =
"";
char const* url_seed_alert_doc =
"This alert is generated when a HTTP seed name lookup fails. This\n"
"alert is generated as severity level `alert.severity_levels.warning`.";
char const* file_error_alert_doc =
"If the storage fails to read or write files that it needs access\n"
"to, this alert is generated and the torrent is paused. It is\n"
"generated as severity level `alert.severity_levels.fatal`.";
char const* metadata_failed_alert_doc =
"This alert is generated when the metadata has been completely\n"
"received and the info-hash failed to match it. i.e. the\n"
@ -285,10 +295,25 @@ char const* metadata_received_alert_doc =
"needs to download it from peers (when utilizing the libtorrent\n"
"extension). It is generated at severity level `alert.severity_levels.info`.";
char const* listen_failed_alert_doc =
"This alert is generated when none of the ports, given in the\n"
"port range, to `session` can be opened for listening. This alert\n"
"is generated as severity level `alert.severity_levels.fatal`.";
char const* listen_succeeded_alert_doc =
"";
char const* portmap_error_alert_doc =
"";
char const* portmap_alert_doc =
"";
char const* fastresume_rejected_alert_doc =
"This alert is generated when a fastresume file has been passed\n"
"to `session.add_torrent` but the files on disk did not match the\n"
"fastresume file. The string explains the reason why the resume\n"
"file was rejected. It is generated at severity level `alert.severity_levels.warning`.";
char const* peer_blocked_alert_doc =
"";