add web url to our bindings and core

This commit is contained in:
Marcos Pinto 2007-08-14 18:46:57 +00:00
parent b26575e920
commit 8b4d40664e
2 changed files with 21 additions and 0 deletions

View File

@ -1026,3 +1026,6 @@ class Manager:
if speed != -1: if speed != -1:
speed = speed * 1024 speed = speed * 1024
return deluge_core.set_per_download_rate_limit(unique_ID, speed) return deluge_core.set_per_download_rate_limit(unique_ID, speed)
def add_url_seed(self, unique_ID, address):
return deluge_core.add_url_seed(unique_ID, address)

View File

@ -1891,12 +1891,30 @@ static PyObject *torrent_set_max_upload_slots_per_torrent(PyObject *self, PyObje
return Py_None; return Py_None;
} }
static PyObject *torrent_add_url_seed(PyObject *self, PyObject *args)
{
python_long unique_ID;
std::string address;
if (!PyArg_ParseTuple(args, "is", &unique_ID, &address))
return NULL;
long index = get_index_from_unique_ID(unique_ID);
if (PyErr_Occurred())
return NULL;
torrent_t &t = M_torrents->at(index);
t.handle.add_url_seed(address);
return Py_None;
}
//==================== //====================
// Python Module data // Python Module data
//==================== //====================
static PyMethodDef deluge_core_methods[] = static PyMethodDef deluge_core_methods[] =
{ {
{"add_url_seed", torrent_pe_settings, METH_VARARGS, "."},
{"pe_settings", torrent_pe_settings, METH_VARARGS, "."}, {"pe_settings", torrent_pe_settings, METH_VARARGS, "."},
{"pre_init", torrent_pre_init, METH_VARARGS, "."}, {"pre_init", torrent_pre_init, METH_VARARGS, "."},
{"init", torrent_init, METH_VARARGS, "."}, {"init", torrent_init, METH_VARARGS, "."},