plugins added
This commit is contained in:
16
dcommon.py
16
dcommon.py
@@ -2,20 +2,18 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) Zach Tibbitts 2006 <zach@collegegeek.org>
|
# Copyright (C) Zach Tibbitts 2006 <zach@collegegeek.org>
|
||||||
#
|
#
|
||||||
# Deluge is free software.
|
# This program is free software; you can redistribute it and/or modify
|
||||||
#
|
# it under the terms of the GNU General Public License as published by
|
||||||
# You may redistribute it and/or modify it under the terms of the
|
# the Free Software Foundation; either version 2, or (at your option)
|
||||||
# GNU General Public License, as published by the Free Software
|
|
||||||
# Foundation; either version 2 of the License, or (at your option)
|
|
||||||
# any later version.
|
# any later version.
|
||||||
#
|
#
|
||||||
# dcommon.py is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# See the GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with main.py. If not, write to:
|
# along with this program. If not, write to:
|
||||||
# The Free Software Foundation, Inc.,
|
# The Free Software Foundation, Inc.,
|
||||||
# 51 Franklin Street, Fifth Floor
|
# 51 Franklin Street, Fifth Floor
|
||||||
# Boston, MA 02110-1301, USA.
|
# Boston, MA 02110-1301, USA.
|
||||||
|
103
deluge.py
103
deluge.py
@@ -12,18 +12,19 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program. If not, write to:
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# The Free Software Foundation, Inc.,
|
||||||
#
|
# 51 Franklin Street, Fifth Floor
|
||||||
|
# Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
# Deluge Library, a.k.a. Flood, previously known as python-libtorrent:
|
# Deluge Library, previously known as python-libtorrent:
|
||||||
#
|
#
|
||||||
# Flood is a Python library for torrenting, that includes
|
# Deluge is a Python library for torrenting, that includes
|
||||||
# Flood, which is Python code, and Flood_core, which is also a Python
|
# Deluge, which is Python code, and Deluge_core, which is also a Python
|
||||||
# module, but written in C++, and includes the libtorrent torrent library. Only
|
# module, but written in C++, and includes the libtorrent torrent library. Only
|
||||||
# Flood should be visible, and only it should be imported, in the client.
|
# Deluge should be visible, and only it should be imported, in the client.
|
||||||
# Flood_core contains mainly libtorrent-interfacing code, and a few other things
|
# Deluge_core contains mainly libtorrent-interfacing code, and a few other things
|
||||||
# that make most sense to write at that level. Flood contains all other
|
# that make most sense to write at that level. Deluge contains all other
|
||||||
# torrent-system management: queueing, configuration management, persistent
|
# torrent-system management: queueing, configuration management, persistent
|
||||||
# list of torrents, etc.
|
# list of torrents, etc.
|
||||||
#
|
#
|
||||||
@@ -33,10 +34,10 @@
|
|||||||
# 1. torrent_info - persistent data, like name, upload speed cap, etc.
|
# 1. torrent_info - persistent data, like name, upload speed cap, etc.
|
||||||
# 2. core_torrent_state - transient state data from the core. This may take
|
# 2. core_torrent_state - transient state data from the core. This may take
|
||||||
# time to calculate, so we do if efficiently
|
# time to calculate, so we do if efficiently
|
||||||
# 3. supp_torrent_state - supplementary torrent data, from Flood
|
# 3. supp_torrent_state - supplementary torrent data, from Deluge
|
||||||
|
|
||||||
|
|
||||||
import flood_core
|
import deluge_core
|
||||||
import os, shutil
|
import os, shutil
|
||||||
import pickle
|
import pickle
|
||||||
import time
|
import time
|
||||||
@@ -65,35 +66,35 @@ DEFAULT_PREFS = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
PREF_FUNCTIONS = {
|
PREF_FUNCTIONS = {
|
||||||
"max_uploads" : flood_core.set_max_uploads,
|
"max_uploads" : deluge_core.set_max_uploads,
|
||||||
"listen_on" : flood_core.set_listen_on,
|
"listen_on" : deluge_core.set_listen_on,
|
||||||
"max_connections" : flood_core.set_max_connections,
|
"max_connections" : deluge_core.set_max_connections,
|
||||||
"use_DHT" : None, # not a normal pref in that is is applied only on start
|
"use_DHT" : None, # not a normal pref in that is is applied only on start
|
||||||
"max_active_torrents" : None, # no need for a function, applied constantly
|
"max_active_torrents" : None, # no need for a function, applied constantly
|
||||||
"auto_seed_ratio" : None, # no need for a function, applied constantly
|
"auto_seed_ratio" : None, # no need for a function, applied constantly
|
||||||
"max_download_rate" : flood_core.set_download_rate_limit,
|
"max_download_rate" : deluge_core.set_download_rate_limit,
|
||||||
"max_upload_rate" : flood_core.set_upload_rate_limit
|
"max_upload_rate" : deluge_core.set_upload_rate_limit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Exceptions
|
# Exceptions
|
||||||
|
|
||||||
class FloodError(Exception):
|
class DelugeError(Exception):
|
||||||
def __init__(self, value):
|
def __init__(self, value):
|
||||||
self.value = value
|
self.value = value
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return repr(self.value)
|
return repr(self.value)
|
||||||
|
|
||||||
class InvalidEncodingError(FloodError):
|
class InvalidEncodingError(DelugeError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class FilesystemError(FloodError):
|
class FilesystemError(DelugeError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class DuplicateTorrentError(FloodError):
|
class DuplicateTorrentError(DelugeError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class InvalidTorrentError(FloodError):
|
class InvalidTorrentError(DelugeError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@@ -153,7 +154,7 @@ class manager:
|
|||||||
os.mkdir(self.base_dir + "/" + TORRENTS_SUBDIR)
|
os.mkdir(self.base_dir + "/" + TORRENTS_SUBDIR)
|
||||||
|
|
||||||
# Pre-initialize the core's data structures
|
# Pre-initialize the core's data structures
|
||||||
flood_core.pre_init(FloodError,
|
deluge_core.pre_init(DelugeError,
|
||||||
InvalidEncodingError,
|
InvalidEncodingError,
|
||||||
FilesystemError,
|
FilesystemError,
|
||||||
DuplicateTorrentError,
|
DuplicateTorrentError,
|
||||||
@@ -161,14 +162,14 @@ class manager:
|
|||||||
|
|
||||||
# Start up the core
|
# Start up the core
|
||||||
assert(len(version) == 4)
|
assert(len(version) == 4)
|
||||||
flood_core.init(client_ID,
|
deluge_core.init(client_ID,
|
||||||
int(version[0]),
|
int(version[0]),
|
||||||
int(version[1]),
|
int(version[1]),
|
||||||
int(version[2]),
|
int(version[2]),
|
||||||
int(version[3]),
|
int(version[3]),
|
||||||
user_agent)
|
user_agent)
|
||||||
|
|
||||||
self.constants = flood_core.constants()
|
self.constants = deluge_core.constants()
|
||||||
|
|
||||||
# Unique IDs are NOT in the state, since they are temporary for each session
|
# Unique IDs are NOT in the state, since they are temporary for each session
|
||||||
self.unique_IDs = {} # unique_ID -> a torrent_info object, i.e. persistent data
|
self.unique_IDs = {} # unique_ID -> a torrent_info object, i.e. persistent data
|
||||||
@@ -198,9 +199,9 @@ class manager:
|
|||||||
# Apply DHT, if needed. Note that this is before any torrents are added
|
# Apply DHT, if needed. Note that this is before any torrents are added
|
||||||
if self.get_pref('use_DHT'):
|
if self.get_pref('use_DHT'):
|
||||||
if not blank_slate:
|
if not blank_slate:
|
||||||
flood_core.start_DHT(self.base_dir + "/" + DHT_FILENAME)
|
deluge_core.start_DHT(self.base_dir + "/" + DHT_FILENAME)
|
||||||
else:
|
else:
|
||||||
flood_core.start_DHT("")
|
deluge_core.start_DHT("")
|
||||||
|
|
||||||
# Unpickle the state, or create a new one
|
# Unpickle the state, or create a new one
|
||||||
if not blank_slate:
|
if not blank_slate:
|
||||||
@@ -242,11 +243,11 @@ class manager:
|
|||||||
# Stop DHT, if needed
|
# Stop DHT, if needed
|
||||||
if self.get_pref('use_DHT'):
|
if self.get_pref('use_DHT'):
|
||||||
print "Stopping DHT..."
|
print "Stopping DHT..."
|
||||||
flood_core.stop_DHT(self.base_dir + "/" + DHT_FILENAME)
|
deluge_core.stop_DHT(self.base_dir + "/" + DHT_FILENAME)
|
||||||
|
|
||||||
# Shutdown torrent core
|
# Shutdown torrent core
|
||||||
print "Quitting the core..."
|
print "Quitting the core..."
|
||||||
flood_core.quit()
|
deluge_core.quit()
|
||||||
|
|
||||||
def pre_quitting(self):
|
def pre_quitting(self):
|
||||||
# Save the uploaded data from this session to the existing upload memory
|
# Save the uploaded data from this session to the existing upload memory
|
||||||
@@ -267,12 +268,12 @@ class manager:
|
|||||||
self.prefs[key] = DEFAULT_PREFS[key]
|
self.prefs[key] = DEFAULT_PREFS[key]
|
||||||
return self.prefs[key]
|
return self.prefs[key]
|
||||||
else:
|
else:
|
||||||
raise FloodError("Asked for a pref that doesn't exist: " + key)
|
raise DelugeError("Asked for a pref that doesn't exist: " + key)
|
||||||
|
|
||||||
def set_pref(self, key, value):
|
def set_pref(self, key, value):
|
||||||
# Make sure this is a valid key
|
# Make sure this is a valid key
|
||||||
if key not in DEFAULT_PREFS.keys():
|
if key not in DEFAULT_PREFS.keys():
|
||||||
raise FloodError("Asked to change a pref that isn't valid: " + key)
|
raise DelugeError("Asked to change a pref that isn't valid: " + key)
|
||||||
|
|
||||||
self.prefs[key] = value
|
self.prefs[key] = value
|
||||||
|
|
||||||
@@ -289,7 +290,7 @@ class manager:
|
|||||||
def remove_torrent(self, unique_ID, data_also):
|
def remove_torrent(self, unique_ID, data_also):
|
||||||
# Save some data before we remove the torrent, needed later in this func
|
# Save some data before we remove the torrent, needed later in this func
|
||||||
temp = self.unique_IDs[unique_ID]
|
temp = self.unique_IDs[unique_ID]
|
||||||
temp_fileinfo = flood_core.get_fileinfo(unique_ID)
|
temp_fileinfo = deluge_core.get_fileinfo(unique_ID)
|
||||||
|
|
||||||
self.remove_torrent_ns(unique_ID)
|
self.remove_torrent_ns(unique_ID)
|
||||||
self.sync()
|
self.sync()
|
||||||
@@ -316,18 +317,18 @@ class manager:
|
|||||||
# A separate function, because people may want to call it from time to time
|
# A separate function, because people may want to call it from time to time
|
||||||
def save_fastresume_data(self):
|
def save_fastresume_data(self):
|
||||||
for unique_ID in self.unique_IDs:
|
for unique_ID in self.unique_IDs:
|
||||||
flood_core.save_fastresume(unique_ID, self.unique_IDs[unique_ID].filename)
|
deluge_core.save_fastresume(unique_ID, self.unique_IDs[unique_ID].filename)
|
||||||
|
|
||||||
# State retrieval functions
|
# State retrieval functions
|
||||||
|
|
||||||
def get_state(self):
|
def get_state(self):
|
||||||
ret = flood_core.get_session_info()
|
ret = deluge_core.get_session_info()
|
||||||
|
|
||||||
# Get additional data from our level
|
# Get additional data from our level
|
||||||
ret['is_listening'] = flood_core.is_listening()
|
ret['is_listening'] = deluge_core.is_listening()
|
||||||
ret['port'] = flood_core.listening_port()
|
ret['port'] = deluge_core.listening_port()
|
||||||
if self.get_pref('use_DHT'):
|
if self.get_pref('use_DHT'):
|
||||||
ret['DHT_nodes'] = flood_core.get_DHT_info()
|
ret['DHT_nodes'] = deluge_core.get_DHT_info()
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
@@ -335,7 +336,7 @@ class manager:
|
|||||||
def get_torrent_state(self, unique_ID):
|
def get_torrent_state(self, unique_ID):
|
||||||
ret = self.get_core_torrent_state(unique_ID, True).copy()
|
ret = self.get_core_torrent_state(unique_ID, True).copy()
|
||||||
|
|
||||||
# Add the flood-level things to the flood_core data
|
# Add the deluge-level things to the deluge_core data
|
||||||
if self.get_supp_torrent_state(unique_ID) is not None:
|
if self.get_supp_torrent_state(unique_ID) is not None:
|
||||||
ret.update(self.get_supp_torrent_state(unique_ID))
|
ret.update(self.get_supp_torrent_state(unique_ID))
|
||||||
|
|
||||||
@@ -399,10 +400,10 @@ class manager:
|
|||||||
if (index < self.state.max_active_torrents or self.state_max_active_torrents == -1) \
|
if (index < self.state.max_active_torrents or self.state_max_active_torrents == -1) \
|
||||||
and self.get_core_torrent_state(unique_ID, efficient)['is_paused'] \
|
and self.get_core_torrent_state(unique_ID, efficient)['is_paused'] \
|
||||||
and not self.is_user_paused(unique_ID):
|
and not self.is_user_paused(unique_ID):
|
||||||
flood_core.resume(unique_ID)
|
deluge_core.resume(unique_ID)
|
||||||
elif not self.get_core_torrent_state(unique_ID, efficient)['is_paused'] and \
|
elif not self.get_core_torrent_state(unique_ID, efficient)['is_paused'] and \
|
||||||
(index >= self.state.max_active_torrents or self.is_user_paused(unique_ID)):
|
(index >= self.state.max_active_torrents or self.is_user_paused(unique_ID)):
|
||||||
flood_core.pause(unique_ID)
|
deluge_core.pause(unique_ID)
|
||||||
|
|
||||||
# Event handling
|
# Event handling
|
||||||
|
|
||||||
@@ -411,7 +412,7 @@ class manager:
|
|||||||
# wants to do something - show messages, for example
|
# wants to do something - show messages, for example
|
||||||
ret = []
|
ret = []
|
||||||
|
|
||||||
event = flood_core.pop_event()
|
event = deluge_core.pop_event()
|
||||||
|
|
||||||
while event is not None:
|
while event is not None:
|
||||||
# print "EVENT: ", event
|
# print "EVENT: ", event
|
||||||
@@ -444,7 +445,7 @@ class manager:
|
|||||||
"tracker_messages",
|
"tracker_messages",
|
||||||
new)
|
new)
|
||||||
|
|
||||||
event = flood_core.pop_event()
|
event = deluge_core.pop_event()
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
@@ -455,7 +456,7 @@ class manager:
|
|||||||
|
|
||||||
self.unique_IDs[unique_ID].file_filter = file_filter[:]
|
self.unique_IDs[unique_ID].file_filter = file_filter[:]
|
||||||
|
|
||||||
flood_core.set_filter_out(file_filter)
|
deluge_core.set_filter_out(file_filter)
|
||||||
|
|
||||||
def get_file_filter(self, unique_ID):
|
def get_file_filter(self, unique_ID):
|
||||||
try:
|
try:
|
||||||
@@ -476,10 +477,10 @@ class manager:
|
|||||||
# approximations anyhow
|
# approximations anyhow
|
||||||
|
|
||||||
def calc_availability(self, unique_ID):
|
def calc_availability(self, unique_ID):
|
||||||
return flood_stats.calc_availability(self.get_core_torrent_peer_info(unique_ID))
|
return deluge_stats.calc_availability(self.get_core_torrent_peer_info(unique_ID))
|
||||||
|
|
||||||
def calc_swarm_speed(self, unique_ID):
|
def calc_swarm_speed(self, unique_ID):
|
||||||
pieces_per_sec = flood_stats.calc_swarm_speed(self.get_core_torrent_peer_info(unique_ID))
|
pieces_per_sec = deluge_stats.calc_swarm_speed(self.get_core_torrent_peer_info(unique_ID))
|
||||||
piece_length = self.get_core_torrent_state(unique_ID, efficiently=True)
|
piece_length = self.get_core_torrent_state(unique_ID, efficiently=True)
|
||||||
|
|
||||||
return pieces_per_sec * piece_length
|
return pieces_per_sec * piece_length
|
||||||
@@ -494,7 +495,7 @@ class manager:
|
|||||||
return self.unique_IDs[unique_ID].user_paused
|
return self.unique_IDs[unique_ID].user_paused
|
||||||
|
|
||||||
def get_num_torrents(self):
|
def get_num_torrents(self):
|
||||||
return flood_core.get_num_torrents()
|
return deluge_core.get_num_torrents()
|
||||||
|
|
||||||
def get_unique_IDs(self):
|
def get_unique_IDs(self):
|
||||||
return self.unique_IDs.keys()
|
return self.unique_IDs.keys()
|
||||||
@@ -507,7 +508,7 @@ class manager:
|
|||||||
# Efficient: use a saved state, if it hasn't expired yet
|
# Efficient: use a saved state, if it hasn't expired yet
|
||||||
def get_core_torrent_state(self, unique_ID, efficiently=True):
|
def get_core_torrent_state(self, unique_ID, efficiently=True):
|
||||||
if unique_ID not in self.saved_core_torrent_states.keys():
|
if unique_ID not in self.saved_core_torrent_states.keys():
|
||||||
self.saved_core_torrent_states[unique_ID] = cached_data(flood_core.get_torrent_state,
|
self.saved_core_torrent_states[unique_ID] = cached_data(deluge_core.get_torrent_state,
|
||||||
unique_ID)
|
unique_ID)
|
||||||
|
|
||||||
return self.saved_core_torrent_states[unique_ID].get(efficiently)
|
return self.saved_core_torrent_states[unique_ID].get(efficiently)
|
||||||
@@ -529,7 +530,7 @@ class manager:
|
|||||||
|
|
||||||
def get_core_torrent_peer_info(self, unique_ID, efficiently=True):
|
def get_core_torrent_peer_info(self, unique_ID, efficiently=True):
|
||||||
if unique_ID not in self.saved_torrent_peer_infos.keys():
|
if unique_ID not in self.saved_torrent_peer_infos.keys():
|
||||||
self.saved_torrent_peer_infos[unique_ID] = cached_data(flood_core.get_peer_info,
|
self.saved_torrent_peer_infos[unique_ID] = cached_data(deluge_core.get_peer_info,
|
||||||
unique_ID)
|
unique_ID)
|
||||||
|
|
||||||
return self.saved_torrent_peer_infos[unique_ID].get(efficiently)
|
return self.saved_torrent_peer_infos[unique_ID].get(efficiently)
|
||||||
@@ -541,7 +542,7 @@ class manager:
|
|||||||
(temp, filename_short) = os.path.split(filename)
|
(temp, filename_short) = os.path.split(filename)
|
||||||
|
|
||||||
if filename_short in os.listdir(self.base_dir + "/" + TORRENTS_SUBDIR):
|
if filename_short in os.listdir(self.base_dir + "/" + TORRENTS_SUBDIR):
|
||||||
raise FloodError("Duplicate Torrent, it appears: " + filename_short)
|
raise DelugeError("Duplicate Torrent, it appears: " + filename_short)
|
||||||
|
|
||||||
full_new_name = self.base_dir + "/" + TORRENTS_SUBDIR + "/" + filename_short
|
full_new_name = self.base_dir + "/" + TORRENTS_SUBDIR + "/" + filename_short
|
||||||
|
|
||||||
@@ -567,7 +568,7 @@ class manager:
|
|||||||
for torrent in self.state.torrents:
|
for torrent in self.state.torrents:
|
||||||
if torrent not in torrents_with_unique_ID:
|
if torrent not in torrents_with_unique_ID:
|
||||||
# print "Adding torrent to core:", torrent.filename, torrent.save_dir, torrent.compact
|
# print "Adding torrent to core:", torrent.filename, torrent.save_dir, torrent.compact
|
||||||
unique_ID = flood_core.add_torrent(torrent.filename,
|
unique_ID = deluge_core.add_torrent(torrent.filename,
|
||||||
torrent.save_dir,
|
torrent.save_dir,
|
||||||
torrent.compact)
|
torrent.compact)
|
||||||
# print "Got unique ID:", unique_ID
|
# print "Got unique ID:", unique_ID
|
||||||
@@ -578,7 +579,7 @@ class manager:
|
|||||||
to_delete = []
|
to_delete = []
|
||||||
for torrent in self.state.torrents:
|
for torrent in self.state.torrents:
|
||||||
if torrent.delete_me:
|
if torrent.delete_me:
|
||||||
flood_core.remove_torrent(torrent.unique_ID, torrent.filename)
|
deluge_core.remove_torrent(torrent.unique_ID, torrent.filename)
|
||||||
to_delete.append(torrent.unique_ID)
|
to_delete.append(torrent.unique_ID)
|
||||||
|
|
||||||
for unique_ID in to_delete:
|
for unique_ID in to_delete:
|
||||||
@@ -593,7 +594,7 @@ class manager:
|
|||||||
|
|
||||||
assert(len(self.unique_IDs) == len(self.state.torrents))
|
assert(len(self.unique_IDs) == len(self.state.torrents))
|
||||||
assert(len(self.unique_IDs) == len(self.state.queue))
|
assert(len(self.unique_IDs) == len(self.state.queue))
|
||||||
assert(len(self.unique_IDs) == flood_core.get_num_torrents())
|
assert(len(self.unique_IDs) == deluge_core.get_num_torrents())
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
@@ -12,9 +12,10 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program. If not, write to:
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# The Free Software Foundation, Inc.,
|
||||||
#
|
# 51 Franklin Street, Fifth Floor
|
||||||
|
# Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
@@ -64,7 +65,7 @@ def calc_swarm_speed(peer_info):
|
|||||||
if delta >= 0:
|
if delta >= 0:
|
||||||
new_pieces = new_pieces + delta
|
new_pieces = new_pieces + delta
|
||||||
else:
|
else:
|
||||||
print "Flood.stat.calc_swarm_speed: Bad Delta: ", delta, old_peer_IPs[new_IP].pieces, new_peer_IPs[new_IP].pieces
|
print "Deluge.stat.calc_swarm_speed: Bad Delta: ", delta, old_peer_IPs[new_IP].pieces, new_peer_IPs[new_IP].pieces
|
||||||
|
|
||||||
# Calculate final value
|
# Calculate final value
|
||||||
time_delta = time.time() - old_peer_info_timestamp
|
time_delta = time.time() - old_peer_info_timestamp
|
||||||
|
16
delugegtk.py
16
delugegtk.py
@@ -4,20 +4,18 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) Zach Tibbitts 2006 <zach@collegegeek.org>
|
# Copyright (C) Zach Tibbitts 2006 <zach@collegegeek.org>
|
||||||
#
|
#
|
||||||
# Deluge is free software.
|
# This program is free software; you can redistribute it and/or modify
|
||||||
#
|
# it under the terms of the GNU General Public License as published by
|
||||||
# You may redistribute it and/or modify it under the terms of the
|
# the Free Software Foundation; either version 2, or (at your option)
|
||||||
# GNU General Public License, as published by the Free Software
|
|
||||||
# Foundation; either version 2 of the License, or (at your option)
|
|
||||||
# any later version.
|
# any later version.
|
||||||
#
|
#
|
||||||
# delugegtk.py is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# See the GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with main.py. If not, write to:
|
# along with this program. If not, write to:
|
||||||
# The Free Software Foundation, Inc.,
|
# The Free Software Foundation, Inc.,
|
||||||
# 51 Franklin Street, Fifth Floor
|
# 51 Franklin Street, Fifth Floor
|
||||||
# Boston, MA 02110-1301, USA.
|
# Boston, MA 02110-1301, USA.
|
||||||
|
24
delugeplugins.py
Normal file
24
delugeplugins.py
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
#
|
||||||
|
# delugeplugins.py
|
||||||
|
#
|
||||||
|
# Copyright (C) Zach Tibbitts 2006 <zach@collegegeek.org>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, write to:
|
||||||
|
# The Free Software Foundation, Inc.,
|
||||||
|
# 51 Franklin Street, Fifth Floor
|
||||||
|
# Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
class PluginManager:
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
21
dgtk.py
21
dgtk.py
@@ -2,27 +2,24 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) Zach Tibbitts 2006 <zach@collegegeek.org>
|
# Copyright (C) Zach Tibbitts 2006 <zach@collegegeek.org>
|
||||||
#
|
#
|
||||||
# Deluge is free software.
|
# This program is free software; you can redistribute it and/or modify
|
||||||
#
|
# it under the terms of the GNU General Public License as published by
|
||||||
# You may redistribute it and/or modify it under the terms of the
|
# the Free Software Foundation; either version 2, or (at your option)
|
||||||
# GNU General Public License, as published by the Free Software
|
|
||||||
# Foundation; either version 2 of the License, or (at your option)
|
|
||||||
# any later version.
|
# any later version.
|
||||||
#
|
#
|
||||||
# dgtk.py is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# See the GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with main.py. If not, write to:
|
# along with this program. If not, write to:
|
||||||
# The Free Software Foundation, Inc.,
|
# The Free Software Foundation, Inc.,
|
||||||
# 51 Franklin Street, Fifth Floor
|
# 51 Franklin Street, Fifth Floor
|
||||||
# Boston, MA 02110-1301, USA.
|
# Boston, MA 02110-1301, USA.
|
||||||
#
|
|
||||||
#
|
|
||||||
# Similar to dcommon, this contains any common functions
|
# Similar to dcommon, this contains any common functions
|
||||||
# related to gtk
|
# related to gtk that are needed by the client
|
||||||
|
|
||||||
import dcommon
|
import dcommon
|
||||||
import gettext
|
import gettext
|
||||||
|
15
setup.py
15
setup.py
@@ -2,8 +2,6 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2006 Zach Tibbitts ('zachtib') <zach@collegegeek.org>
|
# Copyright (c) 2006 Zach Tibbitts ('zachtib') <zach@collegegeek.org>
|
||||||
#
|
#
|
||||||
# 2006-15-9
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
# the Free Software Foundation; either version 2, or (at your option)
|
||||||
@@ -15,9 +13,10 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program. If not, write to:
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# The Free Software Foundation, Inc.,
|
||||||
#
|
# 51 Franklin Street, Fifth Floor
|
||||||
|
# Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
import platform, os
|
import platform, os
|
||||||
|
|
||||||
@@ -70,11 +69,13 @@ deluge_core = Extension('deluge_core',
|
|||||||
|
|
||||||
setup(name="deluge", fullname="Deluge Bittorrent Client", version="0.5.0",
|
setup(name="deluge", fullname="Deluge Bittorrent Client", version="0.5.0",
|
||||||
author="Zach Tibbitts, Alon Zakai",
|
author="Zach Tibbitts, Alon Zakai",
|
||||||
|
author_email="zach@collegegeek.org, kripkensteiner@gmail.com",
|
||||||
description="A bittorrent client written in PyGTK",
|
description="A bittorrent client written in PyGTK",
|
||||||
url="http://deluge-torrent.org",
|
url="http://deluge-torrent.org",
|
||||||
license="GPLv2",
|
license="GPLv2",
|
||||||
scripts=["scripts/deluge"],
|
scripts=["scripts/deluge"],
|
||||||
py_modules=["deluge", "deluge_stats", "delugegtk", "dgtk", "dcommon"],
|
py_modules=["deluge", "deluge_stats", "delugegtk", "dgtk", "dcommon", "delugeplugins"],
|
||||||
data_files=[("share/glade", ["glade/delugegtk.glade", "glade/dgtkpopups.glade", "glade/dgtkpref.glade"])],
|
data_files=[("share/deluge/glade", ["glade/delugegtk.glade", "glade/dgtkpopups.glade", "glade/dgtkpref.glade"]),
|
||||||
|
("share/deluge/pixmaps", ["pixmaps/deluge32.png","pixmaps/deluge128.png"])],
|
||||||
ext_modules=[deluge_core]
|
ext_modules=[deluge_core]
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user