python binding fixes

This commit is contained in:
Arvid Norberg 2011-03-07 08:24:02 +00:00
parent 5431d86779
commit 1c13f828dd
3 changed files with 19 additions and 5 deletions

View File

@ -226,9 +226,9 @@ def main():
ses.set_settings(settings)
# ses.set_severity_level(lt.alert.severity_levels.info)
ses.set_alert_mask(0xfffffff)
ses.add_extension(lt.create_ut_pex_plugin)
ses.add_extension(lt.create_ut_metadata_plugin)
ses.add_extension(lt.create_metadata_plugin)
# ses.add_extension(lt.create_ut_pex_plugin)
# ses.add_extension(lt.create_ut_metadata_plugin)
# ses.add_extension(lt.create_metadata_plugin)
handles = []
alerts = []

View File

@ -97,6 +97,8 @@ namespace
dict session_get_settings(session const& ses)
{
allow_threading_guard guard;
session_settings sett = ses.settings();
dict sett_dict;
bencode_map_entry* map;
@ -196,6 +198,8 @@ namespace
add_torrent_params p;
dict_to_add_torrent_params(params, p);
allow_threading_guard guard;
#ifndef BOOST_NO_EXCEPTIONS
return s.add_torrent(p);
#else
@ -218,6 +222,8 @@ namespace
feed_handle add_feed(session& s, dict params)
{
allow_threading_guard guard;
feed_settings feed;
dict_to_feed_settings(params, feed);
@ -226,6 +232,8 @@ namespace
dict get_feed_status(feed_handle const& h)
{
allow_threading_guard guard;
feed_status s = h.get_feed_status();
dict ret;
ret["url"] = s.url;
@ -259,6 +267,8 @@ namespace
void set_feed_settings(feed_handle& h, dict sett)
{
allow_threading_guard guard;
feed_settings feed;
dict_to_feed_settings(sett, feed);
h.set_settings(feed);
@ -266,6 +276,8 @@ namespace
dict get_feed_settings(feed_handle& h)
{
allow_threading_guard guard;
feed_settings s = h.settings();
dict ret;
ret["url"] = s.url;
@ -294,6 +306,7 @@ namespace
list get_torrents(session& s)
{
allow_threading_guard guard;
list ret;
std::vector<torrent_handle> torrents = s.get_torrents();
@ -320,6 +333,7 @@ namespace
entry save_state(session const& s, boost::uint32_t flags)
{
allow_threading_guard guard;
entry e;
s.save_state(e, flags);
return e;

View File

@ -103,9 +103,9 @@ namespace
{ return ae.send_stats; }
bool get_size(file_entry const& fe)
size_type get_size(file_entry const& fe)
{ return fe.size; }
bool get_offset(file_entry const& fe)
size_type get_offset(file_entry const& fe)
{ return fe.offset; }
bool get_pad_file(file_entry const& fe)
{ return fe.pad_file; }