From 437649aad0d8e22beed8687cb89db095b0f42895 Mon Sep 17 00:00:00 2001 From: Zach Tibbitts Date: Wed, 10 Jan 2007 22:09:03 +0000 Subject: [PATCH] rename to deluge_core in the cpp file --- cpp/deluge_core.cpp | 20 ++++++++++---------- deluge.py | 2 +- delugegtk.py | 2 ++ test.py | 6 +++--- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/cpp/deluge_core.cpp b/cpp/deluge_core.cpp index 293a4b983..524300b75 100755 --- a/cpp/deluge_core.cpp +++ b/cpp/deluge_core.cpp @@ -111,7 +111,7 @@ torrents_t *M_torrents = NULL; // Exception types & macro //------------------------ -static PyObject *FloodError = NULL; +static PyObject *DelugeError = NULL; static PyObject *InvalidEncodingError = NULL; static PyObject *FilesystemError = NULL; static PyObject *DuplicateTorrentError = NULL; @@ -148,7 +148,7 @@ long get_torrent_index(torrent_handle &handle) return i; } - RAISE_INT(FloodError, "Handle not found."); + RAISE_INT(DelugeError, "Handle not found."); } long get_index_from_unique_ID(long unique_ID) @@ -159,7 +159,7 @@ long get_index_from_unique_ID(long unique_ID) if ((*M_torrents)[i].unique_ID == unique_ID) return i; - RAISE_INT(FloodError, "No such unique_ID."); + RAISE_INT(DelugeError, "No such unique_ID."); } long internal_add_torrent(std::string const& torrent_name, @@ -269,7 +269,7 @@ long count_DHT_peers(entry &state) static PyObject *torrent_pre_init(PyObject *self, PyObject *args) { - if (!PyArg_ParseTuple(args, "OOOOO", &FloodError, + if (!PyArg_ParseTuple(args, "OOOOO", &DelugeError, &InvalidEncodingError, &FilesystemError, &DuplicateTorrentError, @@ -281,7 +281,7 @@ static PyObject *torrent_pre_init(PyObject *self, PyObject *args) static PyObject *torrent_init(PyObject *self, PyObject *args) { - printf("flood_core; using libtorrent %s. Compiled with NDEBUG value: %d\r\n", + printf("deluge_core; using libtorrent %s. Compiled with NDEBUG value: %d\r\n", LIBTORRENT_VERSION, NDEBUG); @@ -382,7 +382,7 @@ static PyObject *torrent_save_fastresume(PyObject *self, PyObject *args) Py_INCREF(Py_None); return Py_None; } else - RAISE_PTR(FloodError, "Invalid handle or no metadata for fastresume."); + RAISE_PTR(DelugeError, "Invalid handle or no metadata for fastresume."); } static PyObject *torrent_set_max_half_open(PyObject *self, PyObject *args) @@ -1118,7 +1118,7 @@ static PyObject *torrent_create_torrent(PyObject *self, PyObject *args) { // std::cerr << e.what() << "\n"; // return Py_BuildValue("l", 0); - RAISE_PTR(FloodError, e.what()); + RAISE_PTR(DelugeError, e.what()); } } @@ -1168,7 +1168,7 @@ static PyObject *torrent_apply_IP_filter(PyObject *self, PyObject *args) // Python Module data //==================== -static PyMethodDef flood_core_methods[] = { +static PyMethodDef deluge_core_methods[] = { {"pre_init", torrent_pre_init, METH_VARARGS, "."}, {"init", torrent_init, METH_VARARGS, "."}, {"quit", torrent_quit, METH_VARARGS, "."}, @@ -1205,7 +1205,7 @@ static PyMethodDef flood_core_methods[] = { PyMODINIT_FUNC -initflood_core(void) +initdeluge_core(void) { - Py_InitModule("flood_core", flood_core_methods); + Py_InitModule("deluge_core", deluge_core_methods); }; diff --git a/deluge.py b/deluge.py index 9d88e6a47..d4bafab03 100644 --- a/deluge.py +++ b/deluge.py @@ -30,7 +30,7 @@ # # Documentation: -# Torrents have 3 structures: +# Torrents have 3 structures: # 1. torrent_info - persistent data, like name, upload speed cap, etc. # 2. core_torrent_state - transient state data from the core. This may take # time to calculate, so we do if efficiently diff --git a/delugegtk.py b/delugegtk.py index f6ed5c88c..010731be4 100755 --- a/delugegtk.py +++ b/delugegtk.py @@ -20,6 +20,8 @@ # 51 Franklin Street, Fifth Floor # Boston, MA 02110-1301, USA. +import deluge + import dcommon, dgtk import sys, os, gettext diff --git a/test.py b/test.py index ebdb25168..0defc33fd 100644 --- a/test.py +++ b/test.py @@ -13,14 +13,14 @@ import deluge from time import sleep import os -manager = deluge.manager("FL", "0500", "deluge - testing only", +manager = deluge.manager("DL", "0500", "deluge - testing only", os.path.expanduser("~") + "/Temp")# blank_slate=True) #manager.set_pref('max_upload_rate', 6*1024) -#my_torrent = manager.add_torrent("xubuntu-6.10-desktop-i386.iso.torrent", ".", True) +my_torrent = manager.add_torrent("ubuntu.iso.torrent", ".", True) -#print "Unique ID:", my_torrent +print "Unique ID:", my_torrent print "PREFS:", manager.prefs