Compare commits
25 Commits
deluge-1.2
...
archive/1.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8c36830456 | ||
![]() |
568321a8ed | ||
![]() |
2c10218efd | ||
![]() |
ee73936c26 | ||
![]() |
d299ecedb2 | ||
![]() |
0b609bf4ad | ||
![]() |
131af5a50a | ||
![]() |
65b4f8c543 | ||
![]() |
e79461c7d2 | ||
![]() |
c1f137505a | ||
![]() |
f598d048d1 | ||
![]() |
4f134731df | ||
![]() |
de25c17af1 | ||
![]() |
41314e595a | ||
![]() |
e5e43532d3 | ||
![]() |
9e4a92444b | ||
![]() |
72fd3bd061 | ||
![]() |
cc086917c1 | ||
![]() |
3e0a35c802 | ||
![]() |
4a2316411d | ||
![]() |
1b54d5b93b | ||
![]() |
64d927b499 | ||
![]() |
3e639c3445 | ||
![]() |
ec39a8d501 | ||
![]() |
90103358f3 |
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -6,3 +6,4 @@ docs/source export-ignore
|
||||
deluge/scripts export-ignore
|
||||
.gitattributes export-ignore
|
||||
.gitmodules export-ignore
|
||||
.gitignore export-ignore
|
||||
|
8
.gitignore
vendored
Normal file
8
.gitignore
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
*~
|
||||
build
|
||||
dist
|
||||
*egg-info
|
||||
*.egg
|
||||
*.log
|
||||
*.pyc
|
||||
*.tar.*
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -1,3 +0,0 @@
|
||||
[submodule "libtorrent"]
|
||||
path = libtorrent
|
||||
url = git://deluge-torrent.org/libtorrent
|
18
ChangeLog
18
ChangeLog
@@ -1,23 +1,31 @@
|
||||
=== Deluge 1.2.3 (27 March 2010) ===
|
||||
==== Core ====
|
||||
* Fix libtorrent version compare to use a proper numerical compare instead
|
||||
of string. This fixes a problem where using lt 0.14.10 wouldn't allow
|
||||
Deluge to start.
|
||||
* Fix libtorrent 0.15 compatibility
|
||||
* Fix hang on quit
|
||||
|
||||
=== Deluge 1.2.2 (19 March 2010) ===
|
||||
==== Core ====
|
||||
* Fix #1109 auto add halting when a torrent with invalid filename encoding
|
||||
* Fix #1109 auto add halting when a torrent with invalid filename encoding
|
||||
is in the directory
|
||||
|
||||
==== GtkUI ====
|
||||
* Fix #1162 problem with the queued torrents dialog from not properly adding
|
||||
* Fix #1162 problem with the queued torrents dialog from not properly adding
|
||||
to the add torrent dialog if set to auto add
|
||||
* Fix #1172 notify startup complete when adding torrents externally
|
||||
* Fix issue where the gtkui sometimes won't start if there is a stale lock
|
||||
file or socket in the ipc/ directory.
|
||||
|
||||
|
||||
==== Console ====
|
||||
* Fix #1143 deluge-console crashes when tab-completing not-existent directory
|
||||
|
||||
|
||||
=== Deluge 1.2.1 (20 February 2010) ===
|
||||
==== Core ====
|
||||
* Make Deluge dependent upon libtorrent 0.14.9 or greater. This is due to
|
||||
an over-downloading bug in previous versions of libtorrent.
|
||||
|
||||
|
||||
==== GtkUI ====
|
||||
* Fix #1128 Show an error dialog when unable to start a 'deluged' process
|
||||
* Increased max enterable download / upload limit to 60000 KiB/s
|
||||
|
@@ -210,7 +210,7 @@ def open_url_in_browser(url):
|
||||
|
||||
:param url: the url to open
|
||||
:type url: string
|
||||
|
||||
|
||||
"""
|
||||
import webbrowser
|
||||
webbrowser.open(url)
|
||||
@@ -469,13 +469,13 @@ def free_space(path):
|
||||
:type path: string
|
||||
:returns: the free space at path in bytes
|
||||
:rtype: int
|
||||
|
||||
|
||||
:raises InvalidPathError: if the path is not valid
|
||||
|
||||
"""
|
||||
if not os.path.exists(path):
|
||||
raise InvalidPathError("%s is not a valid path" % path)
|
||||
|
||||
|
||||
if windows_check():
|
||||
import win32file
|
||||
sectors, bytes, free, total = map(long, win32file.GetDiskFreeSpace(path))
|
||||
@@ -514,19 +514,19 @@ def is_ip(ip):
|
||||
return True
|
||||
except socket.error:
|
||||
return False
|
||||
|
||||
|
||||
class VersionSplit(object):
|
||||
"""
|
||||
Used for comparing version numbers.
|
||||
|
||||
|
||||
:param ver: the version
|
||||
:type ver: string
|
||||
|
||||
|
||||
"""
|
||||
def __init__(self, ver):
|
||||
ver = ver.lower()
|
||||
vs = ver.split("_") if "_" in ver else ver.split("-")
|
||||
self.version = vs[0]
|
||||
self.version = [int(x) for x in vs[0].split(".")]
|
||||
self.suffix = None
|
||||
if len(vs) > 1:
|
||||
for s in ("rc", "alpha", "beta", "dev"):
|
||||
@@ -536,12 +536,12 @@ class VersionSplit(object):
|
||||
def __cmp__(self, ver):
|
||||
"""
|
||||
The comparison method.
|
||||
|
||||
|
||||
:param ver: the version to compare with
|
||||
:type ver: VersionSplit
|
||||
|
||||
|
||||
"""
|
||||
|
||||
|
||||
if self.version > ver.version or (self.suffix and self.suffix[:3] == "dev"):
|
||||
return 1
|
||||
if self.version < ver.version:
|
||||
|
@@ -299,14 +299,11 @@ class Torrent:
|
||||
log.debug("Setting trackers for %s: %s", self.torrent_id, trackers)
|
||||
tracker_list = []
|
||||
|
||||
if lt.version_minor < 15:
|
||||
for tracker in trackers:
|
||||
new_entry = lt.announce_entry(tracker["url"])
|
||||
new_entry.tier = tracker["tier"]
|
||||
tracker_list.append(new_entry)
|
||||
self.handle.replace_trackers(tracker_list)
|
||||
else:
|
||||
self.handle.replace_trackers(trackers)
|
||||
for tracker in trackers:
|
||||
new_entry = lt.announce_entry(tracker["url"])
|
||||
new_entry.tier = tracker["tier"]
|
||||
tracker_list.append(new_entry)
|
||||
self.handle.replace_trackers(tracker_list)
|
||||
|
||||
# Print out the trackers
|
||||
#for t in self.handle.trackers():
|
||||
@@ -334,6 +331,10 @@ class Torrent:
|
||||
LTSTATE = deluge.common.LT_TORRENT_STATE
|
||||
ltstate = int(self.handle.status().state)
|
||||
|
||||
# Set self.state to the ltstate right away just incase we don't hit some
|
||||
# of the logic below
|
||||
self.state = str(ltstate)
|
||||
|
||||
log.debug("set_state_based_on_ltstate: %s", deluge.common.LT_TORRENT_STATE[ltstate])
|
||||
log.debug("session.is_paused: %s", component.get("Core").session.is_paused())
|
||||
|
||||
@@ -739,6 +740,9 @@ class Torrent:
|
||||
|
||||
def move_storage(self, dest):
|
||||
"""Move a torrent's storage location"""
|
||||
if not os.path.exists(dest):
|
||||
log.error("Could not move storage for torrent %s since %s does not exist!", self.torrent_id, dest)
|
||||
return False
|
||||
try:
|
||||
self.handle.move_storage(dest.encode("utf8"))
|
||||
except:
|
||||
|
@@ -197,6 +197,11 @@ this should be an IP address", metavar="IFACE",
|
||||
write_pidfile()
|
||||
|
||||
# Setup the logger
|
||||
try:
|
||||
# Try to make the logfile's directory if it doesn't exist
|
||||
os.makedirs(os.path.abspath(os.path.dirname(options.logfile)))
|
||||
except:
|
||||
pass
|
||||
deluge.log.setupLogger(level=options.loglevel, filename=options.logfile)
|
||||
from deluge.log import LOG as log
|
||||
|
||||
|
@@ -410,7 +410,7 @@ class DaemonClassicProxy(DaemonProxy):
|
||||
self.connected = True
|
||||
self.host = "localhost"
|
||||
self.port = 58846
|
||||
self.user = "localclient"
|
||||
self.username = "localclient"
|
||||
# Register the event handlers
|
||||
for event in event_handlers:
|
||||
for handler in event_handlers[event]:
|
||||
|
@@ -99,12 +99,16 @@ class ConnectionManager(component.Component):
|
||||
|
||||
self.config = ConfigManager("hostlist.conf.1.2", DEFAULT_CONFIG)
|
||||
|
||||
self.running = False
|
||||
|
||||
# Component overrides
|
||||
def start(self):
|
||||
pass
|
||||
|
||||
def stop(self):
|
||||
pass
|
||||
# Close this dialog when we are shutting down
|
||||
if self.running:
|
||||
self.connection_manager.response(gtk.RESPONSE_CLOSE)
|
||||
|
||||
def shutdown(self):
|
||||
pass
|
||||
|
@@ -210,7 +210,7 @@ class CreateTorrentDialog:
|
||||
client.core.get_path_size(result).addCallback(_on_get_path_size)
|
||||
client.force_call(True)
|
||||
|
||||
dialog.destroy()
|
||||
dialog.hide()
|
||||
|
||||
def _on_button_cancel_clicked(self, widget):
|
||||
log.debug("_on_button_cancel_clicked")
|
||||
@@ -224,11 +224,14 @@ class CreateTorrentDialog:
|
||||
is_remote = self.files_treestore[0][1] == gtk.STOCK_NETWORK
|
||||
if is_remote:
|
||||
# This is a remote path
|
||||
response = self.glade.get_widget("remote_save_dialog").run()
|
||||
dialog = self.glade.get_widget("remote_save_dialog")
|
||||
response = dialog.run()
|
||||
if response == gtk.RESPONSE_OK:
|
||||
result = self.glade.get_widget("entry_save_path").get_text()
|
||||
else:
|
||||
dialog.hide()
|
||||
return
|
||||
dialog.hide()
|
||||
else:
|
||||
# Setup the filechooserdialog
|
||||
chooser = gtk.FileChooserDialog(_("Save .torrent file"),
|
||||
@@ -340,7 +343,6 @@ class CreateTorrentDialog:
|
||||
trackers,
|
||||
add_to_session).addCallback(hide_progress)
|
||||
|
||||
chooser.destroy()
|
||||
self.dialog.destroy()
|
||||
|
||||
def create_torrent(self, path, tracker, piece_length, progress, comment, target,
|
||||
|
@@ -167,7 +167,7 @@ class GtkUI(object):
|
||||
self.gnome_prog = gnome.init("Deluge", deluge.common.get_version())
|
||||
self.gnome_client = gnome.ui.master_client()
|
||||
def on_die(*args):
|
||||
gtk.main_quit()
|
||||
reactor.stop()
|
||||
self.gnome_client.connect("die", on_die)
|
||||
log.debug("GNOME session 'die' handler registered!")
|
||||
except Exception, e:
|
||||
@@ -180,7 +180,7 @@ class GtkUI(object):
|
||||
def win_handler(ctrl_type):
|
||||
log.debug("ctrl_type: %s", ctrl_type)
|
||||
if ctrl_type in (CTRL_CLOSE_EVENT, CTRL_SHUTDOWN_EVENT):
|
||||
gtk.main_quit()
|
||||
reactor.stop()
|
||||
return 1
|
||||
SetConsoleCtrlHandler(win_handler)
|
||||
|
||||
|
@@ -46,6 +46,7 @@ from deluge.ui.client import client
|
||||
import deluge.component as component
|
||||
from deluge.configmanager import ConfigManager
|
||||
from deluge.ui.gtkui.ipcinterface import process_args
|
||||
from twisted.internet import reactor
|
||||
|
||||
import deluge.common
|
||||
import common
|
||||
@@ -151,8 +152,16 @@ class MainWindow(component.Component):
|
||||
"""Returns a reference to the main window glade object."""
|
||||
return self.main_glade
|
||||
|
||||
def quit(self):
|
||||
gtk.main_quit()
|
||||
def quit(self, shutdown=False):
|
||||
"""
|
||||
Quits the GtkUI
|
||||
|
||||
:param shutdown: whether or not to shutdown the daemon as well
|
||||
:type shutdown: boolean
|
||||
"""
|
||||
if shutdown:
|
||||
client.daemon.shutdown()
|
||||
reactor.stop()
|
||||
|
||||
def load_window_state(self):
|
||||
x = self.config["window_x_pos"]
|
||||
@@ -238,7 +247,6 @@ class MainWindow(component.Component):
|
||||
|
||||
def on_newversionavailable_event(self, new_version):
|
||||
if self.config["show_new_releases"]:
|
||||
from twisted.internet import reactor
|
||||
from deluge.ui.gtkui.new_release_dialog import NewReleaseDialog
|
||||
reactor.callLater(5.0, NewReleaseDialog().show, new_version)
|
||||
|
||||
|
@@ -253,15 +253,10 @@ class MenuBar(component.Component):
|
||||
|
||||
def on_menuitem_quitdaemon_activate(self, data=None):
|
||||
log.debug("on_menuitem_quitdaemon_activate")
|
||||
# Tell the core to shutdown
|
||||
def on_shutdown(result):
|
||||
self.window.quit()
|
||||
client.daemon.shutdown().addCallback(on_shutdown)
|
||||
self.window.quit(shutdown=True)
|
||||
|
||||
def on_menuitem_quit_activate(self, data=None):
|
||||
log.debug("on_menuitem_quit_activate")
|
||||
if self.config["classic_mode"] and client.is_classicmode():
|
||||
client.daemon.shutdown()
|
||||
self.window.quit()
|
||||
|
||||
## Edit Menu ##
|
||||
|
@@ -324,9 +324,6 @@ class SystemTray(component.Component):
|
||||
if self.config["lock_tray"] and not self.window.visible():
|
||||
self.unlock_tray()
|
||||
|
||||
if self.config["classic_mode"]:
|
||||
client.daemon.shutdown()
|
||||
|
||||
self.window.quit()
|
||||
|
||||
def on_menuitem_quitdaemon_activate(self, menuitem):
|
||||
@@ -334,8 +331,7 @@ class SystemTray(component.Component):
|
||||
if self.config["lock_tray"] and not self.window.visible():
|
||||
self.unlock_tray()
|
||||
|
||||
client.daemon.shutdown()
|
||||
self.window.quit()
|
||||
self.window.quit(shutdown=True)
|
||||
|
||||
def tray_setbwdown(self, widget, data=None):
|
||||
self.setbwlimit(widget, _("Set Maximum Download Speed"), "max_download_speed",
|
||||
|
@@ -1,4 +1,4 @@
|
||||
.TH DELUGE-CONSOLE 1 "October 2009" "1.2.2"
|
||||
.TH DELUGE-CONSOLE 1 "October 2009" "1.2.3"
|
||||
|
||||
.SH NAME
|
||||
deluge-console - a bittorrent client curses interface
|
||||
|
@@ -1,4 +1,4 @@
|
||||
.TH DELUGE-GTK 1 "October 2009" "1.2.2"
|
||||
.TH DELUGE-GTK 1 "October 2009" "1.2.3"
|
||||
|
||||
.SH NAME
|
||||
deluge-gtk - a bittorrent client gtk interface
|
||||
|
@@ -1,4 +1,4 @@
|
||||
.TH DELUGE-WEB 1 "October 2009" "1.2.2"
|
||||
.TH DELUGE-WEB 1 "October 2009" "1.2.3"
|
||||
|
||||
.SH NAME
|
||||
deluge-web - a bittorrent client ajax web interface
|
||||
|
@@ -1,4 +1,4 @@
|
||||
.TH DELUGE 1 "October 2009" "1.2.2"
|
||||
.TH DELUGE 1 "October 2009" "1.2.3"
|
||||
|
||||
.SH NAME
|
||||
deluge - a bittorrent client
|
||||
|
@@ -1,4 +1,4 @@
|
||||
.TH DELUGED 1 "October 2009" "1.2.2"
|
||||
.TH DELUGED 1 "October 2009" "1.2.3"
|
||||
|
||||
.SH NAME
|
||||
deluged - a bittorrent client daemon
|
||||
@@ -27,8 +27,10 @@ Port daemon will listen on, default is 58846
|
||||
.TP
|
||||
.I -i INTERFACE, --interface=INTERFACE
|
||||
Interface daemon will listen for bittorrent connections on, this should be an IP address
|
||||
.TP
|
||||
.I -u UI_INTERFACE, --ui-interface=UI_INTERFACE
|
||||
Interface daemon will listen for UI connections on, this should be an IP address
|
||||
.TP
|
||||
.I -d, --do-not-daemonize
|
||||
Do not daemonize
|
||||
.TP
|
||||
|
16
get_libtorrent.sh
Executable file
16
get_libtorrent.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# This script checks out libtorrent from subversion
|
||||
#
|
||||
|
||||
SVN=$(which svn)
|
||||
LT_URL=https://libtorrent.svn.sourceforge.net/svnroot/libtorrent
|
||||
VERSION=14
|
||||
[ "$1" != "" ] && VERSION=$1
|
||||
BRANCH=branches/RC_0_$VERSION
|
||||
|
||||
if [ -d libtorrent ]; then
|
||||
$SVN up libtorrent
|
||||
else
|
||||
$SVN co $LT_URL/$BRANCH libtorrent
|
||||
fi
|
Submodule libtorrent deleted from a069275ba2
35
setup.py
35
setup.py
@@ -211,18 +211,29 @@ except ImportError:
|
||||
else:
|
||||
build_libtorrent = False
|
||||
|
||||
if build_libtorrent and os.path.exists("libtorrent") and os.listdir("libtorrent"):
|
||||
# There isn't a system libtorrent library, so let's build the one included with deluge
|
||||
libtorrent = Extension(
|
||||
'libtorrent',
|
||||
extra_compile_args = _extra_compile_args,
|
||||
include_dirs = _include_dirs,
|
||||
libraries = _libraries,
|
||||
library_dirs = _library_dirs,
|
||||
sources = _sources
|
||||
)
|
||||
if build_libtorrent:
|
||||
got_libtorrent = False
|
||||
if not os.path.exists("libtorrent"):
|
||||
import subprocess
|
||||
if subprocess.call(['./get_libtorrent.sh']) > 0:
|
||||
got_libtorrent = False
|
||||
else:
|
||||
got_libtorrent = True
|
||||
else:
|
||||
got_libtorrent = True
|
||||
|
||||
_ext_modules = [libtorrent]
|
||||
if got_libtorrent:
|
||||
# There isn't a system libtorrent library, so let's build the one included with deluge
|
||||
libtorrent = Extension(
|
||||
'libtorrent',
|
||||
extra_compile_args = _extra_compile_args,
|
||||
include_dirs = _include_dirs,
|
||||
libraries = _libraries,
|
||||
library_dirs = _library_dirs,
|
||||
sources = _sources
|
||||
)
|
||||
|
||||
_ext_modules = [libtorrent]
|
||||
|
||||
class build_trans(cmd.Command):
|
||||
description = 'Compile .po files into .mo files'
|
||||
@@ -397,7 +408,7 @@ _data_files = [
|
||||
# Main setup
|
||||
setup(
|
||||
name = "deluge",
|
||||
version = "1.2.2",
|
||||
version = "1.2.3",
|
||||
fullname = "Deluge Bittorrent Client",
|
||||
description = "Bittorrent Client",
|
||||
author = "Andrew Resch, Damien Churchill",
|
||||
|
54
tests/test_common.py
Normal file
54
tests/test_common.py
Normal file
@@ -0,0 +1,54 @@
|
||||
from twisted.trial import unittest
|
||||
from deluge.common import *
|
||||
import os
|
||||
|
||||
class CommonTestCase(unittest.TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def test_fsize(self):
|
||||
self.failUnless(fsize(112245) == "109.6 KiB")
|
||||
|
||||
def test_fpcnt(self):
|
||||
self.failUnless(fpcnt(0.9311) == "93.11%")
|
||||
|
||||
def test_fspeed(self):
|
||||
self.failUnless(fspeed(43134) == "42.1 KiB/s")
|
||||
|
||||
def test_fpeer(self):
|
||||
self.failUnless(fpeer(10, 20) == "10 (20)")
|
||||
self.failUnless(fpeer(10, -1) == "10")
|
||||
|
||||
def test_ftime(self):
|
||||
self.failUnless(ftime(23011) == "6h 23m")
|
||||
|
||||
def test_fdate(self):
|
||||
self.failUnless(fdate(-1) == "")
|
||||
|
||||
def test_is_url(self):
|
||||
self.failUnless(is_url("http://deluge-torrent.org"))
|
||||
self.failIf(is_url("file://test.torrent"))
|
||||
|
||||
def test_is_magnet(self):
|
||||
self.failUnless(is_magnet("magnet:?xt=urn:btih:SU5225URMTUEQLDXQWRB2EQWN6KLTYKN"))
|
||||
|
||||
def test_get_path_size(self):
|
||||
self.failUnless(get_path_size(os.devnull) == 0)
|
||||
self.failUnless(get_path_size("non-existant.file") == -1)
|
||||
|
||||
def test_is_ip(self):
|
||||
self.failUnless(is_ip("127.0.0.1"))
|
||||
self.failIf(is_ip("127..0.0"))
|
||||
|
||||
def test_VersionSplit(self):
|
||||
self.failUnless(VersionSplit("1.2.2") == VersionSplit("1.2.2"))
|
||||
self.failUnless(VersionSplit("1.2.1") < VersionSplit("1.2.2"))
|
||||
self.failUnless(VersionSplit("1.1.9") < VersionSplit("1.2.2"))
|
||||
self.failUnless(VersionSplit("1.2.2") > VersionSplit("1.2.1"))
|
||||
self.failIf(VersionSplit("1.2.2") == VersionSplit("1.2.2-dev"))
|
||||
self.failUnless(VersionSplit("0.14.9") == VersionSplit("0.14.9"))
|
||||
self.failUnless(VersionSplit("0.14.9") > VersionSplit("0.14.5"))
|
||||
self.failUnless(VersionSplit("0.14.10") >= VersionSplit("0.14.9"))
|
@@ -1,4 +1,4 @@
|
||||
build_version = "1.2.2"
|
||||
build_version = "1.2.3"
|
||||
python_path = "C:\\Python26\\"
|
||||
|
||||
import shutil
|
||||
|
@@ -37,7 +37,7 @@ SetCompressor lzma
|
||||
|
||||
# Deluge program information
|
||||
!define PROGRAM_NAME "Deluge"
|
||||
!define PROGRAM_VERSION "1.2.2"
|
||||
!define PROGRAM_VERSION "1.2.3"
|
||||
!define PROGRAM_WEB_SITE "http://deluge-torrent.org"
|
||||
|
||||
# Python files generated with bbfreeze (without DLLs from GTK+ runtime)
|
||||
@@ -300,4 +300,4 @@ Section Uninstall
|
||||
DELUGE_skip_delete:
|
||||
# This key is only used by Deluge, so we should always delete it
|
||||
DeleteRegKey HKCR "Deluge"
|
||||
SectionEnd
|
||||
SectionEnd
|
||||
|
Reference in New Issue
Block a user