Compare commits

...

1151 Commits

Author SHA1 Message Date
4dd6308db9 Add get_version script to automate release versions (PEP386 naming) 2013-05-01 05:24:36 +01:00
289730a3e3 Make sure prioritize first/last doesn't enable pieces in
a file marked do not download. refs #2211
2013-04-29 18:07:04 -04:00
1d34d5f6a5 Fix #1840 : Refactor last_seen_complete code 2013-04-29 22:32:01 +01:00
64e1ab481b remove libtorrent build code 2013-04-06 12:51:20 +01:00
c92b3debb7 raise lt version 2013-03-29 23:52:26 +00:00
68c41e2915 Update DEPENDS 2013-03-29 23:15:32 +00:00
31929c7004 Change to using pop_alerts to get batches of alerts and save calls
Requires libtorrent >=0.16.7
2013-03-29 23:14:18 +00:00
937419bfcd Update Extractor plugin description, version and modify log levels 2013-03-26 19:45:29 +00:00
9b3ff8f1b8 Fix #2290 : Extractor: Dotted filenames being rejected 2013-03-26 19:18:07 +00:00
a44d86f285 Fix scalable icon install dir 2013-03-24 23:45:39 +00:00
400bd86749 Add pango env vars to osx package script 2013-03-17 19:26:33 +00:00
31ec8830f4 Update osx build and packaging scripts 2013-03-17 18:16:23 +00:00
2a3eb7b70c Fixes bug in core.get_torrents_status where diff was always False
Fixes bug introduced in 5cd86aa5bc where the diff
argument passed to torrentmanager.torrents_status_update is always False
instead of the value passed into get_torrents_status. This causes the sessionproxy
not to function properly which in turn increases CPU usage in the UIs.
2013-03-03 11:29:49 +01:00
e183e2ff04 Fix issue with Plugins that add Tab to torrentdetails 2013-02-27 17:46:46 +00:00
7598312969 Update .gitattributes, Changelog and man files 2013-02-25 23:00:13 +00:00
e62f79d9ae Extractor: Refactor and fix tar.* issue on windows 2013-02-23 02:07:53 +00:00
662849c0c2 Update Extractor with Win32 and extra archives support
Also disabled extracting on move_completed enabled torrents and fixed
some other small issues.
2013-02-23 02:06:32 +00:00
10251e460b Add a new DelugeStart theme to win32 gtk
This theme is based upon ANewStart theme and uses murrine theme engine.
2013-02-22 19:18:28 +00:00
6f9d69f9f3 Disable unused torrentview reordering property which fixes Win32 mouse scroll bug 2013-02-22 01:08:40 +00:00
091b42d317 GTKUI: Changes to autofill save path when creating torrent from remote path 2013-02-21 16:43:50 +00:00
463ac0c07e Optimized torrentview.cell_data_trackericon
cell_data_trackericon would load the tracker icon with
gtk.gdk.pixbuf_new_from_file_at_size each time it's requested.
These regular requests acumulating to thousands calls to
pixbuf_new_from_file_at_size with a big torrent list.

Now, read the tracker icon from disk once, and cache it.
2013-02-17 18:41:35 +00:00
836178a0da Replace Exception with GError in filtertreeview 2013-02-17 18:40:51 +00:00
1d9b550e35 Replace decode with decode_string 2013-02-17 16:19:13 +00:00
93d4e345b8 Update Changelog 2013-02-17 16:06:49 +00:00
a7cda7011b Build webui js and gettext 2013-02-17 16:06:37 +00:00
763af17e71 Add tracker host details to debug logging 2013-02-17 16:04:22 +00:00
83df1159c0 Fix glade issues in previous commit 2013-02-15 18:04:32 +00:00
a7c5b9f568 Add OSX packaging and GTK support 2013-02-14 00:36:46 +00:00
0da88fc74b GTK: Fix showing exception error to user with no libtorrent installed 2013-02-13 01:33:24 +00:00
b82b313e32 Fix GTK ConnMgr update after stopping daemon and reduce wait time 2013-02-13 01:33:06 +00:00
36d8c5517f Fix renaming folders on libtorrent 0.16 compiled with unicode support (Windows) 2013-02-11 21:26:16 -05:00
b08573831e Merge remote-tracking branch 'bro/master-torrent-encoding-cleanup' 2013-02-11 21:07:11 -05:00
41e3b01285 Removed redundant has_metadata function from torrent.py 2013-02-11 20:17:32 -05:00
cdfb337bae Added GtkAdjustment to the port spinbutton 2013-02-11 20:11:00 -05:00
31ecaacbc8 Replaced ti_-functions with lambdas 2013-02-12 01:21:32 +01:00
5bcb104a01 Cleaned up torrents.py and small change to decode_string
Replaced some try/except-decoding with decode_string.
Removed redundant methods ti_name and apply_options.
In decode_string - changed last encoding (with ignore) from
chardet-detected to the encoding specified in key-argument.
2013-02-12 01:14:57 +01:00
6c75201b2e Fix setting 1GB/s speeds in gtkui 2013-02-11 19:27:07 +00:00
54491a9eaf Add exception details to EventManager error log 2013-02-11 18:38:00 +00:00
c11262082e Fix an issue with daemon speedups with file priorities for magnets
Ensure prioritize_first_last gets set properly for magnets
2013-02-10 23:57:46 -05:00
8c106ce8c4 Merge remote-tracking branch 'bro/master-daemon-optimize-speed'
Conflicts:
	deluge/core/alertmanager.py
	deluge/core/torrentmanager.py
2013-02-10 17:30:25 -05:00
b4f5e78a77 Merge remote-tracking branch 'bro/master-torrentview-speedups' 2013-02-10 17:18:25 -05:00
8735fe14a8 Fix #2258 : Potential runtimeError when emiting event 2013-02-05 18:56:55 +00:00
01c501b172 Fix #2260 : Add dialog pulling main window to active workspace 2013-02-05 18:34:10 +00:00
1f12bab923 Fix #2242 : Notifications: Missing word in torrent finished message 2013-02-04 14:32:39 +00:00
810495264f WebUI: Add failed login log message with IP address for fail2ban 2013-02-04 14:32:32 +00:00
754035c722 Fix #2261 : WebUI: Proxy settings not being saved 2013-02-04 14:32:07 +00:00
fbdda1b3a5 Fixed bug in torrentmanager.separate_keys
If none of the torrent_id's were present in self.torrents,
None would be returned.
2013-01-25 20:13:54 +01:00
a992d8685f Fix issue with downloaded torrent temp files on windows which had illegal characters. 2013-01-20 19:53:26 -05:00
763f5de904 Replace hotspot with cProfile for daemon
Added a twisted signal handler to save profiler stats when
deluged is killed with SIGINT.
2013-01-19 02:23:01 +00:00
4b99a39779 Added decode_string on all calls to alert.message() 2013-01-19 01:41:14 +01:00
5e19fd0122 Fixed bug with handling adding/removing columns in GTKUI.
Also reinserted two lines that were lost when porting patch to master
2013-01-18 23:25:43 +01:00
823a1f0fc4 Make sure sessionproxy events are registered after stopping and starting a daemon from gtkui. 2013-01-17 22:21:03 -05:00
f3722ebc4f Don't deliver empty resume_data parameter to session.add_torrent
Fixes a libtorrent crash on python 2.7 on Windows
2013-01-17 22:19:38 -05:00
fbeea9159e Removed debug print 2013-01-16 00:08:00 +01:00
0f67dc168b Improvements and bug fixes 2013-01-15 23:40:53 +01:00
5cd86aa5bc Optimizations to daemon and rpc messages.
* Implemented torrent updates with libtorrent post_torrent_updates.
  This required some changes to how core/torrenthandler
  handles get_torrent_status
* Reworked how torrent.py handles torrent info
* Removed some unneeded RPC message requests from client.
* Added tests for some expensive log prints.
2013-01-14 03:14:28 +01:00
8cb55983bb Add move complete location to webui add torrent dialog. 2013-01-04 19:19:58 -05:00
ffcfc060e9 Fix mapped_files error in AddTorrentDialog 2013-01-03 17:33:15 +00:00
6313ff19b3 Improved the speed of set_prioritize_first_last in torrent.py
set_prioritize_first_last is rewritten for better performance, and is now only called when necessary. It should now properly set the priority for the beginning and end of each file in the torrent.
2013-01-02 20:20:25 -05:00
61bd8aa154 Fix Gtk addtorrentdialog parent None error for single file torrents 2013-01-02 22:40:37 +00:00
637578375c Fix #2240 : Win32 freespace issue with large capacity drives 2013-01-01 17:51:37 +00:00
18bcdd09d3 Fix error when loading torrent through IPC
Fix bug from commit 0045ec0cf1: missing args attribute error when
loading torrent through IPC on non-windows.
2013-01-01 17:40:29 +00:00
cc5ef89139 Fix #2241 : Can't add any torrent files with GUI running
This fixes a bug in commit 60f196ff93, adds a test and removes
unneeded ignore when encoding unicode to utf8.
2013-01-01 17:22:00 +00:00
1a9506f832 move misplaced test to correct dir 2013-01-01 17:11:39 +00:00
e7d06ee132 Make web build script sh compatible 2012-12-22 02:34:43 +00:00
7647f848e4 Update Changelog, webui gettext, gitignore & compress js 2012-12-22 02:31:43 +00:00
eec820774b Fix WebUI submenus closing upon mouse click 2012-12-22 01:39:50 +00:00
8cbdaffedb Update the python dependency to 2.6 2012-12-21 15:35:27 -08:00
e6267d9411 Fix issues with js eventmanager. refs #2046
Fix plugin methods not being available when enabled until refresh. refs #2125
2012-12-21 13:26:58 -05:00
8f34e2abdb Clean up some json api code. refs #2125 2012-12-21 13:19:14 -05:00
d3f0e00356 WebUI: Catch potential undefined error when attempting to disable a plugin 2012-12-18 21:53:08 +00:00
7c2725acdc Fix #1963 : Unhandled OSError if permission issue creating default config dir
The fix now logs the error and exits. To log the error also required moving
the logger setup code to before any default_config_dir call.
2012-12-18 01:57:12 +00:00
f47c9186bf Fix #1504 - Win32 run deluged as not logged in user via runas or service 2012-12-18 01:15:51 +00:00
c9b77cbe94 Fix #1946 : GtkUI: ReactorNotRestartable error when set as startup application 2012-12-17 19:58:29 +00:00
725230dc81 Fix #2175 : systemtray free variable self referenced before assignment
This is only the likely fix for the issue as I have been unable to reproduce it.
2012-12-15 21:27:50 +00:00
73102f1362 Merge branch 'master' into master-decode-string 2012-12-10 20:34:46 -05:00
ca1a5d33f4 Fix issue when saving resume data fails.
Clean up resume data deferred code a bit.
2012-12-10 20:11:11 -05:00
3bf023e4df fix error in #2085 commit 3ca886ac7a: value may be a tuple 2012-12-11 00:58:02 +00:00
c556613b9f Catch exception when enabling/disabling indicator in classic mode 2012-12-10 19:35:03 +00:00
6c07b7378c Fix #2085 : WebUI: Does not show torrents in sidebar for categories other than 'All'
unicode value in filter_dict would not be converted into a list
2012-12-10 15:55:58 +00:00
4520fdd58b Added priority colors to torrent detail view in console 2012-12-10 14:45:52 +01:00
1ac62fce01 Get cli arguments in unicode in deluge core as well.
Make a better guess at what arguments are encoded in on linux.
2012-12-10 00:19:42 -05:00
c2d301bf52 Make deluge-gtk get arguments as unicode.
Fix a few places that use those arguments.
Make sure gtkui loads strings as unicode from rencode.
2012-12-10 00:19:24 -05:00
8658be3b05 Fix #2227 : Torrent file contains sha1 and ed2k digest that needs encoding to hex 2012-12-09 23:24:01 +00:00
2a8b8e93da Use try-except instead of if statement to gain a little performance 2012-12-09 23:12:26 +00:00
ac6785eb1a Fix #2232 : WebUI: Flag Icon path in Peers Tab missing deluge.config.base 2012-12-09 19:09:57 +00:00
848b14605e Make sure pending gtk events are processed before quitting gtkui. 2012-12-08 17:57:12 -05:00
2a0048afbb Add unit test for new component dependency stopping code. 2012-12-08 16:26:32 -05:00
cc943cea4a Merge branch 'master' of deluge-torrent.org:deluge 2012-12-08 12:57:13 -08:00
2f3623d430 Fix component tests 2012-12-08 12:56:58 -08:00
fe44a5ba69 Fix #2231 : WebUI: Fix unneeded scrollbars in webui add dialog
Also fix spinner display issue
2012-12-08 19:18:51 +00:00
d3a0b9d877 Small tweak to make sure writing fastresume is not skipped when torrents are paused. 2012-12-08 00:39:02 -05:00
25efa5437b Update folder rename to use deferreds. 2012-12-07 22:50:53 -05:00
67b40a8442 Remove unneeded import from torrentmanager. 2012-12-07 22:29:56 -05:00
bcac44bcb4 Increase libtorrent alert queue size. refs #2204 2012-12-07 22:29:49 -05:00
58cb9e1c22 Make sure dependent components are stopped before their dependencies.
Make sure deferreds are not lost in new resume saving code.
2012-12-07 22:22:24 -05:00
ce99b5f688 Refactor resume data saving to not read and write fastresume unnecessarily.
Refactor saving resume data on shutdown to use deferreds.
Make bulk resume data saves write to disk only once.
2012-12-07 22:22:12 -05:00
ce76c278ed fix snafu in last commit 2012-12-05 19:11:06 +00:00
bb5dbecbf2 Fix #2130 : Same name can be given to different files in Add Torrent dialog 2012-12-05 18:28:17 +00:00
eed46994da Fix #2129 : Empty filename can be set in AddTorrent dialog 2012-12-05 18:28:04 +00:00
a5df53249a Fix #2228 : Apply-To-All in AddTorrent Dialog is copying file renames to other torrents 2012-12-05 14:07:06 +00:00
331cef16ef Fix #2220 : MacOSX homebrew build not finding boost libs 2012-12-05 13:50:12 +00:00
e79c695732 Remove some backwards compatibility code for libtorrent 0.14. 2012-12-03 01:18:25 -05:00
b4d7e42973 Update libtorrent minimum version checking. 2012-12-03 01:03:58 -05:00
71183f6c19 Add windows support to is_ip 2012-12-01 02:22:49 +00:00
0b5b585992 Replace subprocess.call with subprocess.Popen to start deluged from gtk client
The use of Popen was originally a fix for a Win32 issue on 1.3 but makes sense to
apply to all OSs and simplify code.
2012-11-30 16:04:15 +00:00
7492d48029 Added test if self.model_filter is None
self.model_filter will be None if no list was ever loaded in the
Client, so listview.create_column_state would fail.
2012-11-30 09:23:42 +01:00
b4903b763e Fix torrent names on libtorrent 0.16 on windows. 2012-11-29 23:26:37 -05:00
3d76ab1832 Update version for rencode module. 2012-11-29 23:11:16 -05:00
48cbf0d9b0 Update Changelog 2012-11-29 22:43:36 +00:00
6b9ae264ff Fix typo in json_api docstring 2012-11-28 23:36:23 +00:00
e90e608fdd Fix #1474 : on_show_prefs hook is not executed immediatly after enabling a plugin 2012-11-27 23:18:12 +00:00
6fe350fa52 Fix #2110 : Accept magnet uris with xt param anywhere within them 2012-11-27 23:18:12 +00:00
c426f998e2 Fix #2147 : Missing translations for plugin preferences page 2012-11-27 23:18:12 +00:00
2187cef14f Add decode_utf8 argument to rencode.loads, which decodes all strings from utf8.
Update rpc protocol to load all strings as unicode.
2012-11-26 23:19:13 -05:00
6b5cf3396d Rencode module now always loads strings as utf-8 encoded byte strings. 2012-11-26 23:19:13 -05:00
4f59a48f57 Fix #2146 : Missing translations in View|Tabs submenu
Also fixed small bug when hiding Status tab
2012-11-27 02:03:25 +00:00
d48d3c9c2f Make sure queue order is preserved when restarting daemon. 2012-11-26 17:19:09 -05:00
4579886bb5 Fix file renaming and moving with unicode characters on libtorrent 0.16
Fix torrent creation with unicode characters
2012-11-26 17:18:41 -05:00
bd979da949 Update Changelog, translation files and compress js 2012-11-26 17:43:41 +00:00
d5e340354e Avoid running chardet in decode_string if not needed 2012-11-26 15:54:01 +01:00
19bbf5ac8f Fix Windows tray submenu items requiring right-click instead of left-click 2012-11-26 13:42:40 +00:00
b8deea5c76 Fix #2208 : Win32 Open Folder not working with non-ascii paths 2012-11-26 13:42:32 +00:00
88223fc058 Fix #2086 : Enable submenus for appindicator 2012-11-26 02:19:33 +00:00
09e43f3e41 Fix use of translated text for widget name in build_menu_radio_list 2012-11-26 02:07:48 +00:00
751bc317ea Fix #2201 : auth fails if auth file has extra newlines 2012-11-26 02:07:43 +00:00
60f196ff93 Changed decode_string to always return unicode. 2012-11-25 20:33:00 +01:00
294fc48bd1 Fixed setting some of the torrent options via the manage command 2012-11-25 20:18:35 +01:00
d3d07f7f11 Fixed setting move on complete option in new console 2012-11-25 20:12:55 +01:00
ca272bb36a GTKUI Torrentview Speed optimizations 2012-11-25 00:40:14 +01:00
cd41089e49 Fix #2069 : WebUI: Login window layout problem when using larger than default font size 2012-11-24 18:19:37 +00:00
b1cf5b9c40 Fix #1890 : WebUI: Column in files and peers view could use some spacing
Also fixed the SpinnerGroup to no longer show horizontal scrollbar and added
vertical scrolling to detailstab.
2012-11-24 18:16:38 +00:00
c37cfdfa2f Fix config not defined in ipcinterface 2012-11-24 18:06:13 +00:00
84bc2e78bc Fix #2103 : WebUI: Sorting by name is case-sensitive 2012-11-24 18:05:04 +00:00
0676d7e2dc Fix #2120 : WebUI: Manually entered values not being saved in Spinners 2012-11-24 17:52:49 +00:00
dd8dac0574 Fix #2212 : WebUI: Unable to scroll in proxy preferences page 2012-11-24 17:49:32 +00:00
d6d1cc5f45 Updates to web gen_gettext script and add .build_data to gitignore 2012-11-24 17:44:49 +00:00
f016160c62 Removing unneeded webui files 2012-11-24 17:43:27 +00:00
7119e0d95f Fix #2100 : Add option not to bring main window to front when adding torrents through ipcinterface 2012-11-24 17:42:24 +00:00
ffb902ba06 updated gitattributes to ignore deluge-web debug files 2012-11-22 23:27:52 +00:00
dc14453f34 Update bbfreeze and nsis scripts for win32 packaging
bbfreeze script:
  * Creates a VERSION.tmp file for use by nsis script
  * Includes all theme, icon and locale files. Closes #2096 & #2145
  * Add email.mime.multipart and email.mime.text. Closes #2074
  * deluged.exe and deluge-web.exe will no longer show a cmd window and created
    deluged-debug.exe and deluge-web-debug.exe as replacements if still needed
  * Overridden bbfreeze gtk recipe thus no longer requiring file editing.
  * Remove unnecessary python module includes

nsis script:
  * Deluge version now based upon bbfreeze output
  * Installer will warn if deluge already running. Closes #1217
  * Removed deluged and deluge-web shortcuts from start menu
  * Increased compression level for lzma
2012-11-22 23:24:13 +00:00
f83e772030 Make sure 'quit and shutdown daemon' option is not visible when not connected to a daemon. 2012-11-16 00:46:00 -05:00
0c1dd44cd6 Simplify cross-platform clipboard code in gtk add torrent dialog. 2012-11-14 20:58:48 -05:00
5b2be2d190 Update to depend on libtorrent >= 0.16.1 2012-11-13 21:13:59 -05:00
9d28aa9521 Fix bug in prioritize_first_last, also fixes selective downloading. refs #2211 2012-11-13 01:36:04 -05:00
8298a93dcc Make path separators in Torrent.get_files consistent across platforms. 2012-11-12 21:27:08 -05:00
a78731c8cd Eliminate the need to manually call the on_toggle handler for move completed in add torrent dialog. 2012-11-12 21:24:12 -05:00
15492028fc Make sure sensitivity of move completed path is always set correctly in add torrent dialog. 2012-11-10 22:20:27 -05:00
db5a4f84f6 Fix daemon starting with config dir containing spaces on Windows. 2012-11-09 18:24:26 -05:00
4b75ec5b55 Add move completed option to add torrent dialog. 2012-11-07 22:35:41 -05:00
1daae0135d Implement pseudo stable sort in the gtk torrent view. 2012-11-07 19:41:04 -05:00
dd511df194 Replaced WMI process enumeration with the EnumProcesses API call. (Shorter, faster, does not depend on pythoncom.) 2012-11-06 22:31:08 +00:00
e43e4e2ee0 Fix 2107 : create_plugin.py call correct version of python 2012-11-06 22:24:40 +00:00
b67bae31ba Fix #2174 : Console: Unable to add torrent via URL 2012-11-06 21:27:02 +00:00
5cb85472c6 Fix #2185: register call should be deregister in deregister_event_handler 2012-10-14 00:31:45 +01:00
1c865ebeb9 Tweaks to console info code 2012-10-13 02:27:18 +01:00
a18bdcf7cd Fix #2169 : Add Torrent Dialog 'Download Location' not set correctly when folder typed into Other->Location field
Using get_current_folder() in the file chooser will use the default folder when a folder path has been typed into the Location field rather than selected with mouse. The solution is to replace it with get_filename().

Conflicts:

	deluge/ui/gtkui/addtorrentdialog.py
2012-10-06 23:00:30 +01:00
0a36baa7d7 Fix #2171 : Add Peer dialog stops responding if empty or invalid values entered 2012-09-30 18:29:22 +01:00
47958f708f Fix #2104 : Deluge has no indicator title 2012-09-30 18:29:09 +01:00
d030850638 Update Win32 Installer readme
Also remove unneeded StartX.exe

Conflicts:

	win32/Win32 README.txt
2012-09-29 17:22:27 +01:00
9360378ae9 Fix common.open_file for osx 2012-09-29 17:12:48 +01:00
a3268dd403 Console: Fix test for empty color string 2012-09-29 17:12:26 +01:00
b34e38df57 Fix #2112 : World readable tmp directory in json_api 2012-09-29 17:02:52 +01:00
5188750332 Fix 2163 : Cannot add torrent file with empty (0:) encoding tag 2012-09-29 15:03:13 +01:00
7275cdd3d9 Fix exception handling in rencode 2012-09-29 15:03:05 +01:00
f6c201f02f Fix 2160 : Disable use of python bindings for libtorrent extensions and replace with session flag
The fixes a GIL issue causing libtorrent segfault. https://code.google.com/p/libtorrent/issues/detail?id=369

Note: The ut_pex plugin (Peer Exchange) will now always be enabled.
2012-09-29 15:02:55 +01:00
1ec51cec18 Fix copy pasta fail :( 2012-09-19 22:24:10 +10:00
2531271fe2 Merge branch 'master' of deluge-torrent.org:deluge 2012-09-18 18:00:13 -07:00
9055019cc2 Fix previous commit 2012-09-18 17:59:01 -07:00
9829bec390 Fix execute plugin not working with unicode torrent names 2012-09-16 18:41:40 +10:00
183c47f810 Fix deluge-gtk not working with twisted 12 (fixes #2148) 2012-09-16 18:41:35 +10:00
129c09c5a7 Don't use deprecated twisted imports (fixes #2164)
Aliases have been removed in twisted 12.2.0.
2012-09-16 17:19:46 +10:00
c8384bf304 Update google.ico so tracker_icons tests pass again 2012-09-16 17:14:47 +10:00
5e1caf3746 Add compile arg needed by libtorrent 0.16.x 2012-09-16 15:31:36 +10:00
532b409a54 Only convert the move path to unicode if on windows 2012-09-14 15:55:28 -07:00
7dd4645a7b Quick and hacky fix for console event view crashing on long torrent names 2012-08-26 20:02:59 +02:00
0bf1379cc5 Added active time and seeding time columns to console 2012-08-26 15:00:39 +02:00
6f98e1fddb Don't clobber filename when adding torrents with mapped_files 2012-08-21 18:30:53 -07:00
d3f6616d5d Made status bars update correctly in Legacy 2012-08-20 16:27:15 +02:00
8cdf914f5d Fix to the last fix ^^ 2012-08-09 14:56:23 +02:00
6c6292135f Fixed some problems with help popups 2012-08-09 14:56:23 +02:00
75c4135d6e Made delete key open up the delete torrent dialog in view torrent detail mode 2012-08-09 14:56:23 +02:00
5927f2fa30 Made 'Esc' exit AddTorrents and allowed scrolling with j/k 2012-08-09 14:56:23 +02:00
bd13457f33 Fixed AddTorrents crashing on folders containing unicode characters 2012-08-09 14:56:22 +02:00
8de9843e7e Replaced a dictionary comprehension with dict(list comprehension) to keep 2.6 compatibility 2012-08-09 14:56:22 +02:00
a73fb338f1 Fix console not working with an empty session 2012-08-09 14:56:22 +02:00
ae8751461a Replaced 'inf' with '-' for ratio column in AllTorrents mode 2012-08-09 14:56:22 +02:00
9c0c7b060c Added progress to list of required columns 2012-08-09 14:56:21 +02:00
da5140e615 Fixed (this time properly) crapping out when waiting for torrent data after enabling a column 2012-08-09 14:56:21 +02:00
fa32d4e3f4 Fixed lack of formatting in some of the event messages 2012-08-09 14:56:21 +02:00
52541df3f9 Added another check to prevent event spam when adding a new torrent 2012-08-09 14:56:21 +02:00
39d75ee7d5 Display a 'Please Wait' string instead of crapping out when waiting for column data to be fetched 2012-08-09 14:56:20 +02:00
246a8409bf Fixed a crash when trying to change sort order from an invisible column 2012-08-09 14:56:20 +02:00
c554bf9edd Made scrolling not reset the breadcrumbs in AddTorrents as it's meaningless 2012-08-09 14:56:20 +02:00
ef522ba292 Added scrolling with PgUp/PgDown and Home/End to SelectablePopup 2012-08-09 14:56:20 +02:00
3602fb76c5 Fixed a little problem with multiselection in AddTorrents 2012-08-09 14:56:19 +02:00
8dfc405c3e Added error handling for inaccessible directories 2012-08-09 14:56:19 +02:00
567f4e5c3d Removed debug code, made AddTorrents save path and sorting column/order 2012-08-09 14:56:19 +02:00
57b1820fd7 Got rid of old add torrents dialog and replaced it with a new one that either opens file browser or an add from URL/magnet dialog 2012-08-09 14:56:19 +02:00
6a54c71c94 Wrote a help string for AddTorrents 2012-08-09 14:56:18 +02:00
2b244f0628 Changed format of add torrent reports a bit 2012-08-09 14:56:18 +02:00
be23d00042 Extended torrent add screen with a proper file browser and multiselection. Experimental 2012-08-09 14:56:18 +02:00
d9a2597617 Made wrap_string carry format strings over to the next line 2012-08-09 14:56:17 +02:00
33e5cad75a Made Popup accept a width_req argument 2012-08-09 14:56:17 +02:00
8c9a89bcd2 Added missing coding declaration to manage.py 2012-08-09 14:56:17 +02:00
0c93d20980 Treat empty rename field as canceling the rename 2012-08-09 14:56:17 +02:00
93a0040b68 Added renaming files and folders in a torrent. Note: For the sake of your sanity, if you ever wish to modify this code, better rewrite it from scratch instead. 2012-08-09 14:56:16 +02:00
e4a4f0eb4a Fixed a problem with message popup 2012-08-09 14:56:16 +02:00
78137540f2 First change outside of deluge/ui/console - fixed a problem when removing torrents 2012-08-09 14:56:16 +02:00
76babd951d Fixed a bug that caused torrent options popup to not display in some circumstances 2012-08-09 14:56:16 +02:00
a66bd5e847 Fix crash when entering unicode characters from keyboard into an input popup 2012-08-09 14:56:15 +02:00
dcd3bc10e1 Chaned DL/UL colors on status bar to magenta/green (from green/red) 2012-08-09 14:56:15 +02:00
08f5841522 Performance improvements - console should now be much faster with many torrents and slightly faster to somewhat slower with few 2012-08-09 14:56:15 +02:00
7a55a2e6ce Set default priority for file priority dialog to 'Normal', added colors 2012-08-09 14:56:14 +02:00
ac79938c20 Fixed a minor problem with events on torrent addition 2012-08-09 14:56:14 +02:00
1da24fbeaa Updated some event handlers 2012-08-09 14:56:14 +02:00
a20b39325e Made detail and event views scrollable with j/k keys as well 2012-08-09 14:56:14 +02:00
f7a4951e0d Fixed sorting by ETA 2012-08-09 14:56:13 +02:00
9abfc5b250 Added a first run popup(actually just ordinary help with changed title) 2012-08-09 14:56:13 +02:00
a41c950b11 Made popup windows request height of 65, updated help 2012-08-09 14:56:13 +02:00
718bf57b5d Allowed float sizes of Popups between 0.0 and 1.0 which make them take specified amount of available screen space, made help popups larger 2012-08-09 14:56:13 +02:00
11e3a66484 An _UGLY_ but working fix for an alt+backspace problem in Legacy 2012-08-09 14:56:12 +02:00
9a322ed67f More Unicode handling fixes for Legacy 2012-08-09 14:56:12 +02:00
4e1573cb39 Fixed 'Queue' option not being display in all torrents view 2012-08-09 14:56:12 +02:00
28e36c7edc Fixed offset issues in torrent detail view 2012-08-09 14:56:12 +02:00
bbdf710b52 Another search behaviour change: Enter now opens torrent menu and '/' closes search(as it cannot occur in torrent name anyway) 2012-08-09 14:56:12 +02:00
3634f457b4 Fixed an additional character being deleted when pressing alt+backspace in legacy mode 2012-08-09 14:56:11 +02:00
a956f0a5d7 Add / to list of word-separating characters 2012-08-09 14:56:11 +02:00
265f9f295e Made connection manager handle resizing 2012-08-09 14:56:11 +02:00
6888c6ef60 Made history saving/loading respect the 'do not save duplicate lines' setting 2012-08-09 14:56:10 +02:00
50b84c3e91 Allow exiting preferences with escape if category zone is active 2012-08-09 14:56:10 +02:00
9152d322ac Fixed resize bugs in event view, torrent detail and preferences(also made it actually handle resizing) 2012-08-09 14:56:10 +02:00
18091c5ad6 Fixed an error that arised when no torrents matched current filter 2012-08-09 14:56:09 +02:00
4a58e339cb Split console options into two panes - interface and columns 2012-08-09 14:56:09 +02:00
31dd1be090 Fixed command line history saving problems 2012-08-09 14:56:09 +02:00
3cc97accfc Added saving and loading legacy history. Optional, enabled by default 2012-08-09 14:56:08 +02:00
555717b9a0 Modified torrent detail view. Needs more work 2012-08-09 14:56:08 +02:00
cf58aa780a Added an audible bell on torrent completion (optional, off by default) 2012-08-09 14:56:07 +02:00
935777fb49 Fixed resize causing crashes and/or improper resize of AllTorrents view 2012-08-09 14:56:07 +02:00
0dbea0ed01 Made torrent info popup request larger size 2012-08-09 14:56:07 +02:00
84425d7786 Fix inability to open torrent options with 'o' key 2012-08-09 14:56:06 +02:00
3920a93cba Replaced infinity symbol with 'inf' 2012-08-09 14:56:06 +02:00
4735a6c49a Add a visible columns dialog in all torrents view under 'v' key 2012-08-09 14:56:06 +02:00
a8549ef882 Another popup system upgrade: Preserve requested height on resize, do not fail if it's too much, add infinite and default options, add align option, slightly change SelectablePopup. Update rest of the code 2012-08-09 14:56:05 +02:00
0df1255ae5 Replace the popup scroll bar with a red '#' for visibility 2012-08-09 14:56:05 +02:00
f6d87c7a7e Highlight prompt in yellow in line history 2012-08-09 14:56:05 +02:00
1f59b4d2ba Add reload and install plugin functionality to the 'plugin' command 2012-08-09 14:56:04 +02:00
1df173d684 Added tab_complete_path method to LegacyUI and ConsoleUI, made add command use it for completion 2012-08-09 14:56:04 +02:00
b2f78786a5 Don't append a space after directory completion 2012-08-09 14:56:04 +02:00
314b6138d7 Add preliminary(Torrent ID/name only) autcompletion to manage command 2012-08-09 14:56:04 +02:00
1bc3c293fa Added another fix for flicker bug. Looks like it's not possible to completely get rid of it, but it should be around 10000 times less common now 2012-08-09 14:56:03 +02:00
bbf0666539 Fixed '<command> -h', added syntax highlighting to command help 2012-08-09 14:56:03 +02:00
2ed60de628 Allow 'help' command to print help for multiple commands at once 2012-08-09 14:56:02 +02:00
76546ec176 Fixed double space being appended after commands 2012-08-09 14:56:02 +02:00
0a9a1db942 Fixed another splitting bug 2012-08-09 14:56:02 +02:00
d589823f4a Fixed accidential highlight on time zone name 2012-08-09 14:56:02 +02:00
33decd1780 Finally and definitely fixed all flickering bugs 2012-08-09 14:56:01 +02:00
6269076c7e Added scrolling to event view, fixed all crashes 2012-08-09 14:56:01 +02:00
506a98aee2 Implemented the .clear() -> .erase() change which supposedly fixes a lot of flicker issues 2012-08-09 14:56:01 +02:00
8d1e4297ec Append space after completed line. With enhanced tab completion it poses no problem 2012-08-09 14:56:01 +02:00
8678121210 Made it possible to open torrent options with 'o' in detail view 2012-08-09 14:56:00 +02:00
24d801d18a Fixed a parameter splitting bug that prevented help command from working and could have lead to rm disaster 2012-08-09 14:56:00 +02:00
2e647c6b41 Fixed help string in torrent detail and event views 2012-08-09 14:55:59 +02:00
a47b2bc715 Show torrent options entry in torrent menu (both alltorrents and torrentdetail views) 2012-08-09 14:55:59 +02:00
e1a3a9e077 Fixed a harmless mistake that I made 80 commits earlier 2012-08-09 14:55:59 +02:00
3488a761b8 Changed default column settings to be friendlier to small terminals 2012-08-09 14:55:59 +02:00
822ddc2182 Place completed torrents after the rest regardless of sort keys(optional, on by default) 2012-08-09 14:55:58 +02:00
f5f1f11f61 Fixed sorting by some of the keys, reversed sorting order where appropriate 2012-08-09 14:55:58 +02:00
864785752f Change primary sort field with '<' and '>' keys 2012-08-09 14:55:58 +02:00
60e534f59b Removed trailing whitespace 2012-08-09 14:55:57 +02:00
c0f76bef1b Highlight current primary sort column 2012-08-09 14:55:57 +02:00
920e765790 Changed behaviour of search heavily - you can no longer move cursor around the input field, instead right arrow opens torrent detail view and left cancels searching. You can also go to first/last result with PGUP/PGDOWN 2012-08-09 14:55:57 +02:00
cc99279ad1 Improved logging - added dates, time, changed formatting and made it always log both to console and event log 2012-08-09 14:55:57 +02:00
48dd049cbd Log events to legacy mode even when in AllTorrents view 2012-08-09 14:55:57 +02:00
09c830c6ae Yet another search scrolling bug 2012-08-09 14:55:56 +02:00
39a896e59e Add proper sorting by primary/secondary fields. No preferences yet, defaults are queue/name 2012-08-09 14:55:56 +02:00
ca6c647bd2 Color-coded the statusbars 2012-08-09 14:55:56 +02:00
d2dc62f0b3 Remove option to hide name column as something to identify the torrent is needed anyway 2012-08-09 14:55:56 +02:00
4983110d50 Highlight matches when searching (only for >=2 chars entered) 2012-08-09 14:55:55 +02:00
00bf1d31a2 Fixed a severe torrent matching bug caused by spaces not being unescaped when parsing 2012-08-09 14:55:55 +02:00
2092a0d090 Fixed halt command. I totally have no idea why it worked before and why it stopped working now.... 2012-08-09 14:55:55 +02:00
d3e70b7f7f Don't reset cursor position when going back from torrent detail view 2012-08-09 14:55:55 +02:00
d86168cb41 When no filename is supplied in torrent add dialog, treat is as cancel and don't display an error message 2012-08-09 14:55:54 +02:00
5a096768e0 Fixed another search scrolling bug. New search is now only not performed if the same part of torrent name matches after entering a new character 2012-08-09 14:55:54 +02:00
c2f97356c6 Fixed minor searching problems 2012-08-09 14:55:54 +02:00
b5cfbbcdec Made popup windows scrollable with page up/down and home/end 2012-08-09 14:55:54 +02:00
6326902287 Do not empty search_string so user can continue to cycle through results with 'n' key 2012-08-09 14:55:53 +02:00
a9af9cabb4 Remove '(end/start reached)' message after changing search string 2012-08-09 14:55:53 +02:00
546aa58482 Fixed scrolling bug when searching backwards 2012-08-09 14:55:53 +02:00
be79c586da Made search case insensitive 2012-08-09 14:55:53 +02:00
819377b0bb Searching in main view now searches immediately and you can cycle through results with up/down keys. Failure/success/end/start reached are now color-coded 2012-08-09 14:55:53 +02:00
b37965de3d Add deleting words with alt+backspace and a minor change that could have potentially caused some misc bug 2012-08-09 14:55:52 +02:00
d7391611dd Do not use shlex for splitting as it breaks on torrents containing quotes 2012-08-09 14:55:52 +02:00
fa1a1eb939 Add permission checking to add command(fixing few crashes), sort files by date, place folders before files and ignore files other than .torrent files 2012-08-09 14:55:52 +02:00
5a33e66c2c Fix add command reporting success for some failures 2012-08-09 14:55:51 +02:00
3bc25d44ee Fixed a crash bug introduced with inexact case matching 2012-08-09 14:55:50 +02:00
ba7e36c719 Sort files by date when using 'add' command autocompletion, listing newest on top 2012-08-09 14:55:50 +02:00
e6e0eefaa4 Added (quite elaborate) inexact-case torrent name completion 2012-08-09 14:55:50 +02:00
a750999e0e Do not append space after the math. It ruins file path autocompletion 2012-08-09 14:55:50 +02:00
40a6b11a1b Re-fixed shortening which I broke during the last rebase 2012-08-09 14:55:49 +02:00
471757d6c6 Fix problems with moving selection caused by deluge-console emptying selection when only one element is selected 2012-08-09 14:55:49 +02:00
2373eda462 Add config option to change amount of torrents to list per tab press 2012-08-09 14:55:49 +02:00
a0a18e1036 Make 3rd+ tab list more/all of the remaining torrents and a preference to toggle these behaviors 2012-08-09 14:55:49 +02:00
04ed96d121 Made additional formatting for input controls optional and on by default for popups so it doesn't show up in preferences but still works when setting torrent options 2012-08-09 14:55:48 +02:00
05758245a1 Added functions for adding spin inputs to popup. Added support for default non-number values to them(they return None in that case). Added proper scrolling to InputPopup. Tweaked visual style 2012-08-09 14:55:48 +02:00
a28e40ea35 Add option(on by default) to move selection when moving torrents up/down the queue. Known bug: Incorrect behavior when trying to move bottommost torrents to the bottom, has no impact besides being unexpected. 2012-08-09 14:55:48 +02:00
14bfa24195 Add smarter selection selection for torrent detail view - highlight directories with selected files inside as partially or fully selected, select not only directories but also files inside. 2012-08-09 14:55:47 +02:00
8a261b26e8 Revamped info command detailed file view so it now shows a pretty tree look and made it ensure at least 8 characters of torrent ID get printed before deciding not to wrap to next line in the default, compact view 2012-08-09 14:55:47 +02:00
a2c347a79c Add proper support for double width characters to legacy mode and few related formatting functions 2012-08-09 14:55:47 +02:00
415bc22dd9 Completely remove placement of three dots symbol between columns, including option concerning it. 2012-08-09 14:55:47 +02:00
6edd159626 Add scrolling using Page Up/Down and Home/End in torrent detail view 2012-08-09 14:55:46 +02:00
1a1518ac1d Fixed autocompletion bug, removed some useless comments 2012-08-09 14:55:46 +02:00
508dec4858 Modified autocompletion to only list a limited amount of matches(use info for full list), color coded it, modified to show both torrent names and ID as well as highlight matching part, show green 'Autocompletion matches' text for more than 4 matches so it's more readable. Depends on previous commit 2012-08-09 14:55:46 +02:00
80b88bf047 Modified the info command to be more compact and concise by default, old behavior(with tracker and save location info added) moved to -v switch, old verbose mode(files and peers) moved to -d switch 2012-08-09 14:55:46 +02:00
249e331ae9 Add option to not store duplicate input in command history for legacy mode. 2012-08-09 14:55:45 +02:00
47ba11be1b Pass console config to torrentdetail and format_utils, add an option to disable three dots when trimming columns(they piss me off) 2012-08-09 14:55:45 +02:00
163870afd9 Rename torrent_options to manage. 2012-08-09 14:55:45 +02:00
117d29ae72 Author: eirikba
Found this in the trac
http://dev.deluge-torrent.org/ticket/1858
description:
This patch adds a command to deluge-console to show and set per-torrent options. I have called the command "torrent_option" and mostly modeled it on the "config" command. A better name for the command would be nice, but I have no better suggestion at this time.
2012-08-09 14:55:45 +02:00
8dc5b07818 Map delete key to remove torrent(s) dialog 2012-08-09 14:55:44 +02:00
acb77213e1 Make torrent_actions_popup capable of directly displaying/executing one of the torrent actions without displaying choice dialog 2012-08-09 14:55:44 +02:00
e68358661a Revamped torrent removing dialog so it's harder to accidentally remove data. Also, it lists torrents being removed now 2012-08-09 14:55:44 +02:00
d9789504ff Replace empty lines in InputPopup with generic text(lines are of course still there) 2012-08-09 14:55:44 +02:00
98101ea411 Implement a call to os.sep in regards to auto completion
Added small amount of code which calls os.sep so we know if we should append "/" or "\\" to the end of a dir.
2012-08-09 14:55:43 +02:00
f33a6a68e4 Inform the user how to navigate connection manager
Added a quick line to let the user know to user the up & down arrows when adding a host[it isn't as intuitive as you might think]

Using tab to switch input fields when adding a host is something that *should* be added in the future… [more intuitive]
2012-08-09 14:55:43 +02:00
03fefc279b Change .clear() -> erase()
Change .clear() to -> .erase() should eliminate flicker issues.
I'm unsure whether I should've  changed line 105 of popup.py.. we can revert if there is any issues.

Note: we only want to erase() during refreshes, if we are changing modes we do want to clear() the screen(at least I think we do… it might make sense to just use erase() everywhere for consistency… I/we should look into this)
2012-08-09 14:55:43 +02:00
e85be7cccb Update help for 'info'
This commit updates help information when you run `help info`. We inform user of Tab Completion, and of `info *`.
There is also some removal of duplicate information(no need for line about `info -s <state>` since we tell the user that when they read the option about '-s')
2012-08-09 14:55:43 +02:00
b8f2a1da1a Removed trailing whitespace 2012-08-09 14:55:42 +02:00
b1ce567819 Add config option to change amount of torrents to list per tab press 2012-08-09 14:55:42 +02:00
68db1d4c13 Restored underline for currently selected option in SelectInput that I accidentally did in few commits ago 2012-08-09 14:55:42 +02:00
5796e025e6 Make 3rd+ tab list more/all of the remaining torrents and a preference to toggle these behaviors 2012-08-09 14:55:42 +02:00
8819ec0575 Escape spaces in paths in legacy mode 'add' command. This also makes backslashes unsupported(but you're a bad person for having them in paths anyway) 2012-08-09 14:55:41 +02:00
a24c679510 Made additional formatting for input controls optional and on by default for popups so it doesn't show up in preferences but still works when setting torrent options 2012-08-09 14:55:41 +02:00
c2b4ccdc77 Fixed info sometimes shortening the ID even when there's enough space. 2012-08-09 14:55:41 +02:00
8d07a697d3 Made moving selection along with queue delayed, just like queue operations themselves 2012-08-09 14:55:41 +02:00
459c4aebb9 Updated "move selection with queue" feature to reflect changes in behavior 2012-08-09 14:55:40 +02:00
010fd165c6 Fixed bugs concerning negative numbers in spin inputs and sometimes returning wrong values. 2012-08-09 14:55:40 +02:00
27f0e86afd Add setting sequential_download option, set options that core.set_torrent_options doesn't support directly, remove setting 'private' torrent option as it's read-only anyway 2012-08-09 14:55:40 +02:00
a436eb8aa6 Fixed spin inputs not updating their values until deselected 2012-08-09 14:55:40 +02:00
3f5099bd05 Added setting per-torrent options to console mode. Mapped to 'o' key, supports setting options for multiple torrents at once(when values differ, leave the default value alone to not touch that option) 2012-08-09 14:55:40 +02:00
2625bbc7fd Added functions for adding spin inputs to popup. Added support for default non-number values to them(they return None in that case). Added proper scrolling to InputPopup. Tweaked visual style 2012-08-09 14:55:39 +02:00
0f18463df0 Fixed bug that would cause info command to sometimes 'shorten' torrent ID in a way that in the end makes it longer(some of characters repeat) 2012-08-09 14:55:39 +02:00
6b8428e262 Fix behavior of __get_contained_files_count when passed file id parameter and thus fix bug causing discrepancy in behavior when (un)selecting partially selected folders(will now unselect them all the time) 2012-08-09 14:55:39 +02:00
a8a24bf0d9 Removed trailing whitespace 2012-08-09 14:55:39 +02:00
c30a86e52a Add option(on by default) to move selection when moving torrents up/down the queue. Known bug: Incorrect behavior when trying to move bottommost torrents to the bottom, has no impact besides being unexpected. 2012-08-09 14:55:38 +02:00
591f9a19e5 Add smarter selection selection for torrent detail view - highlight directories with selected files inside as partially or fully selected, select not only directories but also files inside. 2012-08-09 14:55:38 +02:00
c62547d401 Revamped info command detailed file view so it now shows a pretty tree look and made it ensure at least 8 characters of torrent ID get printed before deciding not to wrap to next line in the default, compact view 2012-08-09 14:55:38 +02:00
16f62bbcfe Add proper support for double width characters to legacy mode and few related formatting functions 2012-08-09 14:55:38 +02:00
412d0e7be9 Completely remove placement of three dots symbol between columns, including option concerning it. 2012-08-09 14:55:38 +02:00
98c9aaf600 Remove trailing backslashes to avoid breaking shlex that is used to split parameters passed to commands 2012-08-09 14:55:37 +02:00
f5c8968aa6 A quick and ugly fix(try-except) for crashes involving multiselection 2012-08-09 14:55:37 +02:00
149cbae4dc Add scrolling using Page Up/Down and Home/End in torrent detail view 2012-08-09 14:55:37 +02:00
b689fe1d98 Fixed autocompletion bug, removed some useless comments 2012-08-09 14:55:37 +02:00
a6c1bc1d4a Modified autocompletion to only list a limited amount of matches(use info for full list), color coded it, modified to show both torrent names and ID as well as highlight matching part, show green 'Autocompletion matches' text for more than 4 matches so it's more readable. Depends on previous commit 2012-08-09 14:55:36 +02:00
ab6dc2d11f Added a function for stripping formatting to be used in other places. 2012-08-09 14:55:36 +02:00
ced1475233 Modified the info command to be more compact and concise by default, old behavior(with tracker and save location info added) moved to -v switch, old verbose mode(files and peers) moved to -d switch 2012-08-09 14:55:36 +02:00
1391f20658 Add option to not store duplicate input in command history for legacy mode. 2012-08-09 14:55:35 +02:00
b1439274c6 Pass console config to torrentdetail and format_utils, add an option to disable three dots when trimming columns(they piss me off) 2012-08-09 14:55:35 +02:00
6422f11971 Fix autoconnecting to the default host 2012-07-17 17:23:39 -07:00
8e7432e71c Added a protocol for the network traffic between client and daemon.
Implemented a protocol layer above twisted.internet.protocol.Protocol
which guarantees correct transfer of RPC messages. The network messages
are transfered with a header containing the length of the message.
2012-07-02 02:09:14 +02:00
5dc6dbf216 Fix #1943 - invalid session id when calling a rpc exported function from a plugin when no client is connected 2012-06-10 16:59:49 -07:00
6cb1fd76cc Fix #2062 : Console discards text before first colour string 2012-04-20 12:35:21 +01:00
934a0f6495 fix mistake in last commit 2012-04-19 18:09:31 +01:00
266127bb69 Fix #2065 : Console crash with missing closing quote 2012-04-19 16:02:09 +01:00
acecd6d522 Catch & log KeyError when removing a torrent from the queued torrents set
This seems to happen due to libtorrent firing the torrent finished event
twice.
2012-04-18 13:29:13 +01:00
2cdcae8d31 win32 build scripts updated from 1.3-stable 2012-04-18 13:27:24 +01:00
cb2212d2f3 Update Changelog 2012-04-18 13:27:00 +01:00
9fd527f465 WebUI: Increase focus delay for password field cursor 2012-04-18 13:00:14 +01:00
828b3204b8 Fix #2071 : KeyError in gtkui when file priority set to value '3'
Bug results from setting file priority value in core which does not
exist in the FILE_PRIORITY dict used by UIs.
2012-04-18 12:58:09 +01:00
8fdfdc2b25 Gtkui: move height request to child widget in create dialog 2012-04-18 12:57:53 +01:00
bfae766f8a Fix missing semi-colon in deluge.desktop 2012-04-18 12:55:52 +01:00
569dd0c585 Console: Fix prefixed space for tab completing commands 2012-03-26 19:27:58 +01:00
211c27aaae Console: Fix missing trailing space for command options with tab complete 2012-03-26 19:27:01 +01:00
e2608a0ac9 Remove unnecessary translation from connection manager 2012-03-26 19:17:56 +01:00
7625812c8c Use (documented) formatdate over format_date_time 2012-03-23 19:28:29 +11:00
beb35c5c35 Grey out file priorities for 'is_seed:True' seeding torrents 2012-03-22 01:34:49 +00:00
14eb3e51b0 Bring MainWindow to front when opening another instance of gtkui 2012-03-22 01:15:45 +00:00
d62da02bae Improve Magnet and Url support for add command in console 2012-03-21 22:35:14 +00:00
61dbd349ab Hide unused Infohash button in WebUI 2012-03-14 00:26:08 +00:00
f102e988c9 Preserve order when moving multiple torrents in the queue 2012-03-12 23:51:47 +11:00
78df634fed Add get_queue_position & use it for sorting ids 2012-03-12 23:51:45 +11:00
e6e677e7d0 Fix not properly detecting when torrent is at end of queue 2012-03-12 23:51:21 +11:00
edca36fa73 Update Changelog 2012-03-11 20:22:47 +00:00
758f4ef920 Label Plugin: Mark 'Label Options' for translation 2012-03-11 20:19:07 +00:00
30ee7fb170 Label Plugin: Disable menu items for 'All' in sidebar 2012-03-11 20:19:00 +00:00
8010f2fcc1 Label Plugin: Defer translate No Label text in submenu 2012-03-11 20:17:11 +00:00
d98eb06f69 Fix Label Plugin text 'All' for translation in sidebar 2012-03-11 20:16:13 +00:00
7f88f59272 Mark torrent menu Pause text for translation 2012-03-11 20:09:42 +00:00
f6127e1747 Fix #2052 : Progress bar state text marked for deferred translation 2012-03-11 20:07:40 +00:00
9ecc9ab7ad Modified fix for #1957 non-acsii columns 2012-03-11 01:05:12 +00:00
17d12fbaf2 Fix for Up Speed column not sorting in Webui 2012-03-10 13:21:09 +00:00
068ba7bc6f Allow a minimum of 0.1 for "Stop Seed at Ratio" regarding label options. 2012-03-08 18:53:09 +00:00
713f7eff7a Fix collapsed treeview in Create Torrent dialog 2012-03-04 19:34:27 +00:00
74181469bc Fix compatibility for Python2.5 and Debian Lenny
Recent commit to handle warnings were >=Py2.6 and glib binding is
unavailable on Debian Lenny.
2012-03-04 19:28:51 +00:00
b396b11611 Set process name to match application using setproctitle
Using the setproctitle module the process name displayed in top
and other places will correctly reflect the binary name. This is an
optional dependency
2012-03-04 19:13:33 +00:00
8503687136 Fix adding magnet error in webui when started from classic mode 2012-03-03 23:43:34 +00:00
f0051ee81f Add a define to fix build error with libtorrent trunk 2012-03-03 11:52:44 -08:00
31222a5ab6 Add gtkui template to feeder plugin 2012-03-03 02:09:23 +00:00
752e5a7a8f Fix #2045 : UnicodeDecodeError when using non-ascii chars in info
Input arg string needed decoding otherwise comparing with unicode
torrent name fails.
2012-03-02 15:44:08 +00:00
2ecb54c4f7 Ensure is_finished value is correct after state changed alert
Set torrent.is_finished to false when torrent is in a Checking or Downloading state
2012-03-02 14:23:25 +00:00
7ae912114b Fix #2021 : Share ratio limit not obeyed for torrents downloaded outside deluge
Share ratio limit is based upon torrent.is_finished and a seeded torrent added
to the session was not set after checking.
2012-03-02 14:21:16 +00:00
e33d834cc9 Update Changelog 2012-03-02 14:00:58 +00:00
9c0a450a47 Blocklist: remove default url as it is outdated 2012-03-02 13:59:59 +00:00
debae00246 Fix preferences dialog not opening with main window on Windows 2012-03-02 13:55:52 +00:00
a1949bc020 Fix #1976 : Text entry with trailing newline characters causes issues for Move Storage
Changed most GtkEntry truncate-mutliline properties to True for all single line
entries to prevent similar issues.
2012-03-02 13:54:08 +00:00
968abf9d54 Add optparse custom version to prevent unnecessary loading of libtorrent 2012-03-02 13:31:38 +00:00
9053280e14 Alternative fix for re-enabling plugin issue 2012-03-02 13:19:23 +00:00
6d2e88eeee Update Changelog 2012-03-02 13:16:13 +00:00
f1ddd236ce Fix #2038 : Chrome 17 disconnecting from webui 2012-03-02 13:10:35 +00:00
be5a0b3dc5 Catch glade object issue when re-enabling Autoadd
Found an additional glade object from the previous instance of Autoadd
calling cb_get_config resulting in an exceptions.AttributeError.
This workaround simply checks that get_widget is not None.
2012-03-02 13:09:44 +00:00
614b002d8b Fix plugins not showing enabled in webui 2012-03-02 13:07:29 +00:00
a494471ed4 Fix potential keyerror for on_torrent_removed in sessionproxy 2012-03-02 13:02:11 +00:00
31ff64b537 Execute: log stdout/stderr when command fails 2012-03-02 13:34:56 +11:00
ba75ae4ccc Execute: make running commands asynchronous
This prevents deluge from hanging while it waits
for a command to finish.
This also prevents a deadlock from occuring
(c.f. warning at
 http://docs.python.org/library/subprocess.html#subprocess.Popen.wait)
2012-03-02 13:34:49 +11:00
fd28bf8619 Properly wait for the component.shutdown deferred on shutdown. This should prevent the daemon from exiting before all the state has been saved. 2012-03-01 13:11:11 -08:00
ae6af18f0d Remove setting torrent.is_finished in the resume alert 2012-02-29 15:23:17 -08:00
b47dc73d30 Disable check for user and group options on Windows 2012-02-24 15:29:58 +00:00
1696fd1103 Updated Changelog and compressed js 2012-02-23 00:49:55 +00:00
b5c63c4d58 More fixes for labels plugin webui
Disabled options and remove for filters No Label and All
Removed All from torrent menu
Fixed No Label not working in torrent menu
Bumped version to 0.2
2012-02-23 00:49:55 +00:00
330019bb3d Fix #2036: new labels are not sorted on torrent right click 2012-02-23 00:49:55 +00:00
4bbf9e2ea6 tabs to spaces label.js 2012-02-23 00:49:55 +00:00
6e6f6313a8 Fix missing desktop file preventing install 2012-02-23 00:49:55 +00:00
af19e3bc62 Fix setting daemon listen interface from command line 2012-02-23 00:49:55 +00:00
40e4fb9b8e Catch and log ReactorNotRunning when stopping reactor in gtk 2012-02-23 00:49:55 +00:00
62c7209558 Add Webui keymaps for torrents - Ctrl-A (select all) and Delete 2012-02-23 00:49:55 +00:00
f897f03227 Add magnet uri support to Add Url in Webui 2012-02-23 00:49:55 +00:00
38210ae11e Fix #2037: webui 'Add Torrents' dialog torrents list not scrolling 2012-02-23 00:49:55 +00:00
0ccf0730ea Fix progress bar display
When first loading webui is browser this.style is undefined and p.style
contains the width of the progress column however after this point
p.style contains the width of the previous column so need to use
this.style which now represents the progress column width.
2012-02-23 00:49:54 +00:00
abc82c1439 Update extensions to Ext JS 3.4.0 2012-02-23 00:49:54 +00:00
e9239be691 Ignore unmaximise event when window isn't visible
This fixes the bug where a maximised main window
will become unmaximised (on restart) after
quitting deluge from the system tray.
2012-02-23 00:49:54 +00:00
8452b63d19 Multiple Magnet links support in autoadd plugin 2012-02-23 00:49:54 +00:00
6f77703e29 Magnet link support in autoadd plugin
Check the watch folders for .magnet files which contain valid magnet links
and add them.
2012-02-23 00:49:54 +00:00
2b01ba43cb Fix #2035: If auto_add_trackers is empty, it is an array 2012-02-23 00:49:54 +00:00
eceaa0ae4f catch and log 'glib.GError: Unrecognized image file format' error 2012-02-23 00:49:54 +00:00
ae9eb15d5c Update Changelog 2012-02-23 00:49:54 +00:00
2793e1ec53 Add missing columns to WebUI
Added Download,Uploaded,Down Limit, Up Limit & Seeder/Peeds. Also selected
columns start out hidden to match gtkui and the name column has a minimum
width of 150.
2012-02-23 00:49:54 +00:00
ec27028f1b Webui applies changes when OK clicked in Preferences 2012-02-23 00:49:54 +00:00
ba60ae09d5 Fix #1954 : 'invalid literal for float' console error when setting listen interface 2012-02-23 00:49:54 +00:00
aa0f41ac17 Cleaner log entry if deluged missing 2012-02-23 00:49:54 +00:00
4a7876f203 Add scheduler plugin page to webui 2012-02-23 00:49:53 +00:00
101ad99c14 web: update to extjs 3.4.0
There are numerous fixes to the framework between 3.1.1 and 3.4.0 and
since there are no obvious bugs introduced it's only sensible to pull
the update in to the stable branch
2012-02-23 00:49:53 +00:00
0d3ba7541e Remove unnecessary migration function as this default value should be picked up from the DEFAULT_PREFS dictionary 2012-02-19 17:57:44 -08:00
c8718ad643 Implemented #1382:
* Implemented whitelist support to both core and GTK UI.
* Implemented ip filter cleaning before each update. Restarting the deluge
  daemon is no longer needed.
* If "check_after_days" is 0(zero), the timer is not started anymore. It would
  keep updating one call after the other. If the value changed, the timer is
  now stopped and restarted using the new value.
2012-02-15 14:21:02 +00:00
da868347cf ui: fix setting capital log level
Whilst providing the log level as a lowercase string has worked
for a long time trying to use DEBUG doesn't work, so lowercase
the string first.
2012-01-19 01:42:17 +00:00
f4fab86767 Fix stored file priorities settings
File priorities stored in torrent options were based upon the supplied
funtion values rather than the current values stored in libtorrent. So
if the priorities failed to be set by libtorrent the settings would be
out of sync.
2012-01-19 01:33:16 +00:00
517addb9f9 Update Changelog 2012-01-10 02:10:20 +00:00
8c1ef7d6af update changelog 2012-01-10 02:10:13 +00:00
c87245320d fix #1481 file uploads from behind a reverse proxy 2012-01-10 01:26:05 +00:00
983c9dad99 apply patch from #1548 2012-01-10 01:19:24 +00:00
f299be0eb9 Fix #1929 : Update setup.py to clean deluge*.egg_info dir from root dir 2012-01-09 23:20:48 +00:00
a01f45cc7a Fix #1936 : Referenced before assignment error in json_api 2012-01-09 23:20:48 +00:00
3b1ac4e81f Fix #1895 : Files Tab showing wrong files due to torrent_info race condition 2012-01-09 23:20:48 +00:00
bebdec9ebb Update AUTHORS 2012-01-09 23:20:48 +00:00
3a91f87679 Remove unneeded license from blocklist 2012-01-09 23:20:48 +00:00
be49fd6a40 Fix #2010 : Move speed text in titlebar to the beginning 2012-01-09 23:20:48 +00:00
c88ba97531 Strip trailing space and tabs in aboutdialog 2012-01-09 23:20:47 +00:00
aa726f723b web: fix gen_gettext script
The script for generating the gettext.js file was outdated and needed
a fix to work with the newer layout of the javascript source code, it
was still looking for Deluge.Something files which no longer exist.
2012-01-09 21:58:48 +00:00
f8651b63c8 Webui: Smaller minSize for Sidebar and remove 1px border from mainpanel 2012-01-07 21:16:13 +00:00
c020d71327 Remove dotted line on buttons in Firefox 2012-01-07 21:12:29 +00:00
527d5541d7 Add Deluge and icon to start of toolbar in webui 2012-01-07 21:12:07 +00:00
57df1bb7c4 Fix clipped Browse button in WebUI 2012-01-07 21:09:32 +00:00
5ad9ff7333 Fix plugin uploads from behind a reverse proxy 2012-01-07 21:06:54 +00:00
7d7e3fad1e Fix password box focus issue in Firefox 9 for WebUI 2012-01-07 21:05:29 +00:00
e8eb7a33f0 Fix #1915 : Unable to stop the status bar from autohiding 2012-01-07 21:02:47 +00:00
8da618a4f2 Remove uneeded Title to save space in WebUI 2012-01-07 20:58:59 +00:00
1c3d8c214c Hide unused Create button in WebUI 2012-01-07 20:57:33 +00:00
bbde86cfb8 web: fix font in loaded html
When dynamically loading the content panels in the details panel they
would sometimes look quite bad since the only font they have been
told to use is verdana. Fix this why using the same as extjs.
2012-01-07 20:55:27 +00:00
5e36722047 Update Changelog 2012-01-07 20:55:15 +00:00
ee35fe1cad Fix #1961 : Missing 'All' filter option for Label plugin 2012-01-07 19:54:00 +00:00
a83fd1d597 Update About dialog for translation 2012-01-07 19:50:14 +00:00
4dbbb4d676 Add clean desktop file to setup.py 2012-01-07 19:47:16 +00:00
6c8e2b48e3 Fix issue in saving libtorrent session state 2012-01-07 19:46:38 +00:00
55892061f5 Update AUTHORS with new paths to plugin and data locations 2012-01-07 19:37:15 +00:00
ae8ea820ef Update Win32 README 2012-01-07 19:33:17 +00:00
d06a0e4f40 Update README file 2012-01-07 19:31:10 +00:00
9bfb565354 New AUTHORS file 2012-01-07 19:26:11 +00:00
132a8f9f0c Add unneeded files for release to export-ignore 2012-01-07 19:25:36 +00:00
75b9fd5cb4 Build deluge-all.js 2011-12-07 01:03:00 +00:00
774e614f7b Update webui build file to run on Ubuntu 2011-12-07 00:52:10 +00:00
9e43956e1b Fix spelling mistake 2011-12-06 23:51:00 +00:00
9d16b50075 Fix #1917 : UnicodeDecodeError with long torrent names 2011-12-04 13:01:50 +00:00
04b8949178 Fix #1988 : Problem retrieving colormap for piecesbar 2011-12-04 00:03:39 +00:00
b69163b57d Fix #1828 : Auth issue with args passed to console 2011-12-03 23:04:47 +00:00
006624f568 Fix missing comma in notifications plugin 2011-12-03 17:09:55 +00:00
4acf548436 Revert "Fix #1338 Seeds and Peers totals not updating"
Did not fix the issue.
This reverts commit 1a9ae62669.
2011-11-29 19:17:30 +00:00
d9193fcc4f Update to the DnD windows fix
Found that the original fix worked fine with GTK v2.24 but with v2.16 on Windows get_uris is empty
2011-11-29 19:17:20 +00:00
a779a4a7ea Fix #1905 : No email sent to second email address in Notifications plugin 2011-11-29 19:14:42 +00:00
2a3d8ae156 Fix #1945 : Mutable default arguments in deluge.ui.client 2011-11-29 19:10:53 +00:00
07d4aff13b Change Windows default download path from '~' to '~\Downloads' 2011-11-29 19:08:41 +00:00
838f9331be AddTorrent file dialog now can browse network shares 2011-11-29 19:08:34 +00:00
3c3f93db3e Fix #1918 : Drag'n'Drop not working in Windows 2011-11-29 19:06:56 +00:00
d98231a713 Remove code duplication in queuedtorrents.py, use ipcinterface process_args() instead 2011-11-29 19:03:59 +00:00
a50c83c284 Modify log message from Error to Warning level 2011-11-29 19:02:20 +00:00
05f30b58c1 Fix Webui files-tab menu setting wrong priority 2011-11-29 19:01:20 +00:00
a932767545 Fix #1921 : GTKUI reports free disk space incorrectly 2011-11-29 18:59:13 +00:00
c29d3bb930 Fix #1967 : IndexError when trying to open a non-json conf file 2011-11-29 18:55:30 +00:00
b4a73cabf3 Fix LP#821577 : UnpicklingError when external selection dragged onto Files Tab 2011-11-29 18:55:22 +00:00
16bbedaf2b Fix #1964 : Unhandled UnpicklingError with corrupt state file 2011-11-29 18:55:14 +00:00
b2eb5aeb8c Fix #1944 : Use errno constants for portability 2011-11-29 18:54:06 +00:00
3dcfa5cfd8 Fix #1912 : Exit nicely from get_libtorrent.sh if svn not installed 2011-11-29 18:47:05 +00:00
307ffe734a Fix #1941 : Increase UIs max cache value to 999999 (15GiB) 2011-11-29 18:46:26 +00:00
ead734cbf0 Fix #1960 : Web UI statusbar shows total_payload_download for upload 2011-11-29 18:42:28 +00:00
46ab11961e Fix #1928 : Crash when dragging column header
The fix specifically applied to on_alert_save_resume_data by moving function call str(alert.handle.info_hash()) into the try statement. For completeness any calls to str(alert.handle.info_hash()) also moved into try statements.
2011-11-29 18:32:06 +00:00
58adbe94b9 Fix #1940 : File & folder renaming issue when using Add Torrent dialog in Windows
The file rename in torrentmanager was calling lt.rename_file directly
so skipping the sanitize function normally applied when renaming.
2011-11-29 18:27:44 +00:00
7227c97cac Fix typo in Windows shutdown handler 2011-08-08 10:42:29 -07:00
4fcfb677a4 Allow changing ownership even though the owner column is not visible. 2011-08-03 11:59:42 +01:00
808ff02130 Fix path for desktop file 2011-07-29 20:56:48 -07:00
08a0a2de99 Fix i18n sub-dir issue in gitignore 2011-07-28 22:56:22 +01:00
fd56ccaabf Fix .desktop file creation on Windows by just ignoring it 2011-07-28 22:53:40 +01:00
cebddf9c79 Add my name to author list 2011-07-22 19:29:32 +01:00
e9b602d85f Update windows setting 2011-07-19 16:50:56 -07:00
5b2d37954c Add intltool to dependencies 2011-07-13 23:27:00 +01:00
fcc13f454b Fix torrent file and folder renaming issues
Adds `sanitize_filepath` for use before passing to libtorrent rename_file
2011-07-13 22:44:13 +01:00
15ef668fef Localize the Desktop file
Conflicts:

	setup.py
2011-07-13 21:49:25 +01:00
bf145c0715 Option tab spin buttons connected to key press events 2011-07-11 17:23:42 +01:00
192f3d88e5 set spinbuttons numeric only 2011-07-11 16:27:48 +01:00
d9cf3a8c08 Remove un-needed signal handlers. 2011-07-11 15:15:45 +01:00
a41b1357b5 Update translations files 2011-07-11 14:27:08 +01:00
c3c21dae72 More missing(?) signal handlers. Refs #1891. 2011-07-10 23:24:10 +01:00
4daa7e2470 Fix the options tab. Refs #1891 2011-07-10 22:51:10 +01:00
b301051cdd Fix #1637: UnicodeDecodeError from 'deluge-console --help' with other languages 2011-07-10 16:45:02 +01:00
456f660878 Add some more lost signal on the Glade to GtkBuild migration. 2011-07-10 02:58:46 +01:00
f7ce07c68f Tidy up location of gettext setup_translations 2011-07-10 02:10:14 +01:00
9eb85cb6eb Fix lost signals for peers tab menu, files tab menu and options tab. 2011-07-10 02:05:20 +01:00
40fd945f70 Fix translation string in Freespace plugin 2011-07-10 01:58:08 +01:00
78944f47f3 Allow compiling translations in develop mode.
Translations will compiled into `deluge/i18n` instead of the build lib so that they can be used in a deluge develop mode install.
2011-07-10 01:20:13 +01:00
acb747bfd5 Log from where translations are being loaded. 2011-07-10 00:43:56 +01:00
0c1055511d Raw attempt of fixing the GtkBuilder introduced bugs. 2011-07-10 00:43:01 +01:00
f0c327a024 Fix #1505: Add libtorrent info to --version output 2011-07-09 23:19:57 +01:00
b81159f295 Fix #1801: ConsoleUI failed connect missing error message 2011-07-09 22:11:13 +01:00
ca86aa5714 Fixes keyerror with existing file priorities set to High 2011-07-08 23:34:02 +01:00
fc7fa94319 Add handler for drag_data_received to supress warning 2011-07-08 23:23:03 +01:00
c6ee8cf39d Do not use Ellipsis. 2011-07-08 10:03:04 +01:00
bd7bbc4e33 Add some "now needed" missing imports. 2011-07-08 04:07:04 +01:00
312a57aa50 Remove some left overs. 2011-07-08 00:39:48 +01:00
f87ed6d5a6 Moved the MainWindow to GtkBuilder.
This probably broke some behaviour because converting and splitting from libglade to GtkBuilder is not as perfect as it should be. What I noticed was fixed.
Also, GtkBuilder only allow calling `connect_signals()` once. Some code had to change to handle this and a "handlers proxy class" was created to keep the behaviour we had, ie, connect signals from where it was needed. Then I monkey patch the main windows GtkBuilder to not allow anyone to connect signals through it since it would break behaviour. Connecting signals to the main window builder instance is now done like `component.get("MainWindow").connect_signals()`. The best solution will probably break the main window ui into the needed parts in order to not have to monkey patch main windows builder.
Plugin's trying to get the main windows `main_glade` are now broken, on purpose, ie, the code they have needs to change since the calls to the builder are not the same as the calls to libglade. The plugins we ship with deluge will be fix as soon as possible.
2011-07-07 20:48:02 +01:00
4234311050 Start with a bigger width. 2011-07-07 20:48:02 +01:00
a47da57c0d Make sure the tracker url is of type string and not unicode. Never had this issue previously though. 2011-07-07 20:48:02 +01:00
13528fe7f8 Fix httpdownloader Tests 2011-07-07 01:22:51 +01:00
99358dcbb0 Fix httpdownloader error with existing filename 2011-07-07 00:11:00 +01:00
16cc8f6eea LP Bug #496265: Peers in PeersTab show non-zero download rate when seeding 2011-07-07 00:11:00 +01:00
a384cd70b3 Moved system tray to GtkBuilder. 2011-07-06 22:20:15 +01:00
0e00aa479b Moved queued torrents dialog to GtkBuilder. 2011-07-06 22:14:20 +01:00
807bc095b4 Moved remove torrent dialog to GtkBuilder. 2011-07-06 21:10:24 +01:00
5a81ab3c35 Moved the preferences dialog to GtkBuilder. 2011-07-06 20:56:58 +01:00
bad228645c The Stats plugin should not be using the old logging system. 2011-07-06 20:56:08 +01:00
e016b2106f Fix some broken GtkBuilder files. 2011-07-06 20:03:32 +01:00
f63f247ac5 Forgot to rename a glade from when migrating it to GtkBuilder. 2011-07-06 19:31:47 +01:00
0228af6b50 Add some missing .ui files. 2011-07-06 19:30:01 +01:00
90fb40b741 Moved the menubar to GtkBuilder. 2011-07-06 19:29:27 +01:00
367631c9aa Migrated filtertree_menu.glade to GtkBuilder. 2011-07-06 19:17:44 +01:00
b36d62be9b Fix #1263: GTK UI not remembering column width
Removing a column from the treeview on shutdown causes all the
column widths to be zero which are saved to the state file.

The workaround is to not save the state file if all columns are zero.
2011-07-06 19:16:31 +01:00
b4cc1d4358 Splited dgtkpopups.glade into other_dialog.ui and connect_peer_dialog.ui which are now using GtkBuilder. 2011-07-06 19:09:25 +01:00
39ad5a3596 Moved edit trackers dialog to GtkBuilder. Min PyGTK version is now 2.16. 2011-07-06 18:54:40 +01:00
dbad4684db Create torrent remotely progress information.
Support progress information when creating torrents remotely. For this to be possible, a method was added to the `RPCServer`, `emit_event_for_session_id()`, which does exactly what is says. This is needed because the event created, `CreateTorrentProgressEvent` needs to be addressed to a single session id, not all session ids interested in that event.
Fixed a bug that apparently was not found yet. When creating torrents locally, we defer that task to a thread. Since this thread updates UI widgets, namely the progress bar info and since we can't guarantee that it's the main thread, updating the widgets must be done by calling `gobject.iddle_add()`.
2011-07-06 16:45:02 +01:00
12d0e9574b Migrated create torrent dialog to GtkBuilder.
Additionally creating a torrent and saving it on a remote path now mimics the behaviour on doing it locally. Need to evaluate to see if it's possible to also show a progress when doing this remotely as now, the progress is only seen when doing it locally.
2011-07-06 12:45:50 +01:00
dd50b7bea1 Include deluge/ui/gtkui/glade/*.ui data files in setup.py. 2011-07-06 12:33:44 +01:00
4dc4049851 Migrated the connection manager to GtkBuilder. 2011-07-06 11:33:31 +01:00
27a6e398ee Migrated the "add torrent dialog" to gtkbuilder. 2011-07-06 11:17:13 +01:00
7035b1f166 Specify the plugin's name on logging calls. 2011-07-06 11:10:46 +01:00
a701fddbe8 Fix #948: New Release Dialog does not show server version 2011-07-05 19:49:53 +01:00
b512a664c6 Properly set/restore visibility when torrent is/is not "compact". 2011-07-05 15:46:36 +01:00
5bffa3757d Don't default to "localclient" as owner unconditionally.
Only set "localclient" as a last resort, first try to find out who is logged in.
2011-07-05 15:29:51 +01:00
8b6d6e3836 Fix broken SessionProxy tests. 2011-07-05 09:29:12 +01:00
37b9277c0e Update ubuntu tracker icon test 2011-07-05 18:00:06 +10:00
cf891125e6 Only deregister component if registry still exists 2011-07-05 17:58:18 +10:00
f75ec9d484 Fix translation of KiB/s 2011-07-04 21:39:08 +01:00
9a1ae06033 Fix #1239: Translated Tracker Error text not counted in sidebar Error status 2011-07-04 21:29:58 +01:00
55f456d851 Fix up/down speed labels in status tab 2011-07-02 19:14:26 +01:00
c346687510 Fix #1715: AddTorrentsDialog does not display filename changes when switching between torrents 2011-07-02 19:14:26 +01:00
08ee3d8f69 Fix #1582: Wrong path separator returned when moving storage in Windows 2011-07-02 19:14:18 +01:00
795f633bc4 Fix #491: Add auto_manage_prefer_seeds to prefs manager and UIs 2011-07-02 18:44:26 +01:00
b6596a27bc Add 'Last Seen Complete' to GTK and WebUI Status Tabs 2011-07-02 15:50:04 +01:00
b7fd2d1bf1 Fix #1338 Seeds and Peers totals not updating 2011-07-01 02:40:40 +01:00
0f625943c0 Fix #1477: Execute Plugin should ignore Added events from state file on startup 2011-06-30 19:24:38 +01:00
420447e386 Fix #1232: Improve display of Peers Tab IPv6 addresses 2011-06-30 18:02:06 +01:00
a79520e3ee Fix append trackers error occuring with magnet uris 2011-06-30 17:30:46 +01:00
8ae26c368e Add #890: If added torrent already exists, append extra trackers to it 2011-06-28 01:34:58 +01:00
981ad6d7d2 Fix #1246: Losing Labels upon restart 2011-06-27 22:53:47 +01:00
3b5e70580e Fix from_state in TorrentAddedEvent 2011-06-27 22:50:47 +01:00
71f9ef6499 Adjust file priorities to make Highest actually the highest allowed by libtorrent and High has been changed to what Highest was 2011-06-21 10:50:57 -07:00
7dd54b4b34 Save and restore Preferences dialog size from config 2011-06-19 23:29:54 +01:00
c64ed6adc5 Fix preferencesmanager from failing to stop when trying to stop
loopingcall that wasn't started
2011-06-18 20:13:58 -07:00
a82c753ac0 Fix uri handling when dragged to gtk window 2011-06-18 12:45:21 +01:00
96b5f617f2 Change log level of connect failed to INFO 2011-06-17 18:07:34 +01:00
842734c4e4 Add a file exists check to torrents passed as arg 2011-06-16 21:18:10 +01:00
095f4ff20a Fix path error with torrent files prefixed with 'file://' from Firefox 2011-06-16 21:18:09 +01:00
ed0b017fe1 Increase max piece size to 16 MiB in create torrent dialog
Increasing it beyond this will require changes to
createtorrentdialog.py
2011-06-10 13:24:36 +10:00
ce9b540b97 Initial GTK UI Speedups.
The speedups work is being separated into 2 different phases and possibly branches. The idea is to have this minimal speedup merged into master as soon as possible since it's pretty simple. Reduces initial data transfer to about 10% of what was previously being transfered when client connected.
The second phase is regarding row updates, ie, reduce them to what's actually being seen. This part is way more tricky.
2011-06-09 13:49:07 +01:00
5112ed48d1 Fix starting deluge-web when using osx/windows since the options are presented, the later conditionals fail since the options object does not have those attributes 2011-06-06 14:57:50 -07:00
dfa8834db8 Fix starting deluge-web 2011-06-06 14:57:38 -07:00
5bc63fa910 Change component.deregister to take the object as the parameter, not the name 2011-06-06 14:19:51 -07:00
24c945f139 Add a RPCServer.deregister method
Deregister RPC exports when disabling a Core plugin
2011-06-06 13:55:51 -07:00
2542ad9234 Let the Core fire the PluginDisabled event instead of disabling the plugin right away 2011-06-06 13:55:17 -07:00
acb4ab44d2 Merge branch 'stats_plugin_master' 2011-06-06 21:37:08 +01:00
16fbf27b90 Stats plugin update 2011-06-06 21:36:37 +01:00
3397c2487b Fix bug introduced on previous commit. We need to get a selection first! 2011-06-06 19:46:02 +01:00
66e8b34a54 GTK UI un-select row on torrentview shutdown and filter change.
This is specially useful when multiple torrents are selected. This way, the "changed" signal won't be triggered for every row.
2011-06-06 19:40:14 +01:00
59f9d4e5cc Revert "Work around plugins being garbage collected once enabled twice."
This reverts commit 2f71ef4264.
2011-06-06 18:16:05 +01:00
221dea1f1a GTK UI. Center the custom speed dialog on parent(statusbar). 2011-06-06 17:45:51 +01:00
4420aae092 Late import GTK UI's ConnectionManager so that the translations code can be properly setup. 2011-06-05 22:48:17 +01:00
ddc0957e3e Wrap non deluge exceptions so that they can also be sent to the client. 2011-06-05 22:44:01 +01:00
2f71ef4264 Work around plugins being garbage collected once enabled twice.
When a plugin is enabled, disabled and then enabled again, on that second enable, that instance is being garbage collected causing the loading of the plugin to fail. Work around that until we can narrow down why is this is happening on the second enable.
2011-06-05 22:28:37 +01:00
bc56b749ee Merge branch 'translate_updates' 2011-06-05 17:03:21 +01:00
34c95a08a3 Fix translations texts in glade and python files 2011-06-05 17:02:33 +01:00
9ae19e173f Remove page x from translatable in pref_diaog glade 2011-06-05 17:02:33 +01:00
6672aaba1b Change translatable to No for gtk stock labels 2011-06-05 17:02:33 +01:00
0712fc9dee Add gtk-* items to gettextize 2011-06-05 17:02:33 +01:00
07dc9005f3 Update gettextize to ignore .git folder 2011-06-05 17:02:33 +01:00
274a76ab3b Fix translate string in notifications plugin 2011-06-05 17:02:33 +01:00
777993f74a Fix translated string in addtorrentdialog 2011-06-05 17:02:33 +01:00
d1037ae213 update create_potfiles_in to ignore plugins build dir 2011-06-05 17:02:33 +01:00
15e9f5f218 Add 2 more commands to setup.py
Two more commands were added to setup.py:
 * develop_plugins - Installs each of the plugins in development mode
 * egg_info_plugins - Create the '.egg-info' distribution directories for each plugin. This will make the plugin discoverable by deluge

Both these commands are intended to be used while developing deluge.
2011-06-05 16:58:27 +01:00
4aab110aaf Remove duplicate code. 2011-06-05 16:23:09 +01:00
8933ac3123 Fix #1560 - FilesTab Progress value sorting by int instead of float 2011-06-05 13:23:23 +01:00
2e896b520e Fix #1456 - No ETA showing with multiple files 2011-06-05 13:23:16 +01:00
16d27b9657 Catch snd_path is None error in Notification Plugin 2011-06-04 23:24:39 +01:00
d3e8afdda1 Fix Extractor and Example plugin not starting 2011-06-04 22:56:36 +01:00
b86ba13376 Fix Feeder plugin name 2011-06-04 22:51:41 +01:00
f736576436 Fix Execute plugin not starting 2011-06-04 22:51:15 +01:00
9d1715405f Try to get some more debug info for plugins which are failing to load. 2011-06-04 19:25:53 +01:00
ee0d757b0e Some more fixes for plugins not fetching data from the correct namespace. 2011-06-04 19:23:03 +01:00
32c95fac1e Fix the Label plugin to get resources from the namespace. 2011-06-04 19:19:01 +01:00
df3214168c Cleaner fix for #1874, code clean up and reusability.
Translations are now setup on `deluge.common`. Where they used to be setup, a call to `setup_translations(setup_pygtk=False)` is now made.
Every call to `pkg_resources.resource_filename()` is now made through `deluge.common.resource_filename` to make sure that we're loading data from the right deluge install.
2011-06-04 18:06:45 +01:00
9e9261e6f8 Fix #1874.
While developing, if there's a second deluge package, installed globally and another in develop mode somewhere else, while pkg_resources.require("Deluge") returns the proper deluge instance, pkg_resources.resource_filename does not, it returns the first found on the python path, which is not good enough. Work around this issue.
2011-06-04 15:56:14 +01:00
087e94f6a1 Update all columns which use the "state" status field on the GTK UI TorrentView and not just the Progress column. 2011-06-04 10:43:24 +01:00
abe0031c2b Trigger a deprecation warning for code calling "getPluginLogger".
Since the plugins namespace was merged into master, calling "logging.getLogger(__name__)" will result in a properly named logger for plugins which will allow logging filtering.
The previous workaround "getPluginLogger()", is now deprecated.
2011-06-04 09:02:53 +01:00
13db148a11 Now that the plugin's namespace is in use, make the plugins get their own logger instead of using getPluginLogger() 2011-06-03 23:10:43 +01:00
84c5078667 Merge branch 'master' of deluge-torrent.org:deluge 2011-06-03 14:55:34 -07:00
cebdc89b18 Fix systemtray from stopping properly when appindicator is enabled 2011-06-03 14:53:41 -07:00
87e767d4c1 Merge branch 'master' into plugins-namespace 2011-06-03 17:48:22 +01:00
ce406674ec Update setuptools version in ez_setup 2011-06-02 21:50:38 +01:00
ac5f9a2828 Fix up stopping classic mode 2011-06-02 11:55:26 -07:00
6d55c44983 Fix menubar component stopping properly 2011-06-02 11:54:53 -07:00
1557d0da1f Move the log level to the left of the module because this field is a fixed width and its easier to read this way 2011-06-02 11:53:54 -07:00
2f785216f6 Show errors when trying failing to properly stop a component 2011-06-02 11:53:34 -07:00
8f1730591b While clearing the search filter, restore from pre-filter if available. 2011-06-02 11:16:11 +01:00
9ec44894d4 Fix #1873. Re-add the files and peers tab menus. 2011-06-02 10:58:45 +01:00
bb981127db spaces FTW 2011-06-01 20:29:38 +01:00
a96aeed706 Fix #1869: Set the disk io read/write to bypass OS cache in Windows as suggested in http://code.google.com/p/libtorrent/issues/detail?id=166 2011-05-31 09:56:23 -07:00
f14de6553a GTK UI search box grab_focus() on show. 2011-05-31 15:20:15 +01:00
b521b3065b GTK UI search box pre-filter implementation.
Implement a pre-filter for the search-box which will filter the currently visible torrents while waiting for the filter request to sent to the demon. This will make the searches seem way faster :)
2011-05-31 14:36:05 +01:00
ea438609bf GTK UI search by torrent name filter as a "toolbar".
Now, instead of permanently having a search box to filter the visible torrents by name, we now, mimic a toolbar just for that, mapped to CTRL-F. There's also a menu item in the "View" menu and a toolbar icon to toggle it. Implemented "Match Case" for the search.
2011-05-31 13:38:48 +01:00
0ba51d0e51 Fix peers tab flagsos.path.join 2011-05-30 22:14:36 +01:00
53370e4639 Fix peers tab flags missing 2011-05-30 21:33:17 +01:00
c70c8ea45d Add check to key_press_event for keyname returning None 2011-05-30 18:18:27 +01:00
937b53b355 pixmaps and icons moved to ui/data, all necessary references changed. 2011-05-30 17:57:39 +01:00
27cd89c4ad Remove setting the resume_data key to '' in the add_torrent_params as this causes libtorrent 0.16 to crash 2011-05-29 18:09:04 -07:00
c4dbf017a5 Merge branch 'master' into pieces-progress-bar
Conflicts:
	deluge/ui/gtkui/glade/main_window.glade
2011-05-29 20:00:25 +01:00
ec74f9aae3 Merge branch 'gtkui-search-by-name' 2011-05-29 19:21:12 +01:00
cfd955a605 AutoAdd plugin: Don't try to remove the same path twice! 2011-05-29 19:06:54 +01:00
feed806983 Wait at least 0.7 secs before triggering an update because of the search box, ie, allows typing the full search string before making the request. 2011-05-29 19:02:33 +01:00
c66637116b Allow searching torrents by name on the GTK UI. 2011-05-29 17:10:57 +01:00
4d4c6404b1 Log exception occurring while sending RPC errors to clients. 2011-05-29 16:39:00 +01:00
042ddd2891 Checkbox had no signal. 2011-05-29 14:36:26 +01:00
af24542856 AutoAdd plugin fix for #1863
In some cases, using `os.rename` between different mount points can trigger an `OSError`. Try to address these issues properly.
2011-05-29 11:37:31 +01:00
6dc393ed23 Allow a smtp port higher than 100
Add a shadow to scrolled window
2011-05-28 18:26:53 -07:00
c13eade81c Merge branch 'master' into pieces-progress-bar 2011-05-28 21:59:20 +01:00
eb639c3722 AutoAdd plugin auto fill.
When adding new entries, the dialog is auto-filled with what's defined for the Downloads entry in the preferences.
When showing errors, use the dialogs module.
Added some tooltips to the dialog.
2011-05-28 19:43:25 +01:00
dc514d308c GTK ui dialogs now have deluge's icon set. 2011-05-28 18:59:04 +01:00
67b5cde128 Fix #1867.
Now, if any option is changed on a torrent's options tab on the GTK UI, the apply button is set to sensitive.
2011-05-28 11:42:09 +01:00
ef98d19ed4 Merge branch 'master' into pieces-progress-bar 2011-05-28 10:54:03 +01:00
94a7b2ebf1 Fix #1861 - AutoAdd Warning (column number is a boolean) 2011-05-28 00:14:01 +01:00
e0443943b5 Catch an IndexError occurring in Files Tab when scrolling through long list of torrents 2011-05-28 00:05:18 +01:00
dd78a75ca8 Fix #1860 - Files Tab TypeError (could not parse subscript as a tree path) 2011-05-28 00:05:12 +01:00
82712c80e1 Fix #1195 - Right-click selecting issue when switching between files and folders 2011-05-28 00:05:00 +01:00
a710bcaed4 Add F2 key shortcut to rename files in Files Tab 2011-05-28 00:04:55 +01:00
3a7c182f83 Add XDG_DOWNLOAD_DIR for default download folder #1788 2011-05-28 00:01:58 +01:00
d42778afa3 Show the checking icon for the Checking Resume Data state 2011-05-25 13:21:16 -07:00
724025092a Set the WM_CLASS name to Deluge 2011-05-25 13:18:12 -07:00
bd43f3c464 Small text updates 2011-05-24 02:00:05 +01:00
8464a938b2 Fix up displaying versions in the about dialog 2011-05-23 17:09:16 -07:00
b8fad45eaa Change Connection Manager Key Shortcut to Ctrl-M 2011-05-23 22:23:35 +01:00
b08e90ac2a GTK UI edit trackers dialog. Remove un-used attribute. 2011-05-23 09:37:02 +01:00
13a379ef6c Update certain torrentview columns to default to not visible 2011-05-23 01:06:37 +01:00
09e24df4bb Merge branch 'masterchanges' 2011-05-22 23:36:49 +01:00
019f2a0619 Fix Up/Down buttons in Edit Trackers Dialog 2011-05-22 23:22:37 +01:00
2fb874d486 Add ability to set columns as not visible by default by setting the kwarg default to False when adding the column 2011-05-22 15:12:11 -07:00
85b4ceec30 Feature #1308: Add Seeds/Peers ratio to torrent list view 2011-05-22 22:48:03 +01:00
b0599313bc Feature #1646: Add columns for per torrent upload and download speed limits 2011-05-22 22:35:20 +01:00
974f48380f Change default value of close_to_tray to False
Prevents default install of Deluge disappearing if tray icon is missing.
2011-05-22 22:19:36 +01:00
b3865d0a7f Fix GTK UI edit trackers dialog.
Fix an issue with the edit trackers dialog where editing, adding or removing trackers was not "saved" in client/daemon mode.
2011-05-22 21:56:16 +01:00
79c9dd3076 Add libtorrent version to user_agent string
Example: Deluge/1.3.900-dev Libtorrent/0.15.5
2011-05-22 19:20:40 +01:00
edb0c2e71d Modify setup scripts to be executable 2011-05-21 18:54:15 +01:00
1c58dce3c1 Supress gobject warning in filtertreeview and torrentview
In console the warning "g_object_set_qdata: assertion `G_IS_OBJECT (object)' failed" will appear. Quick investigation could find no solution with suggestions a python issue.
2011-05-21 17:32:20 +01:00
445f3c0123 Fix menu bug caused by Change Owner menuitem code
The right-click torrent menu would move/jump around when the option submenu was opened with the mouse, possibly due to a conflict between glade file and append menuitem code in menubar.py. Solution was to create a menuitem entry for Change Owner in glade file and update code to add submenu to this new entry.
2011-05-21 16:23:36 +01:00
eb15c96403 Add key shortcuts for menu items 2011-05-21 16:22:42 +01:00
71f411e458 Some comment explanation. 2011-05-19 00:29:30 +01:00
856a6cd1ab Pieces bar "calculation" bug fix. 2011-05-18 05:01:30 +01:00
99f2dbd178 Minor __doc__ naming change. 2011-05-18 05:01:30 +01:00
0e4747bf22 Lower debug messages level. 2011-05-18 05:01:30 +01:00
81637f4572 Add a nice border to the pieces bar. 2011-05-18 05:01:30 +01:00
25f086fa85 PiecesBar caching.
The drawings made on the pieces bar are now cached in "sub-drawings" kept in memory. If no data has changed, those "sub-drawings" are used. If data changed, redraw whatever is necessary.
2011-05-18 05:01:30 +01:00
6d57a29f1d PiecesBar rounded corners. 2011-05-18 05:01:30 +01:00
9b3f5783d5 Update ChangeLog. 2011-05-18 05:01:30 +01:00
b3492b07a1 PiecesBar
Now, either show the pieces bar or the progress bar, not both.
2011-05-18 05:01:30 +01:00
28def22625 PiecesBar enhancement.
The pieces bar will now draw status text, like a regular progress bar does, and for the overall progress, a semi-transparent overlay is also drawn.
2011-05-18 05:01:30 +01:00
427fe23bdc Minor comment cleanup. 2011-05-18 05:01:30 +01:00
da5c5d4b84 PiecesBar implementation.
We now provide an option to the user to see the states of a torrent's pieces, ie, completed, downloading, waiting, missing.
If the user has this option enabled, another 3 will be shown to him(on the GTK UI), which will allow him to choose the colors for each piece state.
2011-05-18 05:01:29 +01:00
438cbd2238 Correct the pieces states "calculation". 2011-05-18 05:01:29 +01:00
2d59b62317 Provide the option to the user to use the pieces bar or not(Glade file only). 2011-05-18 05:01:29 +01:00
19f32b1446 Provided a method to get the pieces information.
Each piece will return 0 for a missing piece, 1 for a not downloaded piece, 2 for a downloading piece and 3 for a downloaded piece.
2011-05-18 05:01:29 +01:00
9b812a4eec Extend RPC Protocol.
While adding the multiuser auth related stuff, RPC_AUTH_EVENT was added, simply to not touch how RPC_ERROR was handled. It was created to allow recreating the exception on the client side. Instead of adding another rpc event type, extend RPC_ERROR to send the proper data to recreate the exception on the client side.
2011-05-18 03:56:17 +01:00
e383187796 Fix #1281. Show a nice dialog stating that the client is incompatible on the GTK UI. 2011-05-17 22:50:05 +01:00
6151050ad4 PEP-8 2011-05-17 22:16:12 +01:00
9a3bf35cdf Include our custom lower log levels into python's logging. 2011-05-17 02:47:16 +01:00
6391970fad Updates to desktop file
Add magnet mimetype and tryexec key
Fix exec key to handle files and urls to conform with new desktop-entry spec
Update name, comment and category keys
2011-05-16 22:11:20 +01:00
0ba0e013b5 Force backwards incompatibility.
Force clients prior to 1.4 to fail authentication, this was we might reduce tickets like #1852.
2011-05-15 22:18:38 +01:00
552c898998 Fix #1844.
The submenu got lost on one of the glade files merges. Re-added.
2011-05-15 11:26:41 +01:00
bc5b4d902f Fix LP Bug #779074 - TypeError in on_key_press_event(): cannot concatenate 'str' and 'NoneType' 2011-05-12 22:42:13 +01:00
6a8e3f1c49 Minor code cleanup. 2011-05-11 09:06:21 +01:00
81ca9952e9 Moved core.conf config upgrade to core instead of pref's manager. 2011-05-10 20:15:33 +01:00
74618d5a65 GTK UI move storage fixed. Was still not allowing moves. 2011-05-10 20:13:26 +01:00
0c110c2408 Fix broken tests. Twisted deferred loops, must be stopped! 2011-05-10 11:21:24 +01:00
1ac997e7d7 Upgrade core config and handle empty AutoAdd watchdirs.
We now upgrade the core's config to include 'sequential_download'.
On the auto add plugin, if there are no watchdir, provide a default that will allow the GTK UI not to thrown an exception.
2011-05-09 15:47:10 +01:00
d4692bef42 AutoAdd Plugin. Remove line feeds from log messages. 2011-05-08 23:48:42 +01:00
77fc53afc0 Sequential downloads. Was querying for the wrong key on the torrent status. Fixed. 2011-05-08 23:46:55 +01:00
3b676eca40 Sequential downloads: Implemented in GTK UI torrent options tab. 2011-05-08 23:33:21 +01:00
ce3ce2c035 Sequential downloads: Implemented in GTK UI preferences dialog. 2011-05-08 23:11:51 +01:00
c8735b5cab Sequential downloads: Implemented in add torrent GTK UI dialog. 2011-05-08 22:55:55 +01:00
cc5f2ffe18 Implemented sequential downloads on core. 2011-05-08 22:39:11 +01:00
89b79c76a3 Multiple files prioritize first last.
Now `set_prioritize_first_last()` sets the first 2% and the last 2% of the pieces of each file on a torrent at a high priority, ie, it no longer works on just single file torrents.
2011-05-08 22:11:20 +01:00
837c39fdda Last seen complete checks.
Remove some un-necessary `lt.version_minor` checks since these checks will remain for a while, at least until deluge depends on libtorrent >= 0.16 which should preferrably not happen.
2011-05-08 21:58:26 +01:00
110026edbe AutoAdd plugin #1842
Fix bug #1842 and also implement "delete torrent file on torrent removal from session".
2011-05-08 21:38:53 +01:00
3b8ebf68a6 GTK UI menubar accounts retrieval.
Only ask for known accounts if we have the required level for it.
2011-05-08 21:36:10 +01:00
ffd344d0b5 On some "race" conditions, the torrent is removed before it's status could be retrieved. Return an empty status. 2011-05-08 21:35:06 +01:00
9d29ca7b29 Check against libtorrent >15 not >16. 2011-05-08 02:39:35 +01:00
38906468c1 Last seen complete
Update last_seen_complete when a status is queried for and that key is on the keys to get or it's a full status query. Either way, only "calculate" last seen at a minimum of one time per 60 seconds(simple caching).
2011-05-08 01:36:40 +01:00
95d7caf3ac Implement Last Seen Complete, on core and on GTK UI. 2011-05-07 20:22:55 +01:00
4044f52f77 GTK UI Torrent's options tab.
Set the apply button to sensitive if the value of a spin button changed. This was missing.
2011-05-07 15:54:10 +01:00
a7bd953169 GTK UI Connection Manager (#1824)
Warn the user if he's trying to connect to a local daemon that's not running and "start local daemon if necessary" is not enabled.
Extend and reuse the connection callbacks on the connection manager to re-use code.
2011-05-07 15:14:32 +01:00
8922717ff2 fix unrequired requests 2011-05-07 13:20:09 +01:00
117d50b728 fix a bug when the host_id doesn't exist 2011-05-07 13:20:04 +01:00
04af8965bc apply patch from #1742 2011-05-07 00:02:49 +01:00
d6f5e5b4ec fix #1537 editing trackers list, trackers have to be reselected 2011-05-06 23:44:19 +01:00
1f3a7bf44c Fix #1333 Peer list doesn't update automatically 2011-05-06 23:25:07 +01:00
2e62ced811 fix #1323 filter panels not scrollable 2011-05-06 22:33:10 +01:00
95819c79e5 Fix #1268, Torrent errors not displayed in webui 2011-05-06 22:23:25 +01:00
5ad21303c6 fix issue #1567, js from plugins not working with different base setting 2011-05-06 22:09:17 +01:00
922e64a07e fix issue #1799 2011-05-06 22:01:06 +01:00
30d70d2b9b apply patch from #1562 2011-05-06 19:16:20 +01:00
a06b350858 Correct log message. 2011-05-06 19:10:26 +01:00
06f025f4bd fix the widths on the input boxes, whitespace changes too 2011-05-06 19:03:05 +01:00
d362a6ceba fix the path given by the set-cookie header 2011-05-03 19:05:15 +01:00
138b8ae314 Sorry for the noise. Email change. 2011-05-02 05:02:46 +01:00
6f3bc5620f Fix #1824.
When connected to a client, and then trying to connect to another, the connection manager component will be stopped(while the connect deferred is still running), so, the ConnectionManager.connection_manager reference will be deleted. If that's not the case, close the dialog.
2011-05-01 07:41:44 +01:00
f2249d5803 Remove un-used import. 2011-05-01 04:46:54 +01:00
f26de83509 Don't run into loops when the auth file does not exist and we're trying to create it. 2011-05-01 04:44:42 +01:00
f6826a4f48 Fix #1822
Only query the core for the known accounts if connected to it.
2011-04-30 20:45:15 +01:00
dd3f78bd36 More changes related to automatic connections.
Auto-connecting on start of the gtk ui is now fully working.
Auto-staring localhost if needed is now also working.
Authentication failures now get passed correctly to the client implementation which will allow the user to enter username and/or password to complete authentication.
It's now possible to shutdown the daemon from the connection manager even if not on localhost, it just needs all required information to be present on the liststore.
2011-04-30 07:42:06 +01:00
63d0d0c69b GTK UI connection manager fixes.
Auto-connecting to daemon now works. Fixes #1815.
Auto-starting a `localhost` daemon now also works, the reconnecting attempts were not being "triggered".
When not connected to a daemon, "Quit & Shutdown Daemon" is not present. So #1818 is also fixed.
Some more work regarding #1819 was done.
Client now disconnects before shutting down the GTK UI.
2011-04-28 16:59:01 +01:00
1be59bb116 don't show decimals for 100% progress (100% instead of 100.00%) 2011-04-28 14:28:53 +02:00
751345fc28 minor function renaming to make things properly private 2011-04-28 14:28:53 +02:00
12ea65d188 show priorities for directories. fulfills feature request 1688 2011-04-28 14:28:53 +02:00
e950cca059 reset selection to top on alltorrent resume in case another mode has effected torrent list 2011-04-28 14:28:53 +02:00
a063095dad Make sure we have a config loaded in the connection manager. Fixes #1819. 2011-04-28 11:06:26 +01:00
39978d5ade Fix #1278 by keeping references. 2011-04-28 10:37:35 +01:00
9fa8748432 Fix some clean config dir issues.
Moved some auth stuff to `deluge.common` because they're also used on the GTK UI.
Now, if a user starts deluge in classic mode and tries to change it to client/daemon mode, he see's a dialog stating that the current session will be stopped. If he answers no, nothing is done, the classic mode pref is set back as it was. If he answers yes, all components are stopped and client is disconnected. At this stage the user can open the connection manager to start the daemon and connect.
If the user starts in client/daemon mode and switches to classic mode he see's a dialog stating that deluge must be restarted.
The GTK UI connection manager now loads it's default config with the localclient username and password. If not present in the auth file, the auth file will be recreated.
2011-04-27 22:06:13 +01:00
18b27d4b49 Remove a pref regarding auto adding in queue thinking it was from the core's previous AutoAdd. Re-Added. 2011-04-27 19:42:54 +01:00
f41f6ad46a Test fixes and #1814 fix.
All test were adapted, and some more were added to comply with the new multiuser support in deluge.
Regarding #1814, host entries in the Connection Manager UI are now migrated from the old format were automatic localhost logins were possible, which no longer is.
2011-04-27 19:32:13 +01:00
bb9a8509c8 Fix trying to load the AutoAdd component as it no longer exists in core 2011-04-27 11:03:43 -07:00
6694ac7a58 Merge branch 'master' of deluge-torrent.org:deluge 2011-04-27 17:30:09 +01:00
81d22eb730 When parsing the auth file, if an old format is found(with no auth levels), make sure that the localclient always has the ADMIN permission as he should. 2011-04-27 17:30:00 +01:00
47a9b18b89 enforce min/max values for float/int spin inputs 2011-04-27 18:09:20 +02:00
292929ba59 better handling of keyboard input in int/float spin inputs 2011-04-27 18:09:20 +02:00
cbcf413ffd use callbacks for mode switching when stopping alltorrents component. should fix bug 1686 2011-04-27 18:09:20 +02:00
4d8b34209b fix column trimming a bit 2011-04-27 18:09:20 +02:00
98a8be7131 avoid having the tests hang due to a failing to connect client! 2011-04-27 13:38:23 +01:00
2e68e0181c Remove some leftovers from the old multiuser branch. 2011-04-27 13:18:59 +01:00
e6773dfce1 Merge branch 'master' into multiuser-oldprefs 2011-04-27 13:15:05 +01:00
f56be66556 Update ChangeLog. 2011-04-27 13:06:26 +01:00
67a4fd49e9 fix problem when not showing name,state or queue columns. fix problem if there were no var length cols. 2011-04-26 22:59:48 +02:00
e992ac3eab ignore key presses that only makes sense when we have a state when we don't have a state 2011-04-26 14:18:25 +02:00
d05352db65 fix bug for selecting multiple torrents with cursor above last mark (bug 1689) 2011-04-26 14:03:49 +02:00
b1e0dd66eb handle files with [ and ] characters in them 2011-04-26 13:53:11 +02:00
897c2f981f Add help to torrent details mode.
fixes bug: 1687
2011-04-26 12:41:19 +02:00
91801e1632 Cleanup debug message new lines. 2011-04-26 10:14:39 +01:00
fa20e49a93 Fixed 2 bugs regarding torrent ownership change.
On the core, the code was not adapted to the new AuthManager. On The GtkUI, nothing was being shown to the user when errors occurred while changing ownership.
2011-04-26 08:37:20 +01:00
4432e6e6e3 Also handle moving the torrent files after adding them besides renaming or deleting(per whatchdir) 2011-04-25 16:38:49 +01:00
c225c045cb Better file modification detection. 2011-04-25 15:07:07 +01:00
e552c21f66 Automatically detect auth file changes and reloading those changes. 2011-04-25 14:43:44 +01:00
89d04a393b Upgrade old auth file, save it and reload it. 2011-04-25 14:35:01 +01:00
f1730dc4d4 Removed leftovers from the core autoadd. All autoadd features are now addressed by the AutoAdd plugin. NOTE: Console UI and Web UI should also remove the core auto add stuff. 2011-04-25 13:44:27 +01:00
fb5005e3f6 The AutoAdd plugin now supports multiusers. 2011-04-25 13:16:11 +01:00
51b5b23f76 Remove debug printing. 2011-04-25 13:12:18 +01:00
78e966946f Allow setting torrent ownership when adding new torrents. 2011-04-25 09:13:45 +01:00
936bd925d9 Some changes were left behind on last commit. 2011-04-25 08:12:46 +01:00
43e3fe2a1a Account Management Implemented.
Account management is now implemented for the GTK UI. Some changes to the core were required since the clients need to know which authentication levels exist, and, to expose account creation, update, and removal to the clients. The best effort is done to try not to compromise the auth file.
2011-04-24 17:38:35 +01:00
6ed3136c8e No server side logouts.
Do not try to for a disconnect on this branch, maybe on another one.
2011-04-24 17:19:57 +01:00
8195421c99 Some account management work. Not yet complete. 2011-04-22 18:51:51 +01:00
342da12d0c Merge branch 'master' into multiuser 2011-04-22 11:44:10 +01:00
5296fc7d4c Fix one more possible issue with regard to #1786 2011-04-22 11:42:48 +01:00
233e814547 Late import twisted's reactor, it allows the gtk reactor to be proper installed. 2011-04-22 11:33:45 +01:00
03325c5f48 Add some missing code 2011-04-22 11:27:14 +01:00
1a6742b1e2 Keep consistency on deluge.config. 2011-04-22 11:26:09 +01:00
154688a3e2 Implement __delitem__ on deluge.config.Config. 2011-04-22 11:26:09 +01:00
fe12552590 Now, when the authentication dialog appears, user fills in the password and hits ENTER, the authentication call will be made.
Implement tooltips on treeview's headers when adding columns.
Renamed the "public" state of a torrent to "shared", ie, shared among other deluge users. Allow changing shared state from clients and currently from the    GtkUi.
2011-04-22 11:26:08 +01:00
e63c33c496 Allow changing ownership of torrents. In order to achieve this, added deluge.core.set_torrents_owner(), deluge.core.get_known_accounts(), deluge.core.authmanager.get_known_accounts() and deluge.core.torrent.set_owner()`. So far only the GtkUi has this fully implemented. 2011-04-22 11:25:33 +01:00
105cb52cb0 Add method to return the current authenticated username. 2011-04-22 11:24:42 +01:00
3e0ea26e5f Remove unused method, duplicate log messages and add a method to get the logged in user's authentication level. 2011-04-22 11:24:42 +01:00
e44cac0eaa Since there's no default username for authentication, update hostlist to include the username.
Remove debug prints or extreme debugging. Minor code cleanup. Remove un-used imports.
2011-04-22 11:24:42 +01:00
86a1b801f5 Now it is possible to not even store the username on the hosts entry in the connection manager, both username and password will be asked to the user. WARNING: No more "localclient" automatic login, ie, username, is mandatory else, it will be asked to the user. 2011-04-22 11:24:42 +01:00
b3870ad6dd Use a specific response code for authentication requests. Recreate authentication request exceptions on the client end. 2011-04-22 11:24:42 +01:00
67ff83360f Use the exceptions from deluge.errors. 2011-04-22 11:22:19 +01:00
b2a16a0240 Move deluge errors to the errors module, they will be reused later on other parts of code.
Now, calling connect on client has two behaviours, if username/password is passed the client connects, authenticates and returns daemon info, if username/password is not passed, only the daemon info is returned. This might change a bit later on though.
2011-04-22 11:22:19 +01:00
e17c035521 Cleaned up previous commit regarding threads and the GTK2Reactor.
Now a dialog apears if the daemon complains about a missing password in order to authenticate. Asks the password from the user and retries to connect.
2011-04-22 11:22:19 +01:00
249398489e Removed problematic code. GTK2Reactor takes care of all that. 2011-04-22 11:22:19 +01:00
d44f59a0e7 Add some docstrings. 2011-04-22 11:22:19 +01:00
6c99204828 The GtkUi's connection manager now has the ability to edit existing host entries besides adding and deleting them.
It also asks for a password prior to attemting to connect in case the password is null, this alows host entries not to store the passwords on file like it has done so far.
NOTE: This is not yet the desired behaviour, ie, the daemon should simply complain if the authentication details are incomplete and the client should act accordingly. I had an issue with this though, I catched the errback the daemon was sending, asked the user for the password and re-tried to authenticate again. However, twisted always locked when I tried this. I'm investigating it.
2011-04-22 11:22:19 +01:00
1794f09b21 Make branch runnable. 2011-04-22 11:22:19 +01:00
b08a4679de Respect the torrents ownership and unless the logged in user is an admin, only return his own torrents plus all other public torrents. 2011-04-22 11:21:12 +01:00
bfc221fc18 Begin work on fixing up the Preference dialog
Split up the glade file for each individual page
2011-04-22 11:21:12 +01:00
5ad3a1666c Update the ErrorDialog 2011-04-22 11:20:15 +01:00
49d5ed6bde Hopefully, final fix for #1786:
We now make sure that a state file exists when trying to restore an order from it.
The best effort to restore the previous order is made, though, in some cases, since we're matching against names which are translatable, a match might not be found, in that case, continue the effort though skip the non matching column name. On next load, everything should be fine since the state file will include the, now in use, translation.
2011-04-21 20:55:01 +01:00
4b9209674e Merge branch 'master' of deluge-torrent.org:deluge 2011-04-21 18:31:03 +01:00
b9a688013f Fix #1786:
Don't reorder duplicate columns, need to dig how duplicate columns got into the state file, and also skip non visible columns.
2011-04-21 18:29:59 +01:00
387b746fae Merge branch 'master' of deluge-torrent.org:deluge 2011-04-21 10:41:15 +01:00
796109649d fix the client tests albeit in an ultra hacky way 2011-04-21 10:41:00 +01:00
d258794517 Merge branch 'master' of deluge-torrent.org:deluge 2011-04-21 00:47:01 +01:00
98f80c0eb6 Restore column order from state.
On the TorrentView's treeview, the column's position stored on state was being ignored, but event if that info was not being ignored and passed to the several `add_column`'s the order could not be added because the order the columns are added does not(might not) match what was stored in state. So, we now restore the ordering once all columns are added.
2011-04-21 00:42:36 +01:00
d18becc861 fix bug due to vim stripping regex being wrong 2011-04-20 18:37:39 +01:00
0503db85ea Merge branch 'master' of deluge-torrent.org:deluge 2011-04-20 18:34:02 +01:00
bcb636dda4 improve the core tests to use a built in webserver 2011-04-20 18:32:55 +01:00
5bc304470c Let's use what the stdlib provides us. Use email.utils.formatdate instead of strftime() a datetime object. 2011-04-14 09:29:40 +01:00
42e1e2fd20 Include proper Date header in email notifications. 2011-04-13 12:54:59 +01:00
bb0746c3e8 use os.sep and strip what's already in input box from complete options 2011-04-13 11:52:03 +02:00
19799d74b4 Include gif pixmaps in the package data 2011-04-09 22:36:12 +10:00
0d560bcd6f Add update-tracker/reannounce command for command-line/legacy interface 2011-03-29 14:56:39 +02:00
69b79756f2 Merge branch 'master' of git.deluge-torrent.org:deluge 2011-03-28 16:51:23 +01:00
fd248eb1fd split the auto_add_trackers textfield otherwise it breaks the label plugin 2011-03-28 16:51:03 +01:00
45ccd3b84a Fix libtorrent not compiling with boost libs 1.46 2011-03-26 17:33:26 +11:00
298b85c368 Improve autoadd filename matching (fixes #1614) 2011-03-26 17:33:26 +11:00
67add964de Apply patch from #1581 to add an option to enable the app indicator
interface
2011-03-22 17:16:50 -07:00
e81a279dc2 fix naming issue with close callback in popups 2011-03-19 12:38:55 +01:00
280781ded9 queue management in torrent actions 2011-03-13 12:53:13 +01:00
f30a2858ce convert the tests to use a local webserver instead of pinging deluge-torrent.org and damoxc.net 2011-03-08 14:43:09 +00:00
32b41fabd6 Handle redirection when adding a torrent by url 2011-03-09 00:44:42 +11:00
a0f9689664 Handle partial downloads due to incorrect headers (fixes #1517) 2011-03-09 00:40:15 +11:00
08843ccad5 support prefs that don't fit on the screen
remove superfluous log message
2011-03-08 12:21:45 +01:00
e0bb8869aa add some more columns 2011-03-08 11:34:59 +01:00
255af3c485 set status fields to get from visible columns 2011-03-08 00:35:55 +01:00
f35145b0a6 make alltorrents a component like it should be and get rid of alltorrentsstateupdater 2011-03-08 00:16:42 +01:00
f2d560351e add preferences for display and size of columns in alltorrent mode 2011-03-07 13:40:25 +01:00
62da60a0e4 break out each column preference 2011-03-07 12:37:23 +01:00
d9c1a56d44 use config params for columns to show 2011-03-07 12:14:36 +01:00
84f278dbcc show a 'scrollbar' of sorts for popups with a lot of text 2011-03-01 19:39:55 +01:00
356f298e9c update help display using new wrap_string.
re-wrap on resize

add some highlighting
2011-03-01 19:13:17 +01:00
5fb01dacc0 add a {!normal!} color scheme 2011-03-01 19:12:48 +01:00
8d541ad419 use new wrap_string function in MessagePopup 2011-03-01 19:12:05 +01:00
426eea154e add a wrap_string function that works properly 2011-03-01 19:11:53 +01:00
ccc047848a split long lines in torrent info popup 2011-02-28 20:22:49 +01:00
11d8332e43 make sure we're in interactive mode before checking for screen 2011-02-28 14:03:39 +01:00
2193240c66 update help for legacy mode 2011-02-27 17:15:12 +01:00
e43c532e63 remove screen.py
all functionality has been moved elsewhere at this point
2011-02-27 17:14:50 +01:00
930addb389 add 'legacy' mode, which is basically just the old deluge-console, for curmudgeons 2011-02-27 17:12:57 +01:00
fab1e8412d encode string before write to specified encoding 2011-02-24 14:18:49 +01:00
1cce30393b add interactive field to commander so command -h will work 2011-02-24 13:24:45 +01:00
510c81776f add status command 2011-02-24 13:24:35 +01:00
e7096d9509 Merge branch 'master' of deluge-torrent.org:/deluge 2011-02-24 12:13:06 +01:00
5ae242472f don't search for empty string in alltorrents.py 2011-02-24 12:11:14 +01:00
ee75786e40 handle the case where libtorrent doesn't know what files are in a torrent.
this is the case when torrent was added by a magnet link
2011-02-24 12:08:42 +01:00
87473f2cde support magnet uris in add command/dialog 2011-02-24 12:08:22 +01:00
b2f349c05d Remove unnecessary import 2011-02-23 11:22:29 -08:00
9ac0d62149 Remove some imports that are no longer neccessary 2011-02-23 11:21:47 -08:00
db46a97263 Merge branch 'master' of deluge-torrent.org:/deluge 2011-02-23 20:05:48 +01:00
4c2f9a1a0a un-revert main.py as it doesn't actually handle events. 2011-02-23 20:04:15 +01:00
64e38eac20 Revert "Fixed "PluginEnabledEvent" and "PluginDisabledEvent" the argument cannot be called name since that should contain the event name."
This reverts commit 078ed6ba71.
2011-02-23 11:01:59 -08:00
499a58f50d Revert 67ea05921c which changed how event handlers worked.
Unfortunately this will not work with plugins as they do not have the events defined and
the creation of the event object fails.
2011-02-23 10:47:16 -08:00
5f0f7204a8 don't use libtorrent anymore in add 2011-02-23 16:15:34 +01:00
62f6683730 support urls from add dialog 2011-02-23 16:12:49 +01:00
60d96c6f20 add add_spaces to InputPopup 2011-02-23 16:07:47 +01:00
d1efe5f1b4 support adding url arguments in add.py command 2011-02-23 15:53:14 +01:00
62421080ef better unicode handling and trimming 2011-02-22 18:04:16 +01:00
9e4ea0a671 don't trim rows
(basemode seems to get confused on strings with double-wide chars)
2011-02-22 17:18:12 +01:00
b11468c19b handle double-wide unicode characters 2011-02-22 17:17:55 +01:00
40a5722987 support -s STATE in info 2011-02-22 16:57:56 +01:00
956ea10a00 convert torrent_ids back into a list in case we need to remove from it 2011-02-22 16:56:54 +01:00
543fcf722c use os.path.commonprefix to do better completion 2011-02-22 14:58:40 +01:00
7f52472e9e add move command for console ui 2011-02-22 13:56:22 +01:00
5619991f2a add move storage option to torrent actions 2011-02-22 13:39:38 +01:00
2b04955128 don't double add current torrent on action popup 2011-02-22 13:39:20 +01:00
e83d540fe4 update help 2011-02-22 13:38:54 +01:00
4e5d88da82 import deluge.ui.common for TorrentInfo command 2011-02-22 12:34:29 +01:00
10816cb8f4 always have a torrents list, in case get_torrent_name gets called from a mode without get_torrent_name in new ui 2011-02-22 12:32:32 +01:00
5f8eda9204 Merge branch 'newconsole'
Conflicts:
	deluge/ui/console/main.py
2011-02-22 00:26:57 +01:00
b0c561dbbc add add_checked_input 2011-02-22 00:09:27 +01:00
1173f1c714 support globbing for multi-file add and have better fail reports 2011-02-21 17:44:12 +01:00
3da5cd9816 add get_torrent_name 2011-02-21 17:43:35 +01:00
d9d8762c8e add get_torrent_name 2011-02-21 17:41:28 +01:00
e16ee523a5 fix messagepopup height_req 2011-02-21 17:41:10 +01:00
3db7bcbfc7 make message popups a bit more sane 2011-02-21 16:30:49 +01:00
e1a3a431f0 support command line options again 2011-02-17 16:26:58 +01:00
9a3316f950 use '-' instead of '~' in progress bar 2011-02-17 16:04:54 +01:00
1789e8d03c Minor changes for command line usage 2011-02-17 16:03:11 +01:00
837322478b return deferred for proper command line behavior 2011-02-17 15:30:14 +01:00
ce2516ab2c search field is black,white 2011-02-15 20:15:43 +01:00
962bfc3d2c support searching torrent names in alltorrent view 2011-02-15 20:14:14 +01:00
4ff0fb19ee left arrow goes back to overview from torrent details 2011-02-15 19:36:17 +01:00
7a4006439b add preferences help 2011-02-15 19:10:57 +01:00
c015c3a57d update help a bit 2011-02-15 19:10:51 +01:00
8a9e732f95 lots of new preference work 2011-02-15 18:55:27 +01:00
0b3c408e64 make the edit trackers window resizable 2011-02-15 12:54:35 +00:00
d3a61bbda4 fix scrolling on the edit trackers window 2011-02-15 12:49:04 +00:00
c523958bf6 Fixes for gtk-ui translations 2011-02-14 23:50:08 +00:00
06003b3650 Fix translate issue for Trackers tree in sidebar 2011-02-14 23:49:45 +00:00
1e0005f572 Fix: os.join created root path in Remove_Empty_Folder if variable 'folder' had a leading slash 2011-02-14 23:49:04 +00:00
4a071ecba1 add an eventview 2011-02-14 12:38:18 +01:00
77eb1a5f82 prefs actually work. some tweaks to inputs to better support prefs
not all prefs available yet
2011-02-14 12:26:24 +01:00
ac8c928a5b don't always refresh on __init__ 2011-02-14 12:25:43 +01:00
23f64a5440 add back write method and keep track of events for (future) event view 2011-02-14 12:25:04 +01:00
98ca371b15 Sidebar: Enabled strings for translation and added icons to Trackers filter 2011-02-11 22:10:00 +00:00
f8737777b1 Fix #1527 - Converting unicode to unicode error in move_storage 2011-02-11 21:58:40 +00:00
e198ea14e4 Fix Create Torrent Dialog Box - Some buttons raise Type Error if no row selected 2011-02-11 21:58:32 +00:00
553f35eae5 Fix #1510 - Cannot create a torrent with only non-zero tier trackers 2011-02-11 21:58:24 +00:00
376a23e6fd Fix #1513: Unhandled Twisted Error in test_listen_port 2011-02-11 21:58:18 +00:00
077f35ec5c use selection input for cancel/apply/ok 2011-02-10 17:54:59 +01:00
00ab9ff499 support offset text/select inputs and select inputs with no message 2011-02-10 17:47:50 +01:00
20302021c4 initial prefs mode. doesn't do anything yet 2011-02-10 17:39:42 +01:00
9e5455793b remove unused code
this breaks command line right now, will put it back in later
2011-02-10 16:45:10 +01:00
7f6a1db89a start with a connection manager instead of just alltorrents 2011-02-10 01:12:14 +01:00
cdcab320fb add current_selection to SelectablePopup 2011-02-10 01:11:31 +01:00
ea22bb0b10 #1514 - Indicator Applet Patch 2011-02-09 19:15:34 +00:00
554f34a261 Fix #690 - Renaming folders does not remove old empty folders 2011-02-08 19:34:54 +00:00
ad2b13eb2c Fix #1248 - Deluge-console unicode support on redirected stdout 2011-02-08 17:36:09 +00:00
ce636ccd57 Catch a possible DivByZero error when moving folders around in fileview tab 2011-02-08 17:36:09 +00:00
053700342a Fix #1336 - Uneeded Horizontal Scrollbar shows in Files&Peers Tab 2011-02-08 17:35:57 +00:00
cd7805bfda make text input not go over width 2011-02-08 14:43:41 +01:00
79869faa53 #1494 - Add Downloaded and Uploaded columns to torrent view 2011-02-08 06:49:30 +00:00
b77f8929d6 oops, add torrent actions new file 2011-02-07 15:10:41 +01:00
e1d8025309 show torrent actions form details when 'a' pressed 2011-02-07 15:10:18 +01:00
183a97785b split off torrent actions popup 2011-02-07 15:01:07 +01:00
f748660cac show status message 2011-02-07 15:00:51 +01:00
cea6c817df Fix #1506 - max speed not restored on a yellow->green transition 2011-02-05 01:12:52 +00:00
b9ff47e10f Fix #755 - Can't set listen_ports through console UI 2011-02-05 01:12:48 +00:00
14746bf94d Fix #1450 Trailing white space in paths 2011-02-05 01:12:47 +00:00
87f871f40a Fix #1500 - Console crashes on command longer than terminal width. This error is raised if the cursor is off screen and is supressed with try-except 2011-02-05 01:12:45 +00:00
9f3ac37f25 Fix #1282 - Text for AutoManaged changed to 'On/Off' and localized 2011-02-05 01:12:44 +00:00
417a9f6e63 Fix #1373, #1386 - Creating and moving non-ascii folder names in MS Windows 2011-02-05 01:12:43 +00:00
ba6389bcac Updated help text for deluge-console on Windows 2011-02-05 01:12:42 +00:00
9bca1a72b1 Fix for deluge-console adding torrent files in Windows 2011-02-05 01:12:41 +00:00
e688b45448 Fix #1508 - TypeError in cell_data_queue() could not convert argument to correct param type 2011-02-05 01:12:36 +00:00
4c54cfedb9 Fix #1507 - Temporary file race condition in core/core.py:add_torrent_url 2011-02-05 01:12:35 +00:00
88039a0eda fix patch, missing deluge.common when adding the options 2011-02-04 19:57:31 +00:00
9a54beef78 add patch from #1473 2011-02-04 19:43:27 +00:00
b0a0574ae0 Apply patch from #1194 2011-02-04 19:37:42 +00:00
db64745862 fix priority popup title 2011-02-02 20:50:48 +01:00
0353a388b3 add option to action popup for torrent details 2011-02-02 20:49:27 +01:00
b41ebe1b89 don't show action popup if there are no torrents in the view 2011-02-02 20:49:11 +01:00
1952357f35 update help 2011-02-02 20:40:15 +01:00
6c8529b3ba updated file seperator 2011-02-02 20:39:57 +01:00
78ea5c9bd3 don't enter torrentdetails if nothing is selected 2011-02-02 18:32:03 +01:00
b35875e300 attempted fix of color/underline issue.
this is a bit of a hack, and seems to work some places, but not everywhere
2011-02-02 16:21:52 +01:00
ad498c6e42 Revert "remove special case white/black pair. doesn't seem needed and breaks white,black,attrs"
This does actually seem to break some terminals

This reverts commit ba3a093746.
2011-02-02 13:57:31 +01:00
d1b3aa54ad support setting file priorities in torrentdetails 2011-02-02 13:46:05 +01:00
d0346a104f don't need len() 2011-02-02 13:45:17 +01:00
5f888faceb handle resize in torrentdetail 2011-02-02 13:11:15 +01:00
f6f3a8e084 allow marking in file view (no actions just yet) 2011-02-02 13:09:41 +01:00
5dcc935852 fix for only drawing one effected line and only draw effected lines on marking 2011-02-02 12:50:40 +01:00
eba7c2bf17 add index value to directories in file_list 2011-02-02 12:44:07 +01:00
00fa074452 small fix for scrolling 2011-02-01 18:00:25 +01:00
5d46d2aee5 add torrentdetails state, allow state switching, move some formating to format_utils 2011-02-01 17:23:15 +01:00
007dd67ea1 only redraw effected lines on scroll. seems to get rid of the flickering problem :) 2011-01-29 14:04:32 +01:00
ff3c3f7148 add torrent can add paused. remove torrent works 2011-01-29 12:29:18 +01:00
68c04acf50 refactor + support selectinput 2011-01-28 22:42:04 +01:00
44676f282a use some caching to speed up row drawing.
still some flicker unfortunatly.  seems to be related to the length of the row line, not sure if there's much i can do there
2011-01-28 17:54:36 +01:00
182ec0cd97 specify hotkeys for filter/action popups 2011-01-28 17:34:03 +01:00
6f0b1fd7f2 support hotkeys in selectable popup 2011-01-28 17:33:51 +01:00
ba3a093746 remove special case white/black pair. doesn't seem needed and breaks white,black,attrs 2011-01-28 17:04:28 +01:00
b7e7a4bc49 Fix typo 2011-01-27 11:18:59 -08:00
ac18ecd1f0 Fix #1498: Use os.path.normpath on new_folder to remove any double slashes or other problems that could be in the string 2011-01-27 11:12:40 -08:00
2f6283ea39 initial checkin of new console ui
pretty alpha code, but it works and gives an idea of the direction the ui might go
2011-01-26 22:18:18 +01:00
b30499c6ac Fix #1484: trying to access the screen object when not using interactive mode 2011-01-16 15:59:29 -08:00
8c12c47d3e Add "none" as a log level to support quieting the logging messages. Refs #1470. 2011-01-02 16:06:28 +00:00
356808b02c Fix #1470. 2011-01-02 16:03:00 +00:00
1f800bf49a On a 64bit platform with old plugins, the deprecation code was unable to find out which was the caller module. This might also happen on other platforms although I was unable to reproduce it on x86. Anyway, handle it cleanly. 2011-01-01 18:33:41 +00:00
d1b4523733 Let log files be a little bigger, 50Mb is not that much anyway. 2010-12-28 01:58:38 +00:00
c00391a852 Merge branch 'master' into plugins-namespace 2010-12-28 01:45:50 +00:00
5841521133 Added missing import.
Removed log message that caused error. It was never logged anyway, even on the master branch before the improved logging branch was created.
2010-12-28 01:26:25 +00:00
7e2411289d Merge branch 'master' into plugins-namespace
Conflicts:
	ChangeLog
2010-12-13 12:37:37 +00:00
2fa8ca6753 Merge branch 'master' into improved-logging
Conflicts:
	ChangeLog
	deluge/plugins/autoadd/autoadd/gtkui.py
	deluge/ui/client.py
2010-12-13 12:31:20 +00:00
1c15df8e00 Merge branch 'master' of deluge-torrent.org:deluge 2010-12-12 17:50:13 +00:00
f282487806 fix bug #1355 2010-12-12 00:03:04 +00:00
078ed6ba71 Fixed "PluginEnabledEvent" and "PluginDisabledEvent" the argument cannot be called name since that should contain the event name.
Ported plugins on deluge's git to this new event dispatching style.
2010-12-11 05:42:45 +00:00
67ea05921c Implemented passing a copy of an event instead of it's arguments to event handlers. Necessary changes to the event handlers on deluge's code were made, plugins still need to be ported to this new style. 2010-12-11 05:11:18 +00:00
0f36a65aaf Update ChangeLog with the backwards incompatible notice. 2010-12-10 05:49:38 +00:00
90d23ce582 Revert e52018bfcd. Simply fail. It's documented on the ChangeLog. 2010-12-10 05:42:19 +00:00
860457ff48 Update ChangeLog. 2010-12-10 05:01:31 +00:00
e52018bfcd Dont make code that still uses the old "TorrentAddedEvent" fail, instead log a warning and make it work. 2010-12-10 04:59:05 +00:00
9bd11ab204 Update ChangeLog. 2010-12-10 04:35:41 +00:00
c164013725 Ported Feeder(although not working on current deluge), Notifications, Scheduler, Stats, Toggle and WebUi to the deluge.plugins namespace. 2010-12-10 04:31:51 +00:00
b9a8bf2409 Ported the Label plugin to the deluge.plugins namespace. 2010-12-10 04:09:25 +00:00
4c3d068f0c Improve create_plugin.py and the generated create_dev_link.sh. 2010-12-10 04:08:36 +00:00
c9e4d286c3 Ported the FreeSpace plugin to the deluge.plugins namespace. 2010-12-10 03:29:36 +00:00
e43146a4ac Simplify some code on create_plugin.py. 2010-12-10 03:25:39 +00:00
1c2eb0c737 Improve and port the create_plugin.py script to generate the plugins under the "deluge.plugins" namespace.
Any plugin not using the "deluge.plugins" namespace will get a `DeprecationWarning` printed on the console.
2010-12-10 03:15:36 +00:00
b0d77a4f20 Ported the Extractor plugin to the plugins namespace. 2010-12-10 00:35:51 +00:00
20635773b3 Ported "Blocklist", "Example" and "Execute" to the "deluge.plugins" namespace. 2010-12-09 23:11:20 +00:00
f17634ea63 Drop pkutil and simply use pkg_resources. 2010-12-09 22:18:59 +00:00
16f617d240 Initial commit to implement the "deluge.plugins" namespace package support. 2010-12-09 22:05:34 +00:00
1c7676bfe5 Finish last commit, forgot to revert some of the files. 2010-12-09 18:12:25 +00:00
63fa5bf85b Reuse existing "TorrentAddedEvent" instead of creating a new one. 2010-12-09 18:08:34 +00:00
6cefb49f28 Diferentiate adding an already managed torrent from adding a new, unmanaged torrent, to the session. 2010-12-08 19:33:05 +00:00
eeed72a977 Fix tweak_logging_levels(). 2010-12-07 14:21:45 +00:00
49e10ea0cf Fix bug introduced in previous commit. 2010-12-06 12:34:57 +00:00
26e45dcbc8 Make use of logging.handlers.WatchedFileHandler if deluge is running on python 2.6. 2010-12-06 11:59:37 +00:00
b7bc1fdb1d configmanager needs to be imported at a latter stage at least for the gtk frontend. 2010-12-06 11:45:17 +00:00
3b00a7de59 Swhiched the old style logging, ie, a single logger for all logging output to several loggers. This brings the ability to tweak the logging levels for each of the loggers, ie, we can have the "deluge" logger be at the ERROR level while having "deluge.core" at the DEBUG level, meaning we will only see log message for all of the deluge loggers above the ERROR level while still having all messages above the DEBUG level for the "deluge.core" logger and it's children. This kind of tweak can be achieved by adding a file named "logging.conf" to deluge's config dir and this is explained on the deluge.log.tweak_logging_levels function.
Passing `-r` to the cli's while also passing `-l` will make the logfile rotate when reaching 5Mb in size. Three backups will be kept at all times.
All deluge's code is now using this new style logging along with the git hosted plugins. For other plugins not hosted by deluge, which still imports `LOG` as the logger, a deprecation warning will be shown explaining the required changes needed to use the new style logging. New plugins created by the `create_plugin` script will use the new logging facilities.
2010-12-06 11:20:22 +00:00
14ec9464aa fix a bug that can occur when upgrading 1.1 config files 2010-12-01 10:21:26 +00:00
3d64f0d8da Fix #1283 Consistent icons and add localization to file priorities
Signed-off-by: John Garland <johnnybg+deluge@gmail.com>
2010-11-11 14:01:58 +11:00
87e3a5f515 rebuild the compressed javascript 2010-11-01 09:14:23 +00:00
75e9ff57de update the build file to include the spinnerfieldfix file 2010-11-01 09:13:37 +00:00
b180d2a900 remove the convert conf script that won't actually work anymore 2010-10-31 14:35:00 +00:00
1822c2bde9 fix a silly bug 2010-10-31 10:13:33 +00:00
40e6777c48 Merge branch 'master' of deluge-torrent.org:deluge 2010-10-31 09:18:26 +00:00
f88b24d507 apply 41ffee5 to master 2010-10-31 09:18:09 +00:00
593452ed63 update bbfreeze script 2010-10-29 10:11:40 +01:00
4197e129fe change location of httpdownloader as a temporary fix 2010-10-25 00:13:09 +01:00
0360cbe0b8 fix a bug in the MultiOptionsManager that didn't fire the right arguments in the initial event fire 2010-10-24 23:42:29 +01:00
d2f41fe7e5 apply patch from #1377 2010-10-24 13:30:40 +01:00
0a2e9a5324 include a file that fixes the SpinnerField onBlur method (no idea why it is set to emptyFn) 2010-10-23 22:22:00 +01:00
3c302088f6 fix the path to the loading gif (not that its actually used) 2010-10-23 21:24:06 +01:00
3b6bad2f13 fix up the tracker icon tests 2010-10-22 19:47:38 +01:00
6fd4b298f3 fix up the core tests that were erroring 2010-10-22 19:42:07 +01:00
2beec764c9 move tests back inside the deluge package, makes it easier to run trial on them 2010-10-22 16:36:52 +01:00
e5760ee341 Fix uncaught exception when quitting 2010-10-23 01:12:21 +11:00
45940b9064 Fix #1373 use of cyrllic paths 2010-10-16 12:56:00 -07:00
c97f809bdc Fix #1349 force a theme style with expander-size = 15 to show entries in the sidebar properly. 2010-10-15 19:32:13 -07:00
ae6837c88c create the toolbar with the rest of the UI 2010-10-14 13:54:26 +01:00
a827cf6c7a Keep a torrent paused after a forced recheck if it was paused to start. 2010-10-10 12:36:25 -07:00
f52e3c4aa0 add a check to ensure that the events loop doesn't continue indefinitely 2010-10-10 19:52:08 +01:00
8f7e307f33 wrap client.disconnect() call with a check to see if its classic mode 2010-10-07 00:14:21 +01:00
f1f6f137c3 Make sure config value strings are utf8 encoded (fixes #1369) 2010-10-03 18:33:57 +11:00
ff7ff8eac7 Move decode_string/utf8_encoded to common 2010-10-03 18:12:42 +11:00
4cb2bcae25 Fix sidebar not updating (#1365) 2010-10-02 23:55:51 +10:00
df95222849 Use better attribute / method names in blocklist 2010-09-26 11:39:17 +10:00
463fd3ac04 Fix attribute error in blocklist plugin 2010-09-26 11:30:58 +10:00
eb37c91866 Set locale to the user's default settings in the gtkui 2010-09-20 02:43:07 +10:00
7cd210a59b include missing theme images 2010-09-18 00:47:47 +10:00
eee27868a8 include the .order files 2010-09-16 12:16:07 +01:00
e5dec3f020 add all the other scripts to package_data 2010-09-16 08:52:16 +01:00
def1127c78 More clean-up of setup.py 2010-09-14 11:29:47 -07:00
847f2c2ebd Remove the custom 'install' class and include_package_data 2010-09-14 10:56:42 -07:00
fb49aa02a8 Fix preference page index when removing a preference page 2010-09-13 18:21:31 -07:00
f8dc66b773 Fix bugs with unicode torrents in AutoAdd plugin. 2010-09-13 02:23:10 -04:00
c17b466bae Fix bug in AutoAdd plugin where watchdirs would not display in gtkui when first enabled. 2010-09-13 02:23:09 -04:00
d9cdff9525 Increase max piece size to 8 MiB in create torrent dialog (closes #1358) 2010-09-13 08:50:29 +10:00
915db80a55 Fix VersionSplit behavior when comparing to a dev version. 2010-09-11 16:27:29 -04:00
350d4d7260 Add rpc to check if authorized to call a rpc: daemon.authorized_call() 2010-09-04 12:31:27 -07:00
4b92912577 AutoAdd plugin can now recover when one of the watchfolders has an unhandled exception. 2010-09-03 22:34:28 -04:00
a794223d96 Fix "adjustment with non-zero page size" deprication warning in autoadd plugin. 2010-09-03 22:34:27 -04:00
5811d372f9 Fix up some docstrings 2010-09-03 17:21:56 -07:00
0b2f2f2c8a Add TorrentFileCompleted event. 2010-09-03 17:11:37 -07:00
64022d7bc7 Add 'Owner' filter 2010-09-03 15:15:29 -07:00
bf715d90fd Save 'owner' and 'public' to the torrent state 2010-09-03 15:15:02 -07:00
fdbd9e6687 Fix issue when adding torrents without a 'session'. This can happen
when a plugin adds a torrent, like how the AutoAdd plugin works.  The
user that adds this torrent will be an empty string.
2010-09-03 14:28:16 -07:00
0a0383d075 Use a temp filename with add_torrent_url 2010-08-31 00:04:56 +10:00
5b1bed5a48 Update get_free_space test 2010-08-30 23:49:49 +10:00
7ed33192ec Ensure preferencesmanager only changes intended libtorrent session settings. 2010-08-26 01:31:53 -04:00
c82ba44be8 Fix scheduler so that it keeps current state, even after global settings change. 2010-08-26 01:22:14 -04:00
729daf331c Ignore global stop ratio related settings in logic, so per torrent ones are used. 2010-08-24 23:16:33 -04:00
db1835d942 Merge branch 'newscheduler' 2010-08-24 00:57:15 -04:00
7d4a316733 Add max active downloading and seeding options to scheduler. 2010-08-24 00:30:54 -04:00
da8629db97 Implemented search as you type capabilities to the treeview, ie, when the
treeview has focus and user starts typing, select the first matching
torrent name.
2010-08-24 01:38:05 +01:00
df573c66c6 Merge branch 'master' of deluge-torrent.org:deluge 2010-08-23 17:35:42 -07:00
29f61b58fb Fix key error after enabling a plugin that introduces a new status key 2010-08-23 17:34:30 -07:00
15ce2b71f9 Moved xdg import so it is not called on Windows, where it is unused. fixes #1343 2010-08-22 15:39:12 -04:00
116ccc21fd AutoAdd plugin changes
adds queue to top option
adds ability to append extension instead of deleting torrent once added
2010-08-22 00:31:41 -04:00
dee33745c8 Merge branch 'master' into multiuser 2010-08-21 13:00:47 -07:00
8586cda4e0 Fix unhandled exception when adding a torrent to the session 2010-08-21 12:53:44 -07:00
db9b5580d7 Fix issue where the save_timer is cancelled when it's not active 2010-08-21 12:53:21 -07:00
10aebd600a Add 'Owner' and 'Public' fields to the details tab 2010-08-21 12:42:01 -07:00
f0fe3c7879 Add 'Owner' and 'Public' columns to the TorrentView 2010-08-21 12:28:26 -07:00
33fd852bda Add 'public' torrent option to allow making a torrent publically viewable by other users 2010-08-21 12:25:05 -07:00
65c9dc5fa8 Add new torrent status key 'owner' for keeping track of who added the torrent to the session 2010-08-21 12:15:41 -07:00
7e2eea46d3 Fix man deluged not showing '-u' on its own line 2010-08-20 01:15:27 +10:00
01773e433f Fix #1341 issue where Config would try to cancel the save_timer when it is None. 2010-08-18 12:33:09 -07:00
ca5eaf4270 Add cache expiry check by key update times to fix issue where some status updates would not return
correctly if they were done < cache_time from the previous status request
2010-08-18 12:15:53 -07:00
7d64f057c7 Add additional test for get_torrents_status and fix the other one to properly invalidate the cache
time from startup before proceeding
2010-08-18 12:15:16 -07:00
48d016e97d Add test to demonstrate flaw in SessionProxy design. Need to keep track of update times for each
status key individually to fix this.
2010-08-18 11:06:10 -07:00
e9ce506d1c fix the script resource on windows 2010-08-14 17:38:30 +01:00
e0eb0bd06a add the apple iOS bookmark icons from #1339 2010-08-14 16:16:10 +01:00
9f992ec40d fix the system.listMethods json call when running in classic mode 2010-08-14 16:05:40 +01:00
ce8ef4f95b Add test suite for SessionProxy 2010-08-10 09:57:00 -07:00
4d0560eff2 Fix getting a torrent's status with an empty key list to return all the
torrent's status keys instead of an empty dict
2010-08-06 17:28:16 -07:00
d49cde1994 use the get_libtorrent.sh script to get libtorrent if it is missing 2010-07-22 21:13:26 +01:00
16a1173f1d change default version to 0.15 2010-07-22 18:18:15 +01:00
333d2f5562 add libtorrent fetch script 2010-07-22 18:17:51 +01:00
c7fe1bdef5 remove the libtorrent submodule 2010-07-22 18:05:46 +01:00
46a967fb8c a couple of fixes to stop the webui crashing when running within the gtkui 2010-07-18 23:11:02 +01:00
ca22e84858 Alternate tooltip when toggling session 2010-07-18 01:17:33 +10:00
20bd962e6a Add Toggle plugin 2010-07-18 00:56:56 +10:00
22a1448372 Only use an icon if it passes some sanity checks 2010-07-17 17:11:19 +10:00
722a5cd9e1 Use a blank icon when the tracker icon downloaded isn't a proper image 2010-07-15 19:17:17 -07:00
efecf38bcd Attempt to create a move_storage destination path if it doesn't exist 2010-07-15 10:51:06 -07:00
dfb75d67b9 Do not attempt to move a torrents storage if the destination path does
not exist
2010-07-12 14:45:13 -07:00
961d405921 Try to import system rencode before deluge.rencode to allow the use of the new rencode library at: http://code.google.com/p/rencode/ 2010-07-08 16:39:02 -07:00
e025b6b9db Fix hang when quitting in classic mode 2010-07-08 16:23:12 -07:00
bc5aa1bf71 Add logging the user when a torrent is added or removed 2010-07-05 21:08:15 -07:00
3cd30ea96a Use torrent state name instead of number if available 2010-07-02 18:09:21 -07:00
504751424f Use basestring instead of str and unicode 2010-07-02 15:19:42 +10:00
37a00a48a7 Fix uncaught exception when closing deluge in classic mode 2010-07-02 02:45:47 +10:00
2a2f5d90ae Fix typo 2010-07-02 02:43:32 +10:00
f0920f5638 more improvements to the shift select 2010-07-01 14:21:37 +01:00
43fb998651 fix select 'upwards' 2010-07-01 14:08:21 +01:00
148fcdbe37 allow for shift selecting in tree grids 2010-07-01 13:45:23 +01:00
de79bba540 Fix #1302 an uncaught exception in an state_changed event handler in SessionProxy was preventing the
TorrentManager's stop method from properly saving all the resume data.
2010-06-22 18:24:27 -07:00
d5881142aa Always look for -mt boost libraries first 2010-06-18 09:50:58 -07:00
494c468da8 fix typo 2010-06-12 22:47:59 +01:00
672668ccdb change bits to bytes, thanks to charles 2010-06-11 15:59:33 +01:00
538aed9147 Fix typo in label plugin - thanks konti 2010-06-11 00:49:42 +10:00
d800273891 Handle os.remove failing on windows 2010-06-08 03:19:30 +10:00
94f96c5165 Python independent version of previous commit 2010-06-08 01:55:48 +10:00
4b1d60c727 Fix console ui not liking paths with backslashes on windows (#1293) 2010-06-08 01:25:21 +10:00
cfe547b31a Print a more informative error message if the torrent file doesn't exist 2010-06-08 01:22:19 +10:00
f6195f775f Fix execute plugin only executing last event (#1306) 2010-06-08 00:17:22 +10:00
87879ab3b8 Only encode if necessary 2010-06-07 20:12:31 +10:00
81a837faed Fix unicode support in console ui (#1307) 2010-06-07 20:11:11 +10:00
c06f905702 Add some debug logging statements 2010-06-04 18:05:21 +01:00
f6f9e0234a Fix an error in the key 2010-06-04 17:37:53 +01:00
e1e1472a8f Fix saving the correct event name 2010-06-04 16:37:37 +01:00
b7e1fe1696 Save the execute config after adding/removing/saving commands 2010-06-04 16:31:51 +01:00
0314d0440f Fix typo in execute plugin 2010-05-20 00:04:43 +10:00
3226b1819d Fix man deluged not showing '-d' on its own line 2010-05-16 22:32:12 +10:00
4b8a85763c Fix remote save path dialog not disappearing after creating a torrent 2010-05-16 18:10:13 +10:00
ae4f2c3bb0 Fix only being able to click "remote path" once when creating a torrent 2010-05-16 18:08:33 +10:00
bc28b83062 Fix deluged crashing on windows when logfile's directory doesn't exist 2010-05-16 13:11:18 +10:00
2603c36e7d Revert "Fix trac wiki turning CamelCase words into broken links"
This reverts commit 81b56cce62.
2010-05-11 23:47:06 +10:00
81b56cce62 Fix trac wiki turning CamelCase words into broken links 2010-05-11 23:23:39 +10:00
649a2b6f8e Update email address and copyright 2010-05-11 03:51:45 +10:00
4caf81ef89 Fix new release check pref 2010-05-09 22:45:28 -07:00
65c33a37a1 Fix the naming of the some of the config set methods 2010-05-09 22:36:31 -07:00
eff17931eb Fix preferences manager not setting initial settings on start-up 2010-05-09 22:32:14 -07:00
b33c2abf82 Fix label plugin not remembering newly created labels 2010-05-09 17:50:39 +10:00
ba514f0b0e Remove unused code from label plugin 2010-05-09 17:39:45 +10:00
7f60867ae9 Update docstrings to use names from previous commit 2010-05-09 17:05:22 +10:00
71d8836118 Use better names for TrackerIcons' args 2010-05-09 17:01:15 +10:00
97d6f8ce80 Return the noIcon for empty strings as well 2010-05-09 16:43:22 +10:00
ca7f009e74 Raise IconsError instead of IndexError (fixes infinite looping) 2010-05-09 16:31:32 +10:00
f08e5176c3 Do not request a tracker icon if the host is "" 2010-05-08 20:06:15 -07:00
70161a54fa Simplify PreferencesManager by simply looking for the _on_get_<config key> method instead of registering a set function for each 2010-05-08 20:04:55 -07:00
a945d0a78d Use previously defined host variable instead of getting the tracker host from the TreeModel 2010-05-08 20:02:58 -07:00
245b799ccf Add test for tracker_icons for when requesting an icon for host that is "". This test results in an infinite loop. 2010-05-08 20:01:46 -07:00
0dc6c3ecfd Return 0 in get_free_space if the download_location is invalid 2010-05-08 20:00:41 -07:00
98f000cc70 rebuild deluge-all and ext-extensions 2010-05-08 16:18:48 +01:00
8d4daff068 update the build files for deluge-all and ext-extensions 2010-05-08 16:18:48 +01:00
79d68a5b9b fix the null comparison 2010-05-08 16:18:48 +01:00
412d0ee4f9 set the baseCls for the add label form panel to x-plain 2010-05-08 16:18:47 +01:00
e8788bde08 Make host_to_url support redirection and add another test 2010-05-08 16:25:16 +10:00
815a71fe8b Try favicon.ico if there's a HTMLParseError 2010-05-08 15:50:04 +10:00
fce16ba51f Fix relative redirecting in blocklist plugin 2010-05-06 23:27:04 +10:00
50cfd9c9b1 Update tests 2010-05-06 23:06:53 +10:00
369b03bffb Update version 2010-05-05 14:46:27 -07:00
971 changed files with 293320 additions and 191881 deletions

27
.gitattributes vendored
View File

@ -1,9 +1,24 @@
/libtorrent export-ignore
/win32 export-ignore
docs/build export-ignore
docs/source export-ignore
/tests export-ignore
deluge/scripts export-ignore
/libtorrent/ export-ignore
/win32/ export-ignore
/osx/ export-ignore
docs/build/ export-ignore
docs/source/ export-ignore
/tests/ export-ignore
deluge/scripts/ export-ignore
setup.cfg export-ignore
check_glade.sh export-ignore
createicons.sh export-ignore
create_potfiles_in.py export-ignore
gettextize.sh export-ignore
deluge/i18n/deluge.pot export-ignore
deluge/ui/web/css/*-debug.css export-ignore
deluge/ui/web/js/*-debug.js export-ignore
deluge/ui/web/js/deluge-all/ export-ignore
deluge/ui/web/js/ext-extensions/ export-ignore
deluge/ui/web/gen_gettext.py export-ignore
deluge/ui/web/build export-ignore
deluge/ui/web/docs/ export-ignore
.gitattributes export-ignore
.gitmodules export-ignore
.gitignore export-ignore

5
.gitignore vendored
View File

@ -7,3 +7,8 @@ dist
*.pyc
*.tar.*
_trial_temp
deluge/i18n/*/
*.desktop
.build_data*
osx/app
RELEASE-VERSION

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "libtorrent"]
path = libtorrent
url = git://deluge-torrent.org/libtorrent

797
AUTHORS Normal file
View File

@ -0,0 +1,797 @@
Authors:
* Andrew Resch ('andar') <andrewresch@gmail.com>
* Damien Churchill ('damoxc') <damoxc@gmail.com>
Main Developers:
* Andrew Resch
* Damien Churchill
* John Garland ('johnnyg') <johnnybg+deluge@gmail.com>
* Calum Lind ('cas') <calumlind+deluge@gmail.com>
libtorrent (http://www.libtorrent.org):
* Arvid Norberg
Contributors (and Past Developers):
* Zach Tibbitts <zach@collegegeek.org>
* Alon Zakai ('Kripken') <kripkensteiner@gmail.com>
* Marcos Pinto ('markybob') <markybob@gmail.com>
* Alex Dedul
* Sadrul Habib Chowdhury
* Ido Abramovich <ido.deluge@gmail.com>
* Martijn Voncken <mvoncken@gmail.com>
* Mark Stahler ('kramed') <markstahler@gmail.com>
* Pedro Algarvio ('s0undt3ch') <ufs@ufsoft.org>
* Cristian Greco ('cgreco') <cristian@regolo.cc>
* Chase Sterling ('gazpachoKing') <chase.sterling@gmail.com>
Plugin Developers:
* Autoadd : Chase Sterling
* Blocklist : John Garland
* Execute : Damien Churchill
* Extractor : Andrew Resch
* Label : Martijn Voncken
* Notifications : Pedro Algarvio
* Scheduler : Andrew Resch
* Webui : Damien Churchill
Images Authors:
* files: deluge/ui/data/pixmaps/*.svg, *.png
deluge/ui/web/icons/active.png, alert.png, all.png, checking.png, dht.png,
downloading.png, inactive.png, queued.png, seeding.png, traffic.png
exceptions: deluge/ui/data/pixmaps/deluge.svg and derivatives
copyright: Andrew Resch
license: GPLv3
* files: deluge/ui/data/pixmaps/deluge.svg and derivatives
deluge/ui/web/icons/apple-pre-*.png, deluge*.png
deluge/ui/web/images/deluge*.png
copyright: Andrew Wedderburn
license: GPLv3
* files: deluge/plugins/blocklist/blocklist/data/*.png
deluge/ui/data/pixmaps/tracker_warning16.png, tracker_all16.png, lock48.png
copyright: Gnome Icon Theme
license: GPLv2
url: http://ftp.acc.umu.se/pub/GNOME/sources/gnome-icon-theme
* files: deluge/ui/data/pixmaps/magnet.png
copyright: Woothemes
license: Freeware
icon pack: WP Woothemes Ultimate
url: http://www.woothemes.com/
* files: deluge/ui/data/pixmaps/flags/*.png
copyright: Mark James <mjames@gmail.com>
license: Public Domain
url: http://famfamfam.com/lab/icons/flags/
* files: deluge/ui/web/icons/*.png
exceptions: apple-pre-*.png, active.png, alert.png, all.png, deluge.png, dht.png,
downloading.png, inactive.png, queued.png, seeding.png, traffic.png
copyright: Yusuke Kamiyamane <p@yusukekamiyamane.com>
license: Creative Commons Attribution 3.0 License
url: http://p.yusukekamiyamane.com/
* files: deluge/ui/web/images/spinner.gif, spinner-split.gif
copyright: Steven Chim
license: BSD license
url: http://members.upc.nl/j.chim/ext/spinner2/ext-spinner.html
Translation Contributors:
* files: deluge/i18n/*.po
Aaron Wang Shi
abbigss
ABCdatos
Abcx
Actam
Adam
adaminikisi
adi_oporanu
Adrian Goll
afby
Ahmades
Ahmad Farghal
Ahmad Gharbeia أحمد غربية
akira
Aki Sivula
Alan Pepelko
Alberto
Alberto Ferrer
alcatr4z
AlckO
Aleksej Korgenkov
Alessio Treglia
Alexander Ilyashov
Alexander Matveev
Alexander Saltykov
Alexander Taubenkorb
Alexander Telenga
Alexander Yurtsev
Alexandre Martani
Alexandre Rosenfeld
Alexandre Sapata Carbonell
Alexey Osipov
Alin Claudiu Radut
allah
AlSim
Alvaro Carrillanca P.
A.Matveev
Andras Hipsag
András Kárász
Andrea Ratto
Andreas Johansson
Andreas Str
André F. Oliveira
AndreiF
andrewh
Angel Guzman Maeso
Aníbal Deboni Neto
animarval
Antonio Cono
antoniojreyes
Anton Shestakov
Anton Yakutovich
antou
Arkadiusz Kalinowski
Artin
artir
Astur
Athanasios Lefteris
Athmane MOKRAOUI (ButterflyOfFire)
Augusta Carla Klug
Avoledo Marco
axaard
AxelRafn
Axezium
Ayont
b3rx
Bae Taegil
Bajusz Tamás
Balaam's Miracle
Ballestein
Bent Ole Fosse
berto89
bigx
Bjorn Inge Berg
blackbird
Blackeyed
blackmx
BlueSky
Blutheo
bmhm
bob00work
boenki
Bogdan Bădic-Spătariu
bonpu
Boone
boss01
Branislav Jovanović
bronze
brownie
Brus46
bumper
butely
BXCracer
c0nfidencal
Can Kaya
Carlos Alexandro Becker
cassianoleal
Cédric.h
César Rubén
chaoswizard
Chen Tao
chicha
Chien Cheng Wei
Christian Kopac
Christian Widell
Christoffer Brodd-Reijer
christooss
CityAceE
Clopy
Clusty
cnu
Commandant
Constantinos Koniaris
Coolmax
cosmix
Costin Chirvasuta
CoVaLiDiTy
cow_2001
Crispin Kirchner
crom
Cruster
Cybolic
Dan Bishop
Danek
Dani
Daniel Demarco
Daniel Ferreira
Daniel Frank
Daniel Holm
Daniel Høyer Iversen
Daniel Marynicz
Daniel Nylander
Daniel Patriche
Daniel Schildt
Daniil Sorokin
Dante Díaz
Daria Michalska
DarkenCZ
Darren
Daspah
David Eurenius
davidhjelm
David Machakhelidze
Dawid Dziurdzia
Daya Adianto
dcruz
Deady
Dereck Wonnacott
Devgru
Devid Antonio FiloniDevilDogTG
di0rz`
Dialecti Valsamou
Diego Medeiros
Dkzoffy
Dmitrij D. Czarkoff
Dmitriy Geels
Dmitry Olyenyov
Dominik Kozaczko
Dominik Lübben
doomster
Dorota Król
Doyen Philippe
Dread Knight
DreamSonic
duan
Duong Thanh An
DvoglavaZver
dwori
dylansmrjones
Ebuntor
Edgar Alejandro Jarquin Flores
Eetu
ekerazha
Elias Julkunen
elparia
Emberke
Emiliano Goday Caneda
EndelWar
eng.essam
enubuntu
ercangun
Erdal Ronahi
ergin üresin
Eric
Éric Lassauge
Erlend Finvåg
Errdil
ethan shalev
Evgeni Spasov
ezekielnin
Fabian Ordelmans
Fabio Mazanatti
Fábio Nogueira
FaCuZ
Felipe Lerena
Fernando Pereira
fjetland
Florian Schäfer
FoBoS
Folke
Force
fosk
fragarray
freddeg
Frédéric Perrin
Fredrik Kilegran
FreeAtMind
Fulvio Ciucci
Gabor Kelemen
Galatsanos Panagiotis
Gaussian
gdevitis
Georg Brzyk
George Dumitrescu
Georgi Arabadjiev
Georg Sieber
Gerd Radecke
Germán Heusdens
Gianni Vialetto
Gigih Aji Ibrahim
Giorgio Wicklein
Giovanni Rapagnani
Giuseppe
gl
glen
granjerox
Green Fish
greentea
Greyhound
G. U.
Guillaume BENOIT
Guillaume Pelletier
Gustavo Henrique Klug
gutocarvalho
Guybrush88
Hans Rødtang
HardDisk
Hargas Gábor
Heitor Thury Barreiros Barbosa
helios91940
helix84
Helton Rodrigues
Hendrik Luup
Henrique Ferreiro
Henry Goury-Laffont
Hezy Amiel
hidro
hoball
hokten
Holmsss
hristo.num
Hubert Życiński
Hyo
Iarwain
ibe
ibear
Id2ndR
Igor Zubarev
IKON (Ion)
imen
Ionuț Jula
Isabelle STEVANT
István Nyitrai
Ivan Petrovic
Ivan Prignano
IvaSerge
jackmc
Jacks0nxD
Jack Shen
Jacky Yeung
Jacques Stadler
Janek Thomaschewski
Jan Kaláb
Jan Niklas Hasse
Jasper Groenewegen
Javi Rodríguez
Jayasimha (ಜಯಸಿಂಹ)
jeannich
Jeff Bailes
Jesse Zilstorff
Joan Duran
João Santos
Joar Bagge
Joe Anderson
Joel Calado
Johan Linde
John Garland
Jojan
jollyr0ger
Jonas Bo Grimsgaard
Jonas Granqvist
Jonas Slivka
Jonathan Zeppettini
Jørgen
Jørgen Tellnes
josé
José Geraldo Gouvêa
José Iván León Islas
José Lou C.
Jose Sun
Jr.
Jukka Kauppinen
Julián Alarcón
julietgolf
Jusic
Justzupi
Kaarel
Kai Thomsen
Kalman Tarnay
Kamil Páral
Kane_F
kaotiks@gmail.com
Kateikyoushii
kaxhinaz
Kazuhiro NISHIYAMA
Kerberos
Keresztes Ákos
kevintyk
kiersie
Kimbo^
Kim Lübbe
kitzOgen
Kjetil Rydland
kluon
kmikz
Knedlyk
koleoptero
Kőrösi Krisztián
Kouta
Krakatos
Krešo Kunjas
kripken
Kristaps
Kristian Øllegaard
Kristoffer Egil Bonarjee
Krzysztof Janowski
Krzysztof Zawada
Larry Wei Liu
laughterwym
Laur Mõtus
lazka
leandrud
lê bình
Le Coz Florent
Leo
liorda
LKRaider
LoLo_SaG
Long Tran
Lorenz
Low Kian Seong
Luca Andrea Rossi
Luca Ferretti
Lucky LIX
Luis Gomes
Luis Reis
Łukasz Wyszyński
luojie-dune
maaark
Maciej Chojnacki
Maciej Meller
Mads Peter Rommedahl
Major Kong
Malaki
malde
Malte Lenz
Mantas Kriaučiūnas
Mara Sorella
Marcin
Marcin Falkiewicz
marcobra
Marco da Silva
Marco de Moulin
Marco Rodrigues
Marcos
Marcos Escalier
Marcos Pinto
Marcus Ekstrom
Marek Dębowski
Mário Buči
Mario Munda
Marius Andersen
Marius Hudea
Marius Mihai
Mariusz Cielecki
Mark Krapivner
marko-markovic
Markus Brummer
Markus Sutter
Martin
Martin Dybdal
Martin Iglesias
Martin Lettner
Martin Pihl
Masoud Kalali
mat02
Matej Urbančič
Mathias-K
Mathieu Arès
Mathieu D. (MatToufoutu)
Mathijs
Matrik
Matteo Renzulli
Matteo Settenvini
Matthew Gadd
Matthias Benkard
Matthias Mailänder
Mattias Ohlsson
Mauro de Carvalho
Max Molchanov
Me
MercuryCC
Mert Bozkurt
Mert Dirik
MFX
mhietar
mibtha
Michael Budde
Michael Kaliszka
Michalis Makaronides
Michał Tokarczyk
Miguel Pires da Rosa
Mihai Capotă
Miika Metsälä
Mikael Fernblad
Mike Sierra
mikhalek
Milan Prvulović
Milo Casagrande
Mindaugas
Miroslav Matejaš
misel
mithras
Mitja Pagon
M.Kitchen
Mohamed Magdy
moonkey
MrBlonde
muczy
Münir Ekinci
Mustafa Temizel
mvoncken
Mytonn
NagyMarton
neaion
Neil Lin
Nemo
Nerijus Arlauskas
Nicklas Larsson
Nicolaj Wyke
Nicola Piovesan
Nicolas Sabatier
Nicolas Velin
Nightfall
NiKoB
Nikolai M. Riabov
Niko_Thien
niska
Nithir
noisemonkey
nomemohes
nosense
null
Nuno Estêvão
Nuno Santos
nxxs
nyo
obo
Ojan
Olav Andreas Lindekleiv
oldbeggar
Olivier FAURAX
orphe
osantana
Osman Tosun
OssiR
otypoks
ounn
Oz123
Özgür BASKIN
Pablo Carmona A.
Pablo Ledesma
Pablo Navarro Castillo
Paco Molinero
Pål-Eivind Johnsen
pano
Paolo Naldini
Paracelsus
Patryk13_03
Patryk Skorupa
PattogoTehen
Paul Lange
Pavcio
Paweł Wysocki
Pedro Brites Moita
Pedro Clemente Pereira Neto
Pekka "PEXI" Niemistö
Penegal
Penzo
perdido
Peter Kotrcka
Peter Skov
Peter Van den Bosch
Petter Eklund
Petter Viklund
phatsphere
Phenomen
Philipi
Philippides Homer
phoenix
pidi
Pierre Quillery
Pierre Rudloff
Pierre Slamich
Pietrao
Piotr Strębski
Piotr Wicijowski
Pittmann Tamás
Playmolas
Prescott
Prescott_SK
pronull
Przemysław Kulczycki
Pumy
pushpika
PY
qubicllj
r21vo
Rafał Barański
rainofchaos
Rajbir
ras0ir
Rat
rd1381
Renato
Rene Hennig
Rene Pärts
Ricardo Duarte
Richard
Robert Hrovat
Roberth Sjonøy
Robert Lundmark
Robin Jakobsson
Robin Kåveland
Rodrigo Donado
Roel Groeneveld
rohmaru
Rolf Christensen
Rolf Leggewie
Roni Kantis
Ronmi
Rostislav Raykov
royto
RuiAmaro
Rui Araújo
Rui Moura
Rune Svendsen
Rusna
Rytis
Sabirov Mikhail
salseeg
Sami Koskinen
Samir van de Sand
Samuel Arroyo Acuña
Samuel R. C. Vale
Sanel
Santi
Santi Martínez Cantelli
Sardan
Sargate Kanogan
Sarmad Jari
Saša Bodiroža
sat0shi
Saulius Pranckevičius
Savvas Radevic
Sebastian Krauß
Sebastián Porta
Sedir
Sefa Denizoğlu
sekolands
Selim Suerkan
semsomi
Sergii Golovatiuk
setarcos
Sheki
Shironeko
Shlomil
silfiriel
Simone Tolotti
Simone Vendemia
sirkubador
Sławomir Więch
slip
slyon
smoke
Sonja
spectral
spin_555
spitf1r3
Spiziuz
Spyros Theodoritsis
SqUe
Squigly
srtck
Stefan Horning
Stefano Maggiolo
Stefano Roberto Soleti
steinberger
Stéphane Travostino
Stephan Klein
Steven De Winter
Stevie
Stian24
stylius
Sukarn Maini
Sunjae Park
Susana Pereira
szymon siglowy
takercena
TAS
Taygeto
temy4
texxxxxx
thamood
Thanos Chatziathanassiou
Tharawut Paripaiboon
Theodoor
Théophane Anestis
Thor Marius K. Høgås
Tiago Silva
Tiago Sousa
Tikkel
tim__b
Tim Bordemann
Tim Fuchs
Tim Kornhammar
Timo
Timo Jyrinki
Timothy Babych
TitkosRejtozo
Tom
Tomas Gustavsson
Tomas Valentukevičius
Tomasz Dominikowski
Tomislav Plavčić
Tom Mannerhagen
Tommy Mikkelsen
Tom Verdaat
Tony Manco
Tor Erling H. Opsahl
Toudi
tqm_z
Trapanator
Tribaal
Triton
TuniX12
Tuomo Sipola
turbojugend_gr
Turtle.net
twilight
tymmej
Ulrik
Umarzuki Mochlis
unikob
Vadim Gusev
Vagi
Valentin Bora
Valmantas Palikša
VASKITTU
Vassilis Skoullis
vetal17
vicedo
viki
villads hamann
Vincent Garibal
Vincent Ortalda
vinchi007
Vinícius de Figueiredo Silva
Vinzenz Vietzke
virtoo
virtual_spirit
Vitor Caike
Vitor Lamas Gatti
Vladimir Lazic
Vladimir Sharshov
Wanderlust
Wander Nauta
Ward De Ridder
WebCrusader
webdr
Wentao Tang
wilana
Wilfredo Ernesto Guerrero Campos
Wim Champagne
World Sucks
Xabi Ezpeleta
Xavi de Moner
XavierToo
XChesser
Xiaodong Xu
xyb
Yaron
Yasen Pramatarov
YesPoX
Yuren Ju
Yves MATHIEU
zekopeko
zhuqin
Zissan
Γιάννης Κατσαμπίρης
Артём Попов
Миша
Шаймарданов Максим
蔡查理

408
ChangeLog
View File

@ -1,4 +1,390 @@
=== Deluge 1.3.0 (In Development) ===
=== Deluge 1.4.0 (In Development) ===
* Improved Logging
* Removed the AutoAdd feature on the core. It's now handled with the AutoAdd
plugin, which is also shipped with Deluge, and it does a better job and
now, it even supports multiple users perfectly.
* Authentication/Permission exceptions are now sent to clients and recreated
there to allow acting upon them.
* Enforced the use of the "deluge.plugins" namespace to reduce package
names clashing beetween regular packages and deluge plugins.
==== Core ====
* Make the distinction between adding to the session new unmanaged torrents
and torrents loaded from state. This will break backwards compatability.
* Pass a copy of an event instead of passing the event arguments to the
event handlers. This will break backwards compatability.
* Allow changing ownership of torrents.
* File modifications on the auth file are now detected and when they happen,
the file is reloaded. Upon finding an old auth file with an old format, an
upgrade to the new format is made, file saved, and reloaded.
* Authentication no longer requires a username/password. If one or both of
these is missing, an authentication error will be sent to the client
which sould then ask the username/password to the user.
* Implemented sequential downloads.
* #378: Provide information about a torrent's pieces states
==== GtkUI ====
* Fix uncaught exception when closing deluge in classic mode
* Allow changing ownership of torrents
* Host entries in the Connection Manager UI are now editable. They're
now also migrated from the old format were automatic localhost logins were
possible, which no longer is, this fixes #1814.
* Implemented sequential downloads UI handling.
* #378: Allow showing a pieces bar instead of a regular progress bar in a
torrent's status tab.
* #2093: Make torrent opening compatible with all unicode paths.
==== Blocklist Plugin ====
* #1382: Implemented whitelist support to both core and GTK UI.
* Implemented ip filter cleaning before each update. Restarting the deluge
daemon is no longer needed.
* If "check_after_days" is 0(zero), the timer is not started anymore. It
would keep updating one call after the other. If the value changed, the
timer is now stopped and restarted using the new value.
=== Deluge 1.3.7 (In Development) ===
==== GtkUI ====
* Fix issue with Plugins that add Tab to torrentdetails
* Fix the scalable icon install directory
==== Extractor ====
* #2290: Fix dotted filenames being rejected
=== Deluge 1.3.6 (25 Feburary 2013) ===
==== Core ====
* Catch & log KeyError when removing a torrent from the queued torrents set
* Fix moving/renaming torrents issues when using libtorrent 0.16
* Make sure queue order is preserved when restarting
* #2160: Disable use of python bindings for libtorrent extensions and replace with session flag
* #2163: Fix unable add torrent file with empty (0:) encoding tag
* #2201: Fix error in authmanager if auth file has extra newlines
* #2109: Fix the Proxy settings not being cleared by setting None
* #2110: Fix accepting magnet uris with xt param anywhere within them
* #2204: Fix daemon shutdown hang with large numbers of torrents
==== Client ====
* Fix keyerrors after removing torrents from UIs
==== GtkUI ====
* Add move completed option to add torrent dialog
* Prevent jitter in torrent view
* Fix torrent creation with non-ascii characters
* Fix #2100 : Add option not to bring main window to front when adding torrents through ipcinterface
* Add Quit Dialog when toggling classic mode in preferences and only show connection manager when not in classic mode.
* #2169: Fix 'Download Location' in the Add Torrent Dialog not set correctly when folder typed into Other->Location field
* #2171: Fix the Add Peer dialog not responding if empty or invalid values entered
* #2104: Fix no title set for the appindicator
* #2086: Fix submenus and icons for appindicator
* #2146: Fix missing translations in View|Tabs submenu
* Fix torrent names on libtorrent 0.16 on windows
* #2147: Fix missing translations for plugin preferences page
* #1474: Fix the on_show_prefs hook not being executed immediatly after enabling a plugin
* #1946: Fix ReactorNotRestartable error when set as startup application
* #2130: Fix same name can be given to different files in Add Torrent dialog
* #2129: Fix empty filename able to be set in AddTorrent dialog
* #2228: Fix Apply-To-All in AddTorrent Dialog copying file renames to other torrents
* #2260: Fix the Add Torrent dialog also bringing the main window to active workspace
* Fix showing exception error to user in Classic Mode with no libtorrent installed
==== Console ====
* LP#1004793: Enable use of connect command in non-interactive mode
* Ensure console commands are executed in order
* #2065: Fix crash with missing closing quote
* #1397: Add support for -s STATE in info command
==== WebUI ====
* Add move completed option to add torrent dialog
* #2112: Fix world readable tmp directory in json_api
* #2069: Fix login window layout problem when using larger than default font size
* #1890: Fix columns in files and peers view could use some spacing
* #2103: Fix sorting by name is case-sensitive [sedulous]
* #2120: Fix manually entered values not being saved in spinners
* #2212: Fix unable to scroll in proxy preferences page
* Fix autoconnecting to the default host
* #2046: Fix plugins not enabling properly until after refreshing page
* #2125: Fix plugin methods not being available when enabled until restart
* #2085: Fix not showing torrents in sidebar for categories other than 'All' in classic mode
* #2232: Fix flag icon path in Peers Tab missing deluge.config.base
* Fix submenus closing upon mouse click
* Add failed login log message, including IP address, to enable use with fail2ban
* #2261: Fix Proxy settings not being saved in preferences
==== Windows OS ====
* Hide the cmd windows when running deluged.exe or deluge-web.exe
* Add deluged-debug.exe and deluge-web-debug.exe that still show the cmd window
* Add gtk locale files to fix untranslated text
* Fix the Open Folder option not working with non-ascii paths
* Fix the daemon starting with config dir containing spaces
* Fix Windows tray submenu items requiring right-click instead of left-click
* Fix issue with adding some torrents with illegal characters via url in gtk client
* #2240: Fix freespace issue with large capacity drives
==== OS X ====
* Fix Open File/Folder option
* Add OS X Menu for GTK Quartz
==== Execute ====
* Fix execute plugin not working with unicode torrent names
==== Extractor ====
* Add Windows support, using 7-zip
* Added support for more extensions
* Disabled extracting 'Move Completed' torrents due to race condition
=== Deluge 1.3.5 (09 April 2012) ===
==== GtkUI ====
* Modified fix for #1957, keyerror with non-acsii columns
* Fix translation of items in Sidebar and Torrent Menu
* #2052: Fix translation of Progress bar text
* #2071: Fix KeyError in gtkui when file priority set to value '3'
* #2064: Fix files treeview height in Create Dialog
* Fix missing semi-colon in deluge.desktop
* Disable setting file priorities for seeding torrents
* Bring MainWindow to front when opening another instance
==== WebUI ====
* #2050: Fix 'Up Speed' column not sorting
* Hide unused Infohash button in WebUI
==== Label ====
* Disable unusable items for 'All' in sidebar menu
* Fix items for translation
==== Console ====
* Fix prefixed space for tab completing commands
* Fix missing trailing space for command options with tab complete
==== Blocklist ====
* Use (documented) formatdate over format_date_time
=== Deluge 1.3.4 (03 March 2012) ===
==== Core ====
* #1921: Free disk space reporting incorrectly in FreeBSD
* #1964: Fix unhandled UnpicklingErrors
* #1967: Fix unhandled IndexError when trying to open a non-json conf file
* Fix setting daemon listen interface from command line
* #2021: Fix share ratio limit not obeyed for seeded torrents added to session
* Add optparse custom version to prevent unnecessary loading of libtorrent
* #1554: Fix seeding on share ratio failing for partially selected torrents
* Add proper process title naming in ps, top etc. (Depends: setproctitle)
==== GtkUI ====
* #1918: Fix Drag'n'Drop not working in Windows
* #1941: Increase maximum Cache Size to 999999 (15GiB)
* #1940: File & folder renaming issue when using Add Torrent dialog in Windows
* LP#821577: Fix UnpicklingError when external selection dragged onto Files Tab
* #1934: Fix Unicode error in AddTorrent Dialog
* #1957: Fix keyerror when adding columns for non-latin languages
* #1969: Fix menu item 'Quit & Shutdown' still available when not connected to daemon
* #1895: Fix Files Tab showing wrong files due to torrent_info race condition
* #2010: Move speed text in titlebar to the beginning
* #2032: Wait for client to shutdown/disconnect before stopping reactor
* Fix compatibility with Python 2.5
* Fix collapsed treeview in Create Torrent dialog
* Ignore unmaximise event when window isn't visible
* #1976: Fixed text entry with trailing newline characters causing issues for Move Storage
==== WebUI ====
* Fix Webui files-tab menu setting wrong priority
* Update to ExtJS 3.4.0
* #1960: Fix statustab showing total_payload_download for upload as well
* Remove uneeded Titlebar to save space
* Fix clipped Browse button in WebUI
* #1915: Fix being unable to stop the status bar from autohiding
* Fix password box focus issue in Firefox
* Fix plugin uploads from behind a reverse proxy
* #2010: Move speed text in titlebar to the beginning
* #1936: Fix Referenced before assignment error in json_api
* Changes are now applied when clicking OK in Preferences
* Added Download,Uploaded,Down Limit, Up Limit & Seeder/Peeds columns
* Add magnet uri support to Add Url
* Add keymaps for torrents - Ctrl-A (select all) and Delete
* #2037: Fix 'Add Torrents' torrents list not scrolling
* #2038: Fix Chrome 17 disconnecting from webui
==== Console ====
* #1953: Fix flickering on every update
* #1954: Fix 'invalid literal for float' when setting listen interface
* #1945: Fix UnicodeDecodeError when using non-ascii chars in info
==== Label ====
* #1961: Add missing 'All' filter option
* #2035: Fix label options dialog in webui
* #2036: Fix newly added labels not being sorted in torrent right click menu
==== Notification ====
* #1905: Fix no email sent to second email address
* #1898: Fix email notifications not including date/time they were sent
==== Scheduler ====
* Add plugin page for WebUi
==== Execute ====
* Commands now run scripts asynchronous to prevent Deluge from hanging
==== AutoAdd ====
* Added watch folder support for '.magnet' text file containing single or multiple magnet uris
* Fix glade object issue when re-enabling plugin in same session
* Fix plugin not showing as enabled in webui
=== Deluge 1.3.3 (22 July 2011) ===
==== Core ====
* Properly show the 'Checking Resume Data' state instead of just 7
* #1788: Added ability to use XDG_DOWNLOAD_DIR as default download folder
* Fix path error with torrent files prefixed with 'file://' from Firefox
* #1869: Fix setting the disk io read/write to bypass OS cache in Windows
* #1504: Fix win32 running deluged as not logged in user via runas or service
* #890: If added torrent already exists, append extra trackers to it
* #1338: Fix Seeds and Peers totals not updating
* #1239: Fix translated Tracker Error text not counted in sidebar Error status
* Fix httpdownloader error with existing filename
* #1505: Add libtorrent info to version output
* #1637 Fix UnicodeDecodeError from 'deluge-* --help' with non-english languages
* #1714 Fix handling of backslashes when renaming files/folders
==== GtkUI ====
* Show the checking icon for torrents in the 'Checking Resume Data' state
* #1195: Fix right-click selecting issue when switching between folders and files
* Add F2 key shortcut for renaming filenames in the Files Tab
* Increase max piece size to 16 MiB in create torrent dialog
* #1475: Fix save and restore Preferences dialog size from config
* Add search as you type to the torrent view
* #1456: Fix no ETA showing with multiple files
* #1560: Fix FilesTab Progress value sorting by int instead of float
* #1263: Fix not remembering column widths
* #948: New Release Dialog now shows the server version
* Fix peers in PeersTab showing non-zero download rate when seeding
==== AutoAdd ====
* #1861: Fix AutoAdd Warning (column number is a boolean)
==== Label ====
* #1246: Fix losing Labels upon restart
==== Execute ====
* #1477: Fix ignore Added events from state file on startup
==== ConsoleUI ====
* #1258: Add support for urls and magnet uris in add command
* #1801: Fix unhandled defered error and missing error message upon failed connect
=== Deluge 1.3.2 (24 May 2011) ===
==== Core ====
* #1527: Fix Converting unicode to unicode error in move_storage
* #1373: Fix creating and moving non-ascii folder names in MS Windows
* #1507: Fix temporary file race condition in core/core.py:add_torrent_url
* Fix a bug that can occur when upgrading 1.1 config files
* #1517: Fix isohunt urls not loading
* Handle redirection when adding a torrent by url
* #1614: Fix autoadd matching a directory called "torrent"
* #1742: Fix failure in Event handler prevents further emissions
==== GtkUI ====
* #1514: Added Indicator Applet
* #1494: Add torrent columns Downloaded and Uploaded
* #1308: Add torrent column Seeds/Peers ratio
* #1646: Add torrent columns for per torrent upload and download speed limits
* Add missing icons for Trackers filter
* Fix inconsistancies in the text for translation
* #1510: Fix cannot create a torrent with only non-zero tier trackers
* #1513: Fix unhandled Twisted Error in test_listen_port
* #690: Fix renaming folders does not remove old empty folders
* #1336: Fix uneeded horizontal scrollbar showing in Files & Peers Tab
* #1508: Fix TypeError in cell_data_queue() could not convert argument to correct param type
* #1498: Fix double slashes appearing when renaming
* #1283: Fix consistent icons for Files tab
* #1282: Text for AutoManaged changed to 'On/Off' and localized
* Fix Up/Down buttons in Edit Trackers Dialog
* Add Key Shortcuts for main menu functions
==== WebUI ====
* #1194: Fix infinite login prompt in web ui through reverse proxy
* #1355: Fix slow changing states in webUI
* #1536: Fix Edit Trackers window not scrolling and not being resizable
* #1799: Fix Missing textbox for "Move completed" in torrent options
* #1562: Fix Javascript error in Web UI when re-opening preferences
* #1567: Fix js from plugins does not work with different 'base' setting
* #1268: Fix torrent errors not displayed in webui
* #1323: Fix filter panels not scrollable
* Fix file uploads from behind a reverse proxy.
* #1333: Fix peer list doesn't update automatically
* #1537: Fix editing trackers list, trackers have to be reselected
==== ConsoleUI ====
* #755: Fix can't set listen_ports through console UI
* #1500: Fix Console crashes on command longer than terminal width
* #1248: Fix deluge-console unicode support on redirected stdout
* Fix for deluge-console not adding torrent files on MS Windows
* #1450: Fix trailing white space in paths
* Misc: Updated help text for deluge-console on MS Windows
* #1484: Fix trying to access the screen object when not using interactive mode
* #1548: Fix cli argument processing
* #1856: Add --sort option to info command
* #1857: Add seeding_time, active_time and tracker_status to info command
==== Scheduler ====
* #1506: Fix max speed not restored on a yellow->green transition
=== Deluge 1.3.1 (31 October 2010) ===
==== Core ====
* #1369: Fix non-ascii config folders not working in windows
==== GtkUI ====
* #1365: Fix sidebar not updating show/hide trackers
* #1247: Fix hang on quit
==== WebUI ====
* #1364: Fix preferences not saving when the web ui plugin is enabled in classic mode
* #1377: Fix bug when enabling plugins
* #1370: Fix issues with preferences
* #1312: Fix deluge-web using 100% CPU
=== Deluge 1.3.0 (18 September 2010) ===
==== Core ====
* Fix issue where the save_timer is cancelled when it's not active
* Fix unhandled exception when adding a torrent to the session
* Moved xdg import so it is not called on Windows, where it is unused. fixes #1343
* Fix key error after enabling a plugin that introduces a new status key
* Ignore global stop ratio related settings in logic, so per torrent ones are used.
* Ensure preferencesmanager only changes intended libtorrent session settings.
* Fix issue when adding torrents without a 'session'. This can happen when a plugin adds a torrent, like how the AutoAdd plugin works. The user that adds this torrent will be an empty string.
* Add TorrentFileCompleted event
==== GtkUI ====
* Increase max piece size to 8 MiB in create torrent dialog (closes #1358)
==== Scheduler ====
* Add max active downloading and seeding options to scheduler.
* Fix scheduler so that it keeps current state, even after global settings change.
==== AutoAdd ====
* AutoAdd plugin can now recover when one of the watchfolders has an unhandled exception.
* Fix bug in AutoAdd plugin where watchdirs would not display in gtkui when first enabled.
* Fix bugs with unicode torrents in AutoAdd plugin.
=== Deluge 1.3.0-rc2 (20 August 2010) ===
==== Core ====
* Fix tracker_icons failing on windows
* Fix #1302 an uncaught exception in an state_changed event handler in SessionProxy was preventing the TorrentManager's stop method from properly saving all the resume data
* Fix issue with SessionProxy not updating the torrent status correctly when get_torrent_status calls take place within the cache_expiry time
==== ConsoleUI ====
* #1307: Fix not being able to add torrents
* #1293: Fix not being able to add paths that contain backslashes
==== GtkUI ====
* Fix uncaught exception when closing deluge in classic mode
==== Execute ====
* #1306: Fix always executing last event
==== Label ====
* Fix being able to remove labels in web ui
==== WebUI ====
* #1319: Fix shift selecting in file trees
=== Deluge 1.3.0-rc1 (08 May 2010) ===
==== Core ====
* Implement #1063 option to delete torrent file copy on torrent removal - patch from Ghent
* Implement #457 progress bars for folders
@ -7,15 +393,33 @@
* #1112: Fix renaming files in add torrent dialog
* #1247: Fix deluge-gtk from hanging on shutdown
* #995: Rewrote tracker_icons
* Add AutoAdd plugin
* Add Notifications plugin
==== GtkUI ====
* Use new SessionProxy class for caching torrent status client-side
* Use torrent status diffs to reduce RPC traffic
==== Blocklist ====
* Implement local blocklist support
* #861: Pause transfers until blocklist is imported
* Fix redirection not working with relative paths
==== Execute ====
* Fix running commands with the TorrentAdded event
* Fix the web interface
==== Label ====
* Fix the web interface (#733)
==== Web ====
* Migrate to ExtJS 3.1
* Add gzip compression of HTTP data to the server
* Improve the efficiency of the TorrentGrid
* Improve the efficiency of the TorrentGrid with lots of torrents (#1026)
* Add a base parameter to allow reverse proxying (#1076)
* Fix showing all the peers in the details tab (#1054)
* Fix uploading torrent files in Opera or IE (#1087)
* Complete IE support
=== Deluge 1.2.0 - "Bursting like an infected kidney" (10 January 2010) ===
==== Core ====

22
DEPENDS
View File

@ -1,30 +1,30 @@
=== Core ===
* python >= 2.5
* python >= 2.6
* twisted >= 8.1
* twisted-web >= 8.1
* pyopenssl
* simplejson (if python < 2.6)
* setuptools
* gettext
* intltool
* pyxdg
* chardet
* geoip-database (optional)
* setproctitle (optional)
* rencode >= 1.0.2 (optional), a Python port is already included
* libtorrent >= 0.14, or build the included version
* libtorrent (rasterbar) >= 0.16.7
* If building included libtorrent::
* boost >= 1.34.1
* If building libtorrent:
* boost >= 1.40
* openssl
* zlib
=== UIs ===
* chardet
=== Gtk ===
* python-notify (libnotify python wrapper)
* pygame
* pygtk >= 2.12
* pygtk >= 2.16
* librsvg
* xdg-utils
* python-notify (optional)
* pygame (optional)
=== Web ===
* mako

View File

@ -1,12 +1,23 @@
recursive-include docs/man *
recursive-include deluge *
recursive-include win32 *
include AUTHORS ChangeLog DEPENDS ez_setup.py LICENSE msgfmt.py RELEASE-VERSION version.py
graft docs/man
recursive-exclude deluge *.egg-link
exclude deluge/ui/web/gen_gettext.py
include deluge/i18n/*.po
graft deluge/plugins
recursive-exclude deluge/plugins create_dev_link.sh *.pyc
prune deluge/tests
graft deluge/ui/data
graft deluge/ui/gtkui/glade
include deluge/ui/web/index.html
include deluge/ui/web/gettext.js
include deluge/ui/web/css/*.css
exclude deluge/ui/web/css/*-debug.css
exclude deluge/ui/web/js/build.sh
exclude deluge/ui/web/js/Deluge*.js
include deluge/ui/web/js/*.js
exclude deluge/ui/web/js/*-debug.js
prune deluge/ui/web/docs
prune deluge/scripts
exclude deluge/ui/web/gen_gettext.py
graft deluge/ui/web/themes
graft deluge/ui/web/render
graft deluge/ui/web/icons
graft deluge/ui/web/images

71
README
View File

@ -1,4 +1,3 @@
==========================
Deluge BitTorrent Client
==========================
@ -9,86 +8,50 @@ Authors:
Andrew Resch
Damien Churchill
For past developers and contributers see: http://dev.deluge-torrent.org/wiki/About
==========================
License
==========================
Deluge is under the GNU GPLv3 license.
Icon data/pixmaps/deluge.svg and derivatives in data/icons are copyright
Andrew Wedderburn and are under the GNU GPLv3.
All other icons in data/pixmaps are copyright Andrew Resch and are under
the GNU GPLv3.
==========================
Contact/Support:
==========================
We have two options available for support:
Our Forum, at: http://forum.deluge-torrent.org
or
Our IRC Channel, at #deluge on Freenode: http://freenode.net
For contributors and past developers see:
AUTHORS
==========================
Installation Instructions:
==========================
For more detailed instructions see: http://dev.deluge-torrent.org/wiki/Installing/Source
For detailed instructions see: http://dev.deluge-torrent.org/wiki/Installing/Source
See: DEPENDS for a full list of dependencies.
Ensure build dependencies are installed, see DEPENDS for a full listing.
First, make sure you have the proper build dependencies installed. On a normal
Debian or Ubuntu system:
Build and install by running:
sudo apt-get install g++ make python-all-dev python-all python-dbus \
python-gtk2 python-notify librsvg2-common python-xdg python-support \
subversion libboost-dev libboost-python-dev \
libboost-thread-dev libboost-date-time-dev libboost-filesystem-dev \
libssl-dev zlib1g-dev python-setuptools \
python-mako python-twisted-web python-chardet python-simplejson
$ python setup.py build
$ sudo python setup.py install
The names of the packages may vary depending on your OS / distro.
==========================
Contact/Support:
==========================
Once you have the needed libraries installed, build and install by running:
$ python setup.py build
$ sudo python setup.py install
Forum: http://forum.deluge-torrent.org
IRC Channel: #deluge on irc.freenode.net
==========================
FAQ
==========================
For the full FAQ see: http://dev.deluge-torrent.org/wiki/Faq
How to start the various user-interfaces
Gtk:
deluge-gtk
deluge or deluge-gtk
Console:
deluge-console
Web:
deluge-web
Go to http://localhost:8112/ default-password = "deluge"
Why is deluge still listed in my system tray even after I close it ?
You closed the gtk user-interface but you did not close the daemon. Choose "Quit & Shutdown Daemon" to close both Daemon and gtk-ui.
How do I start the daemon?
deluged
How do I start the daemon with logging to console?
deluged -d -L <log level>
I can't connect to the daemon from another machine
* Configure the daemon to allow remote connections
* Add a user to the auth file located in the config folder: ~/.config/deluge/auth
* Restart the daemon.
See: http://dev.deluge-torrent.org/wiki/UserGuide/ThinClient
I upgraded from 0.5 and plugin x is missing
1.0 is a rewrite, all old 0.5 plugins have to be rewritten.
For the full FAQ see: http://dev.deluge-torrent.org/wiki/Faq

21
check_glade.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh
# Fixes glade files which may have set gtk stock labels set to translatable
for x in `find . -name '*.glade' |grep -v '.git\|build'` ; do \
for y in gtk-add gtk-apply gtk-bold gtk-cancel gtk-cdrom gtk-clear \
gtk-close gtk-color-picker gtk-connect gtk-convert gtk-copy gtk-cut \
gtk-delete gtk-dialog-error gtk-dialog-info gtk-dialog-question \
gtk-dialog-warning gtk-dnd gtk-dnd-multiple gtk-edit gtk-execute gtk-find \
gtk-find-and-replace gtk-floppy gtk-goto-bottom gtk-goto-first \
gtk-goto-last gtk-goto-top gtk-go-back gtk-go-down gtk-go-forward \
gtk-go-up gtk-help gtk-home gtk-index gtk-italic gtk-jump-to \
gtk-justify-center gtk-justify-fill gtk-justify-left gtk-missing-image \
gtk-new gtk-no gtk-ok gtk-open gtk-paste gtk-preferences gtk-print \
gtk-print-preview gtk-properties gtk-quit gtk-redo gtk-refresh \
gtk-remove gtk-revert-to-saved gtk-save gtk-save-as gtk-select-color \
gtk-select-font gtk-sort-descending gtk-spell-check gtk-stop \
gtk-strikethrough gtk-undelete gtk-underline gtk-undo gtk-yes \
gtk-zoom-100 gtk-zoom-fit gtk-zoom-in gtk-zoom-out; do \
sed -i "s/<property\ name\=\"label\"\ translatable\=\"yes\">$y<\/property>/<property\ name\=\"label\"\ translatable\=\"no\">$y<\/property>/g" $x; \
done;\
done

17
create_potfiles_in.py Normal file → Executable file
View File

@ -1,17 +1,26 @@
#!/usr/bin/env python
import os
import re
import sys
# Paths to exclude
EXCLUSIONS = [
"deluge/scripts"
"deluge/scripts",
"deluge/i18n",
]
POTFILE_IN = "deluge/i18n/POTFILES.in"
print "Creating " + POTFILE_IN + " .."
pattern = "deluge\/plugins\/.*\/build"
compiled = re.compile(pattern)
sys.stdout.write("Creating " + POTFILE_IN + " ... ")
sys.stdout.flush()
to_translate = []
for (dirpath, dirnames, filenames) in os.walk("deluge"):
for filename in filenames:
if os.path.splitext(filename)[1] in (".py", ".glade") and dirpath not in EXCLUSIONS:
if os.path.splitext(filename)[1] in (".py", ".glade", ".in") \
and dirpath not in EXCLUSIONS \
and not compiled.match(dirpath):
to_translate.append(os.path.join(dirpath, filename))
f = open(POTFILE_IN, "wb")

View File

@ -1,6 +1,6 @@
#!/bin/bash
for size in 16 22 24 32 36 48 64 72 96 128 192 256; do mkdir -p deluge/data/\
for size in 16 22 24 32 36 48 64 72 96 128 192 256; do mkdir -p deluge/ui/data/\
icons/hicolor/${size}x${size}/apps; rsvg-convert -w ${size} -h ${size} \
-o deluge/data/icons/hicolor/${size}x${size}/apps/deluge.png deluge/data/pixmaps\
/deluge.svg; mkdir -p deluge/data/icons/scalable/apps/; cp deluge/data/pixmaps/\
deluge.svg deluge/data/icons/scalable/apps/deluge.svg; done
-o deluge/ui/data/icons/hicolor/${size}x${size}/apps/deluge.png deluge/ui/data/pixmaps\
/deluge.svg; mkdir -p deluge/ui/data/icons/scalable/apps/; cp deluge/ui/data/pixmaps/\
deluge.svg deluge/ui/data/icons/scalable/apps/deluge.svg; done

View File

@ -1 +1,4 @@
"""Deluge"""
# this is a namespace package
import pkg_resources
pkg_resources.declare_namespace(__name__)

View File

@ -45,9 +45,9 @@ supports.
"""
REQUIRED_VERSION = "0.14.9.0"
REQUIRED_VERSION = "0.16.7.0"
def check_version(LT):
def check_version(lt):
from deluge.common import VersionSplit
if VersionSplit(lt.version) < VersionSplit(REQUIRED_VERSION):
raise ImportError("This version of Deluge requires libtorrent >=%s!" % REQUIRED_VERSION)

View File

@ -17,9 +17,9 @@
#
# You should have received a copy of the GNU General Public License
# along with deluge. If not, write to:
# The Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA.
# The Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA.
#
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the OpenSSL
@ -37,16 +37,25 @@
"""Common functions for various parts of Deluge to use."""
import os
import sys
import time
import subprocess
import platform
import sys
import chardet
import logging
import pkg_resources
import gettext
import locale
try:
import json
except ImportError:
import simplejson as json
from deluge.error import *
log = logging.getLogger(__name__)
# Do a little hack here just in case the user has json-py installed since it
# has a different api
if not hasattr(json, "dumps"):
@ -62,29 +71,6 @@ if not hasattr(json, "dumps"):
json.dump = dump
json.load = load
import pkg_resources
import xdg, xdg.BaseDirectory
import gettext
import locale
# Initialize gettext
try:
if hasattr(locale, "bindtextdomain"):
locale.bindtextdomain("deluge", pkg_resources.resource_filename("deluge", "i18n"))
if hasattr(locale, "textdomain"):
locale.textdomain("deluge")
gettext.bindtextdomain("deluge", pkg_resources.resource_filename("deluge", "i18n"))
gettext.textdomain("deluge")
gettext.install("deluge", pkg_resources.resource_filename("deluge", "i18n"))
except Exception, e:
from deluge.log import LOG as log
log.error("Unable to initialize gettext/locale!")
log.exception(e)
import __builtin__
__builtin__.__dict__["_"] = lambda x: x
from deluge.error import *
LT_TORRENT_STATE = {
"Queued": 0,
"Checking": 1,
@ -104,7 +90,6 @@ LT_TORRENT_STATE = {
7: "Checking Resume Data"
}
TORRENT_STATE = [
"Allocating",
"Checking",
@ -119,11 +104,15 @@ FILE_PRIORITY = {
0: "Do Not Download",
1: "Normal Priority",
2: "High Priority",
5: "Highest Priority",
3: "High Priority",
4: "High Priority",
5: "High Priority",
6: "High Priority",
7: "Highest Priority",
"Do Not Download": 0,
"Normal Priority": 1,
"High Priority": 2,
"Highest Priority": 5
"High Priority": 5,
"Highest Priority": 7
}
def get_version():
@ -144,16 +133,26 @@ def get_default_config_dir(filename=None):
:rtype: string
"""
if windows_check():
if filename:
return os.path.join(os.environ.get("APPDATA"), "deluge", filename)
else:
return os.path.join(os.environ.get("APPDATA"), "deluge")
def save_config_path(resource):
appDataPath = os.environ.get("APPDATA")
if not appDataPath:
import _winreg
hkey = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders")
appDataReg = _winreg.QueryValueEx(hkey, "AppData")
appDataPath = appDataReg[0]
_winreg.CloseKey(hkey)
return os.path.join(appDataPath, resource)
else:
if filename:
return os.path.join(xdg.BaseDirectory.save_config_path("deluge"), filename)
else:
return xdg.BaseDirectory.save_config_path("deluge")
from xdg.BaseDirectory import save_config_path
if not filename:
filename = ''
try:
return os.path.join(save_config_path("deluge"), filename)
except OSError, e:
log.error("Unable to use default config directory, exiting... (%s)", e)
sys.exit(1)
def get_default_download_dir():
"""
@ -162,8 +161,20 @@ def get_default_download_dir():
"""
if windows_check():
return os.path.expanduser("~")
return os.path.join(os.path.expanduser("~"), 'Downloads')
else:
from xdg.BaseDirectory import xdg_config_home
userdir_file = os.path.join(xdg_config_home, 'user-dirs.dirs')
try:
for line in open(userdir_file, 'r'):
if not line.startswith('#') and 'XDG_DOWNLOAD_DIR' in line:
download_dir = os.path.expandvars(\
line.partition("=")[2].rstrip().strip('"'))
if os.path.isdir(download_dir):
return download_dir
except IOError:
pass
return os.environ.get("HOME")
def windows_check():
@ -198,7 +209,7 @@ def osx_check():
def get_pixmap(fname):
"""
Provides easy access to files in the deluge/data/pixmaps folder within the Deluge egg
Provides easy access to files in the deluge/ui/data/pixmaps folder within the Deluge egg
:param fname: the filename to look for
:type fname: string
@ -206,8 +217,18 @@ def get_pixmap(fname):
:rtype: string
"""
return pkg_resources.resource_filename("deluge", os.path.join("data", \
"pixmaps", fname))
return resource_filename("deluge", os.path.join("ui", "data", "pixmaps", fname))
def resource_filename(module, path):
# While developing, if there's a second deluge package, installed globally
# and another in develop mode somewhere else, while pkg_resources.require("Deluge")
# returns the proper deluge instance, pkg_resources.resource_filename does
# not, it returns the first found on the python path, which is not good
# enough.
# This is a work-around that.
return pkg_resources.require("Deluge>=%s" % get_version())[0].get_resource_filename(
pkg_resources._manager, os.path.join(*(module.split('.')+[path]))
)
def open_file(path):
"""
@ -218,7 +239,9 @@ def open_file(path):
"""
if windows_check():
os.startfile("%s" % path)
os.startfile(path.decode("utf8"))
elif osx_check():
subprocess.Popen(["open", "%s" % path])
else:
subprocess.Popen(["xdg-open", "%s" % path])
@ -259,6 +282,30 @@ def fsize(fsize_b):
fsize_gb = fsize_mb / 1024.0
return "%.1f %s" % (fsize_gb, _("GiB"))
def fsize_short(fsize_b):
"""
Formats the bytes value into a string with K, M or G units
:param fsize_b: the filesize in bytes
:type fsize_b: int
:returns: formatted string in K, M or G units
:rtype: string
**Usage**
>>> fsize(112245)
'109.6 K'
"""
fsize_kb = fsize_b / 1024.0
if fsize_kb < 1024:
return "%.1f %s" % (fsize_kb, _("K"))
fsize_mb = fsize_kb / 1024.0
if fsize_mb < 1024:
return "%.1f %s" % (fsize_mb, _("M"))
fsize_gb = fsize_mb / 1024.0
return "%.1f %s" % (fsize_gb, _("G"))
def fpcnt(dec):
"""
Formats a string to display a percentage with two decimal places
@ -291,7 +338,14 @@ def fspeed(bps):
'42.1 KiB/s'
"""
return '%s/s' % (fsize(bps))
fspeed_kb = bps / 1024.0
if fspeed_kb < 1024:
return "%.1f %s" % (fspeed_kb, _("KiB/s"))
fspeed_mb = fspeed_kb / 1024.0
if fspeed_mb < 1024:
return "%.1f %s" % (fspeed_mb, _("MiB/s"))
fspeed_gb = fspeed_mb / 1024.0
return "%.1f %s" % (fspeed_gb, _("GiB/s"))
def fpeer(num_peers, total_peers):
"""
@ -402,7 +456,9 @@ def is_magnet(uri):
True
"""
if uri[:20] == "magnet:?xt=urn:btih:":
magnet_scheme = 'magnet:?'
xt_param = 'xt=urn:btih:'
if uri.startswith(magnet_scheme) and xt_param in uri:
return True
return False
@ -470,12 +526,11 @@ def free_space(path):
raise InvalidPathError("%s is not a valid path" % path)
if windows_check():
import win32file
sectors, bytes, free, total = map(long, win32file.GetDiskFreeSpace(path))
return (free * sectors * bytes)
from win32file import GetDiskFreeSpaceEx
return GetDiskFreeSpaceEx(path)[0]
else:
disk_data = os.statvfs(path)
block_size = disk_data.f_bsize
disk_data = os.statvfs(path.encode("utf8"))
block_size = disk_data.f_frsize
return disk_data.f_bavail * block_size
def is_ip(ip):
@ -496,15 +551,23 @@ def is_ip(ip):
import socket
#first we test ipv4
try:
if socket.inet_pton(socket.AF_INET, "%s" % (ip)):
return True
if windows_check():
if socket.inet_aton("%s" % (ip)):
return True
else:
if socket.inet_pton(socket.AF_INET, "%s" % (ip)):
return True
except socket.error:
if not socket.has_ipv6:
return False
#now test ipv6
try:
if socket.inet_pton(socket.AF_INET6, "%s" % (ip)):
if windows_check():
log.warning("ipv6 check unavailable on windows")
return True
else:
if socket.inet_pton(socket.AF_INET6, "%s" % (ip)):
return True
except socket.error:
return False
@ -526,7 +589,7 @@ def path_join(*parts):
path += '/' + part
return path
XML_ESCAPES = (
XML_ESCAPES = (
('&', '&amp;'),
('<', '&lt;'),
('>', '&gt;'),
@ -535,9 +598,9 @@ XML_ESCAPES = (
)
def xml_decode(string):
"""
"""
Unescape a string that was previously encoded for use within xml.
:param string: The string to escape
:type string: string
:returns: The unescaped version of the string.
@ -548,9 +611,9 @@ def xml_decode(string):
return string
def xml_encode(string):
"""
"""
Escape a string for use within an xml element or attribute.
:param string: The string to escape
:type string: string
:returns: An escaped version of the string.
@ -560,6 +623,59 @@ def xml_encode(string):
string = string.replace(char, escape)
return string
def decode_string(s, encoding="utf8"):
"""
Decodes a string and return unicode. If it cannot decode using
`:param:encoding` then it will try latin1, and if that fails,
try to detect the string encoding. If that fails, decode with
ignore.
:param s: string to decode
:type s: string
:keyword encoding: the encoding to use in the decoding
:type encoding: string
:returns: s converted to unicode
:rtype: unicode
"""
if not s:
return u''
elif isinstance(s, unicode):
return s
encodings = [lambda: ("utf8", 'strict'),
lambda: ("iso-8859-1", 'strict'),
lambda: (chardet.detect(s)["encoding"], 'strict'),
lambda: (encoding, 'ignore')]
if not encoding is "utf8":
encodings.insert(0, lambda: (encoding, 'strict'))
for l in encodings:
try:
return s.decode(*l())
except UnicodeDecodeError:
pass
return u''
def utf8_encoded(s, encoding="utf8"):
"""
Returns a utf8 encoded string of s
:param s: (unicode) string to (re-)encode
:type s: basestring
:keyword encoding: the encoding to use in the decoding
:type encoding: string
:returns: a utf8 encoded string of s
:rtype: str
"""
if isinstance(s, str):
s = decode_string(s, encoding).encode("utf8")
elif isinstance(s, unicode):
s = s.encode("utf8")
return s
class VersionSplit(object):
"""
Used for comparing version numbers.
@ -569,14 +685,36 @@ class VersionSplit(object):
"""
def __init__(self, ver):
ver = ver.lower()
vs = ver.split("_") if "_" in ver else ver.split("-")
import re
VERSION_RE = re.compile(r'''
^
(?P<version>\d+\.\d+) # minimum 'N.N'
(?P<extraversion>(?:\.\d+)*) # any number of extra '.N' segments
(?:
(?P<prerel>[abc]|rc) # 'a'=alpha, 'b'=beta, 'c'=release candidate
# 'rc'= alias for release candidate
(?P<prerelversion>\d+(?:\.\d+)*)
)?
(?P<postdev>(\.post(?P<post>\d+))?(\.dev(?P<dev>\d+))?)?
$''', re.VERBOSE)
# Check for PEP 386 compliant version
match = re.search(VERSION_RE, ver)
if match:
group = [(x if x is not None else '') for x in match.group(1,2,3,4,8)]
vs = [''.join(group[0:2]),''.join(group[2:4]), group[4].lstrip('.')]
else:
ver = ver.lower()
vs = ver.replace("_", "-").split("-")
self.version = [int(x) for x in vs[0].split(".")]
self.suffix = None
self.dev = False
if len(vs) > 1:
for s in ("rc", "alpha", "beta", "dev"):
if s in vs[1][:len(s)]:
self.suffix = vs[1]
if vs[1].startswith(("rc", "a", "b", "c")):
self.suffix = vs[1]
if vs[-1].startswith('dev'):
self.dev = vs[-1]
def __cmp__(self, ver):
"""
@ -586,20 +724,117 @@ class VersionSplit(object):
:type ver: VersionSplit
"""
# PEP 386 versions with .devN precede release version
if (bool(self.dev) != bool(ver.dev)):
if self.dev != 'dev':
self.dev = not self.dev
if ver.dev != 'dev':
ver.dev = not ver.dev
if self.version > ver.version or (self.suffix and self.suffix[:3] == "dev"):
return 1
if self.version < ver.version:
return -1
# If there is no suffix we use z because we want final
# to appear after alpha, beta, and rc alphabetically.
v1 = [self.version, self.suffix or 'z', self.dev]
v2 = [ver.version, ver.suffix or 'z', ver.dev]
return cmp(v1, v2)
if self.version == ver.version:
if self.suffix == ver.suffix:
return 0
if self.suffix is None:
return 1
if ver.suffix is None:
return -1
if self.suffix < ver.suffix:
return -1
if self.suffix > ver.suffix:
return 1
# Common AUTH stuff
AUTH_LEVEL_NONE = 0
AUTH_LEVEL_READONLY = 1
AUTH_LEVEL_NORMAL = 5
AUTH_LEVEL_ADMIN = 10
AUTH_LEVEL_DEFAULT = AUTH_LEVEL_NORMAL
def create_auth_file():
import stat, configmanager
auth_file = configmanager.get_config_dir("auth")
# Check for auth file and create if necessary
if not os.path.exists(auth_file):
fd = open(auth_file, "w")
fd.flush()
os.fsync(fd.fileno())
fd.close()
# Change the permissions on the file so only this user can read/write it
os.chmod(auth_file, stat.S_IREAD | stat.S_IWRITE)
def create_localclient_account(append=False):
import configmanager, random
auth_file = configmanager.get_config_dir("auth")
if not os.path.exists(auth_file):
create_auth_file()
try:
from hashlib import sha1 as sha_hash
except ImportError:
from sha import new as sha_hash
fd = open(auth_file, "a" if append else "w")
fd.write(":".join([
"localclient",
sha_hash(str(random.random())).hexdigest(),
str(AUTH_LEVEL_ADMIN)
]) + '\n')
fd.flush()
os.fsync(fd.fileno())
fd.close()
# Initialize gettext
def setup_translations(setup_pygtk=False):
translations_path = resource_filename("deluge", "i18n")
log.info("Setting up translations from %s", translations_path)
try:
if hasattr(locale, "bindtextdomain"):
locale.bindtextdomain("deluge", translations_path)
if hasattr(locale, "textdomain"):
locale.textdomain("deluge")
gettext.install("deluge", translations_path, unicode=True)
if setup_pygtk:
# Even though we're not using glade anymore, let's set it up so that
# plugins still using it get properly translated.
log.info("Setting up GTK translations from %s", translations_path)
import gtk
import gtk.glade
gtk.glade.bindtextdomain("deluge", translations_path)
gtk.glade.textdomain("deluge")
except Exception, e:
log.error("Unable to initialize gettext/locale!")
log.exception(e)
import __builtin__
__builtin__.__dict__["_"] = lambda x: x
def unicode_argv():
""" Gets sys.argv as list of unicode objects on any platform."""
if windows_check():
# Versions 2.x of Python don't support Unicode in sys.argv on
# Windows, with the underlying Windows API instead replacing multi-byte
# characters with '?'.
from ctypes import POINTER, byref, cdll, c_int, windll
from ctypes.wintypes import LPCWSTR, LPWSTR
GetCommandLineW = cdll.kernel32.GetCommandLineW
GetCommandLineW.argtypes = []
GetCommandLineW.restype = LPCWSTR
CommandLineToArgvW = windll.shell32.CommandLineToArgvW
CommandLineToArgvW.argtypes = [LPCWSTR, POINTER(c_int)]
CommandLineToArgvW.restype = POINTER(LPWSTR)
cmd = GetCommandLineW()
argc = c_int(0)
argv = CommandLineToArgvW(cmd, byref(argc))
if argc.value > 0:
# Remove Python executable and commands if present
start = argc.value - len(sys.argv)
return [argv[i] for i in
xrange(start, argc.value)]
else:
# On other platforms, we have to find the likely encoding of the args and decode
# First check if sys.stdout or stdin have encoding set
encoding = getattr(sys.stdout, "encoding") or getattr(sys.stdin, "encoding")
# If that fails, check what the locale is set to
encoding = encoding or locale.getpreferredencoding()
# As a last resort, just default to utf-8
encoding = encoding or "utf-8"
return [arg.decode(encoding) for arg in sys.argv]

View File

@ -33,9 +33,12 @@
#
#
import logging
from collections import defaultdict
from twisted.internet.defer import maybeDeferred, succeed, DeferredList, fail
from twisted.internet.task import LoopingCall
from deluge.log import LOG as log
log = logging.getLogger(__name__)
class ComponentAlreadyRegistered(Exception):
pass
@ -96,6 +99,10 @@ class Component(object):
self._component_stopping_deferred = None
_ComponentRegistry.register(self)
def __del__(self):
if _ComponentRegistry:
_ComponentRegistry.deregister(self)
def _component_start_timer(self):
if hasattr(self, "update"):
self._component_timer = LoopingCall(self.update)
@ -139,11 +146,18 @@ class Component(object):
self._component_timer.stop()
return True
def on_stop_fail(result):
self._component_state = "Started"
self._component_stopping_deferred = None
log.error(result)
return result
if self._component_state != "Stopped" and self._component_state != "Stopping":
if hasattr(self, "stop"):
self._component_state = "Stopping"
d = maybeDeferred(self.stop)
d.addCallback(on_stop)
d.addErrback(on_stop_fail)
self._component_stopping_deferred = d
else:
d = maybeDeferred(on_stop, None)
@ -192,6 +206,18 @@ class Component(object):
d.addCallback(on_stop)
return d
def start(self):
pass
def stop(self):
pass
def update(self):
pass
def shutdown(self):
pass
class ComponentRegistry(object):
"""
The ComponentRegistry holds a list of currently registered
@ -200,6 +226,8 @@ class ComponentRegistry(object):
"""
def __init__(self):
self.components = {}
# Stores all of the components that are dependent on a particular component
self.dependents = defaultdict(list)
def register(self, obj):
"""
@ -218,23 +246,26 @@ class ComponentRegistry(object):
"Component already registered with name %s" % name)
self.components[obj._component_name] = obj
if obj._component_depend:
for depend in obj._component_depend:
self.dependents[depend].append(name)
def deregister(self, name):
def deregister(self, obj):
"""
Deregisters a component from the registry. A stop will be
issued to the component prior to deregistering it.
:param name: the name of the component
:type name: string
:param obj: the Component object
:type obj: object
"""
if name in self.components:
log.debug("Deregistering Component: %s", name)
d = self.stop([name])
if obj in self.components.values():
log.debug("Deregistering Component: %s", obj._component_name)
d = self.stop([obj._component_name])
def on_stop(result, name):
del self.components[name]
return d.addCallback(on_stop, name)
return d.addCallback(on_stop, obj._component_name)
else:
return succeed(None)
@ -292,11 +323,23 @@ class ComponentRegistry(object):
elif isinstance(names, str):
names = [names]
def on_dependents_stopped(result, name):
return self.components[name]._component_stop()
stopped_in_deferred = set()
deferreds = []
for name in names:
if name in stopped_in_deferred:
continue
if name in self.components:
deferreds.append(self.components[name]._component_stop())
if name in self.dependents:
# If other components depend on this component, stop them first
d = self.stop(self.dependents[name]).addCallback(on_dependents_stopped, name)
deferreds.append(d)
stopped_in_deferred.update(self.dependents[name])
else:
deferreds.append(self.components[name]._component_stop())
return DeferredList(deferreds)
@ -335,7 +378,7 @@ class ComponentRegistry(object):
:param names: a list of Components to resume
:type names: list
:returns: a Deferred object that will fire once all Components have been sucessfully resumed
:returns: a Deferred object that will fire once all Components have been successfully resumed
:rtype: twisted.internet.defer.Deferred
"""
@ -359,16 +402,14 @@ class ComponentRegistry(object):
be called when the program is exiting to ensure all Components have a
chance to properly shutdown.
:returns: a Deferred object that will fire once all Components have been sucessfully resumed
:returns: a Deferred object that will fire once all Components have been successfully shut down
:rtype: twisted.internet.defer.Deferred
"""
deferreds = []
def on_stopped(result):
return DeferredList(map(lambda c: c._component_shutdown(), self.components.values()))
for component in self.components.values():
deferreds.append(component._component_shutdown())
return DeferredList(deferreds)
return self.stop(self.components.keys()).addCallback(on_stopped)
def update(self):
"""

View File

@ -45,9 +45,9 @@ The format of the config file is two json encoded dicts:
<version dict>
<content dict>
The version dict contains two keys: file and format. The format version is
controlled by the Config class. It should only be changed when anything below
it is changed directly by the Config class. An example of this would be if we
The version dict contains two keys: file and format. The format version is
controlled by the Config class. It should only be changed when anything below
it is changed directly by the Config class. An example of this would be if we
changed the serializer for the content to something different.
The config file version is changed by the 'owner' of the config file. This is
@ -68,14 +68,16 @@ version as this will be done internally.
"""
import cPickle as pickle
import logging
import shutil
import os
import deluge.common
from deluge.log import LOG as log
json = deluge.common.json
log = logging.getLogger(__name__)
def prop(func):
"""Function decorator for defining property attributes
@ -93,13 +95,13 @@ def prop(func):
def find_json_objects(s):
"""
Find json objects in a string.
:param s: the string to find json objects in
:type s: string
:returns: a list of tuples containing start and end locations of json objects in the string `s`
:rtype: [(start, end), ...]
"""
objects = []
opens = 0
@ -119,8 +121,8 @@ def find_json_objects(s):
start = index + offset + 1
return objects
class Config(object):
"""
This class is used to access/create/modify config files
@ -146,7 +148,8 @@ class Config(object):
self._save_timer = None
if defaults:
self.__config = dict(defaults)
for key, value in defaults.iteritems():
self.set_item(key, value)
# Load the config from file in the config_dir
if config_dir:
@ -187,6 +190,10 @@ what is currently in the config and it could not convert the value
5
"""
if isinstance(value, basestring):
value = deluge.common.utf8_encoded(value)
if not self.__config.has_key(key):
self.__config[key] = value
log.debug("Setting '%s' to %s of %s", key, value, type(value))
@ -200,7 +207,10 @@ what is currently in the config and it could not convert the value
if value is not None and oldtype != type(None) and oldtype != newtype:
try:
value = oldtype(value)
if oldtype == unicode:
value = oldtype(value, "utf8")
else:
value = oldtype(value)
except ValueError:
log.warning("Type '%s' invalid for '%s'", newtype, key)
raise
@ -250,7 +260,38 @@ what is currently in the config and it could not convert the value
5
"""
return self.__config[key]
if isinstance(self.__config[key], str):
try:
return self.__config[key].decode("utf8")
except UnicodeDecodeError:
return self.__config[key]
else:
return self.__config[key]
def __delitem__(self, key):
"""
See
:meth:`del_item`
"""
self.del_item(key)
def del_item(self, key):
"""
Deletes item with a specific key from the configuration.
:param key: the item which you wish to delete.
:raises KeyError: if 'key' is not in the config dictionary
**Usage**
>>> config = Config("test.conf", defaults={"test": 5})
>>> del config["test"]
"""
del self.__config[key]
# We set the save_timer for 5 seconds if not already set
from twisted.internet import reactor
if not self._save_timer or not self._save_timer.active():
self._save_timer = reactor.callLater(5, self.save)
def register_change_callback(self, callback):
"""
@ -348,21 +389,21 @@ what is currently in the config and it could not convert the value
return
objects = find_json_objects(data)
if not len(objects):
# No json objects found, try depickling it
try:
self.__config.update(pickle.loads(data))
except Exception, e:
log.exception(e)
log.warning("Unable to load config file: %s", filename)
log.warning("Unable to load config file: %s", filename)
elif len(objects) == 1:
start, end = objects[0]
try:
self.__config.update(json.loads(data[start:end]))
except Exception, e:
log.exception(e)
log.warning("Unable to load config file: %s", filename)
log.warning("Unable to load config file: %s", filename)
elif len(objects) == 2:
try:
start, end = objects[0]
@ -371,8 +412,8 @@ what is currently in the config and it could not convert the value
self.__config.update(json.loads(data[start:end]))
except Exception, e:
log.exception(e)
log.warning("Unable to load config file: %s", filename)
log.warning("Unable to load config file: %s", filename)
log.debug("Config %s version: %s.%s loaded: %s", filename,
self.__version["format"], self.__version["file"], self.__config)
@ -396,26 +437,24 @@ what is currently in the config and it could not convert the value
version = json.loads(data[start:end])
start, end = objects[1]
loaded_data = json.loads(data[start:end])
if self.__config == loaded_data and self.__version == version:
# The config has not changed so lets just return
self._save_timer.cancel()
return
except Exception, e:
log.warning("Unable to open config file: %s", filename)
if self._save_timer and self._save_timer.active():
self._save_timer.cancel()
return True
except (IOError, IndexError), e:
log.warning("Unable to open config file: %s because: %s", filename, e)
# Save the new config and make sure it's written to disk
try:
log.debug("Saving new config file %s", filename + ".new")
f = open(filename + ".new", "wb")
json.dump(self.__version, f, indent=2)
json.dump(self.__version, f, indent=2)
json.dump(self.__config, f, indent=2)
f.flush()
os.fsync(f.fileno())
f.close()
except Exception, e:
except IOError, e:
log.error("Error writing new config file: %s", e)
return False
@ -424,7 +463,7 @@ what is currently in the config and it could not convert the value
log.debug("Backing up old config file to %s~", filename)
shutil.move(filename, filename + "~")
except Exception, e:
log.error("Error backing up old config..")
log.warning("Unable to backup old config...")
# The new config file has been written successfully, so let's move it over
# the existing one.

View File

@ -34,11 +34,14 @@
#
import os
import logging
import deluge.common
from deluge.log import LOG as log
import deluge.log
from deluge.config import Config
log = logging.getLogger(__name__)
class _ConfigManager:
def __init__(self):
log.debug("ConfigManager started..")
@ -52,7 +55,6 @@ class _ConfigManager:
return self.__config_directory
def __del__(self):
log.debug("ConfigManager stopping..")
del self.config_files
def set_config_dir(self, directory):
@ -86,6 +88,7 @@ class _ConfigManager:
# to reload based on the new config directory
self.save()
self.config_files = {}
deluge.log.tweak_logging_levels()
return True

View File

@ -41,12 +41,14 @@ This should typically only be used by the Core. Plugins should utilize the
"""
import logging
from twisted.internet import reactor
import deluge.component as component
from deluge._libtorrent import lt
from deluge.common import decode_string
from deluge.log import LOG as log
log = logging.getLogger(__name__)
class AlertManager(component.Component):
def __init__(self):
@ -65,16 +67,17 @@ class AlertManager(component.Component):
# handlers is a dictionary of lists {"alert_type": [handler1,h2,..]}
self.handlers = {}
self.delayed_calls = []
self.wait_on_handler = False
def update(self):
self.delayed_calls = [dc for dc in self.delayed_calls if dc.active()]
self.handle_alerts()
self.handle_alerts(wait=self.wait_on_handler)
def stop(self):
for dc in self.delayed_calls:
dc.cancel()
if dc.active():
dc.cancel()
self.delayed_calls = []
def register_handler(self, alert_type, handler):
@ -115,12 +118,13 @@ class AlertManager(component.Component):
:param wait: bool, if True then the handler functions will be run right
away and waited to return before processing the next alert
"""
alert = self.session.pop_alert()
alerts = self.session.pop_alerts()
# Loop through all alerts in the queue
while alert is not None:
for alert in alerts:
alert_type = type(alert).__name__
# Display the alert message
log.debug("%s: %s", alert_type, alert.message())
if log.isEnabledFor(logging.DEBUG):
log.debug("%s: %s", alert_type, decode_string(alert.message()))
# Call any handlers for this alert type
if alert_type in self.handlers:
for handler in self.handlers[alert_type]:
@ -128,5 +132,3 @@ class AlertManager(component.Component):
self.delayed_calls.append(reactor.callLater(0, handler, alert))
else:
handler(alert)
alert = self.session.pop_alert()

View File

@ -2,6 +2,7 @@
# authmanager.py
#
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2011 Pedro Algarvio <pedro@algarvio.me>
#
# Deluge is free software.
#
@ -36,27 +37,56 @@
import os
import random
import stat
import shutil
import logging
import deluge.component as component
import deluge.configmanager as configmanager
import deluge.error
from deluge.common import (AUTH_LEVEL_ADMIN, AUTH_LEVEL_NONE, AUTH_LEVEL_NORMAL,
AUTH_LEVEL_READONLY, AUTH_LEVEL_DEFAULT,
create_localclient_account)
from deluge.log import LOG as log
from deluge.error import AuthManagerError, AuthenticationRequired, BadLoginError
AUTH_LEVEL_NONE = 0
AUTH_LEVEL_READONLY = 1
AUTH_LEVEL_NORMAL = 5
AUTH_LEVEL_ADMIN = 10
log = logging.getLogger(__name__)
AUTH_LEVEL_DEFAULT = AUTH_LEVEL_NORMAL
AUTH_LEVELS_MAPPING = {
'NONE': AUTH_LEVEL_NONE,
'READONLY': AUTH_LEVEL_READONLY,
'DEFAULT': AUTH_LEVEL_NORMAL,
'NORMAL': AUTH_LEVEL_DEFAULT,
'ADMIN': AUTH_LEVEL_ADMIN
}
AUTH_LEVELS_MAPPING_REVERSE = {}
for key, value in AUTH_LEVELS_MAPPING.iteritems():
AUTH_LEVELS_MAPPING_REVERSE[value] = key
class Account(object):
__slots__ = ('username', 'password', 'authlevel')
def __init__(self, username, password, authlevel):
self.username = username
self.password = password
self.authlevel = authlevel
def data(self):
return {
'username': self.username,
'password': self.password,
'authlevel': AUTH_LEVELS_MAPPING_REVERSE[self.authlevel],
'authlevel_int': self.authlevel
}
def __repr__(self):
return ('<Account username="%(username)s" authlevel=%(authlevel)s>' %
self.__dict__)
class BadLoginError(deluge.error.DelugeError):
pass
class AuthManager(component.Component):
def __init__(self):
component.Component.__init__(self, "AuthManager")
component.Component.__init__(self, "AuthManager", interval=10)
self.__auth = {}
self.__auth_modification_time = None
def start(self):
self.__load_auth_file()
@ -67,6 +97,19 @@ class AuthManager(component.Component):
def shutdown(self):
pass
def update(self):
auth_file = configmanager.get_config_dir("auth")
# Check for auth file and create if necessary
if not os.path.exists(auth_file):
log.info("Authfile not found, recreating it.")
self.__load_auth_file()
return
auth_file_modification_time = os.stat(auth_file).st_mtime
if self.__auth_modification_time != auth_file_modification_time:
log.info("Auth file changed, reloading it!")
self.__load_auth_file()
def authorize(self, username, password):
"""
Authorizes users based on username and password
@ -76,55 +119,127 @@ class AuthManager(component.Component):
:returns: int, the auth level for this user
:rtype: int
:raises BadLoginError: if the username does not exist or password does not match
:raises AuthenticationRequired: if aditional details are required to
authenticate.
:raises BadLoginError: if the username does not exist or password does
not match.
"""
if not username:
raise AuthenticationRequired(
"Username and Password are required.", username
)
if username not in self.__auth:
# Let's try to re-load the file.. Maybe it's been updated
self.__load_auth_file()
if username not in self.__auth:
raise BadLoginError("Username does not exist")
raise BadLoginError("Username does not exist", username)
if self.__auth[username][0] == password:
if self.__auth[username].password == password:
# Return the users auth level
return int(self.__auth[username][1])
return self.__auth[username].authlevel
elif not password and self.__auth[username].password:
raise AuthenticationRequired("Password is required", username)
else:
raise BadLoginError("Password does not match")
raise BadLoginError("Password does not match", username)
def __create_localclient_account(self):
def has_account(self, username):
return username in self.__auth
def get_known_accounts(self):
"""
Returns the string.
Returns a list of known deluge usernames.
"""
# We create a 'localclient' account with a random password
self.__load_auth_file()
return [account.data() for account in self.__auth.values()]
def create_account(self, username, password, authlevel):
if username in self.__auth:
raise AuthManagerError("Username in use.", username)
try:
from hashlib import sha1 as sha_hash
except ImportError:
from sha import new as sha_hash
return "localclient:" + sha_hash(str(random.random())).hexdigest() + ":" + str(AUTH_LEVEL_ADMIN) + "\n"
self.__auth[username] = Account(username, password,
AUTH_LEVELS_MAPPING[authlevel])
self.write_auth_file()
return True
except Exception, err:
log.exception(err)
raise err
def __load_auth_file(self):
auth_file = configmanager.get_config_dir("auth")
# Check for auth file and create if necessary
if not os.path.exists(auth_file):
localclient = self.__create_localclient_account()
fd = open(auth_file, "w")
fd.write(localclient)
def update_account(self, username, password, authlevel):
if username not in self.__auth:
raise AuthManagerError("Username not known", username)
try:
self.__auth[username].username = username
self.__auth[username].password = password
self.__auth[username].authlevel = AUTH_LEVELS_MAPPING[authlevel]
self.write_auth_file()
return True
except Exception, err:
log.exception(err)
raise err
def remove_account(self, username):
if username not in self.__auth:
raise AuthManagerError("Username not known", username)
elif username == component.get("RPCServer").get_session_user():
raise AuthManagerError(
"You cannot delete your own account while logged in!", username
)
del self.__auth[username]
self.write_auth_file()
return True
def write_auth_file(self):
old_auth_file = configmanager.get_config_dir("auth")
new_auth_file = old_auth_file + '.new'
bak_auth_file = old_auth_file + '.bak'
# Let's first create a backup
if os.path.exists(old_auth_file):
shutil.copy2(old_auth_file, bak_auth_file)
try:
fd = open(new_auth_file, "w")
for account in self.__auth.values():
fd.write(
"%(username)s:%(password)s:%(authlevel_int)s\n" %
account.data()
)
fd.flush()
os.fsync(fd.fileno())
fd.close()
# Change the permissions on the file so only this user can read/write it
os.chmod(auth_file, stat.S_IREAD | stat.S_IWRITE)
f = [localclient]
else:
# Load the auth file into a dictionary: {username: password, ...}
f = open(auth_file, "r").readlines()
os.rename(new_auth_file, old_auth_file)
except:
# Something failed, let's restore the previous file
if os.path.exists(bak_auth_file):
os.rename(bak_auth_file, old_auth_file)
self.__load_auth_file()
def __load_auth_file(self):
save_and_reload = False
auth_file = configmanager.get_config_dir("auth")
# Check for auth file and create if necessary
if not os.path.exists(auth_file):
create_localclient_account()
return self.__load_auth_file()
auth_file_modification_time = os.stat(auth_file).st_mtime
if self.__auth_modification_time is None:
self.__auth_modification_time = auth_file_modification_time
elif self.__auth_modification_time == auth_file_modification_time:
# File didn't change, no need for re-parsing's
return
# Load the auth file into a dictionary: {username: Account(...)}
f = open(auth_file, "r").readlines()
for line in f:
if line.startswith("#"):
# This is a comment line
continue
line = line.strip()
if line.startswith("#") or not line:
# This line is a comment or empty
continue
try:
lsplit = line.split(":")
except Exception, e:
@ -132,15 +247,43 @@ class AuthManager(component.Component):
continue
if len(lsplit) == 2:
username, password = lsplit
log.warning("Your auth entry for %s contains no auth level, using AUTH_LEVEL_DEFAULT(%s)..", username, AUTH_LEVEL_DEFAULT)
level = AUTH_LEVEL_DEFAULT
log.warning("Your auth entry for %s contains no auth level, "
"using AUTH_LEVEL_DEFAULT(%s)..", username,
AUTH_LEVEL_DEFAULT)
if username == 'localclient':
authlevel = AUTH_LEVEL_ADMIN
else:
authlevel = AUTH_LEVEL_DEFAULT
# This is probably an old auth file
save_and_reload = True
elif len(lsplit) == 3:
username, password, level = lsplit
username, password, authlevel = lsplit
else:
log.error("Your auth file is malformed: Incorrect number of fields!")
log.error("Your auth file is malformed: "
"Incorrect number of fields!")
continue
self.__auth[username.strip()] = (password.strip(), level)
username = username.strip()
password = password.strip()
try:
authlevel = int(authlevel)
except ValueError:
try:
authlevel = AUTH_LEVELS_MAPPING[authlevel]
except KeyError:
log.error("Your auth file is malformed: %r is not a valid auth "
"level" % authlevel)
continue
self.__auth[username] = Account(username, password, authlevel)
if "localclient" not in self.__auth:
open(auth_file, "a").write(self.__create_localclient_account())
create_localclient_account(True)
return self.__load_auth_file()
if save_and_reload:
log.info("Re-writing auth file (upgrade)")
self.write_auth_file()
self.__auth_modification_time = auth_file_modification_time

View File

@ -1,135 +0,0 @@
#
# autoadd.py
#
# Copyright (C) 2008 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may redistribute it and/or modify it under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# deluge 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 deluge. If not, write to:
# The Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA.
#
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the OpenSSL
# library.
# You must obey the GNU General Public License in all respects for all of
# the code used other than OpenSSL. If you modify file(s) with this
# exception, you may extend this exception to your version of the file(s),
# but you are not obligated to do so. If you do not wish to do so, delete
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.
#
#
import os
from deluge._libtorrent import lt
import deluge.component as component
from deluge.configmanager import ConfigManager
from deluge.log import LOG as log
MAX_NUM_ATTEMPTS = 10
class AutoAdd(component.Component):
def __init__(self):
component.Component.__init__(self, "AutoAdd", depend=["TorrentManager"], interval=5)
# Get the core config
self.config = ConfigManager("core.conf")
# A list of filenames
self.invalid_torrents = []
# Filename:Attempts
self.attempts = {}
# Register set functions
self.config.register_set_function("autoadd_enable",
self._on_autoadd_enable, apply_now=True)
self.config.register_set_function("autoadd_location",
self._on_autoadd_location)
def update(self):
if not self.config["autoadd_enable"]:
# We shouldn't be updating because autoadd is not enabled
component.pause("AutoAdd")
return
# Check the auto add folder for new torrents to add
if not os.path.isdir(self.config["autoadd_location"]):
log.warning("Invalid AutoAdd folder: %s", self.config["autoadd_location"])
component.pause("AutoAdd")
return
for filename in os.listdir(self.config["autoadd_location"]):
if filename.split(".")[-1] == "torrent":
try:
filepath = os.path.join(self.config["autoadd_location"], filename)
except UnicodeDecodeError, e:
log.error("Unable to auto add torrent due to inproper filename encoding: %s", e)
continue
try:
filedump = self.load_torrent(filepath)
except (RuntimeError, Exception), e:
# If the torrent is invalid, we keep track of it so that we
# can try again on the next pass. This is because some
# torrents may not be fully saved during the pass.
log.debug("Torrent is invalid: %s", e)
if filename in self.invalid_torrents:
self.attempts[filename] += 1
if self.attempts[filename] >= MAX_NUM_ATTEMPTS:
os.rename(filepath, filepath + ".invalid")
del self.attempts[filename]
self.invalid_torrents.remove(filename)
else:
self.invalid_torrents.append(filename)
self.attempts[filename] = 1
continue
# The torrent looks good, so lets add it to the session
component.get("TorrentManager").add(filedump=filedump, filename=filename)
os.remove(filepath)
def load_torrent(self, filename):
try:
log.debug("Attempting to open %s for add.", filename)
_file = open(filename, "rb")
filedump = _file.read()
if not filedump:
raise RuntimeError, "Torrent is 0 bytes!"
_file.close()
except IOError, e:
log.warning("Unable to open %s: %s", filename, e)
raise e
# Get the info to see if any exceptions are raised
info = lt.torrent_info(lt.bdecode(filedump))
return filedump
def _on_autoadd_enable(self, key, value):
log.debug("_on_autoadd_enable")
if value:
component.resume("AutoAdd")
else:
component.pause("AutoAdd")
def _on_autoadd_location(self, key, value):
log.debug("_on_autoadd_location")
# We need to resume the component just incase it was paused due to
# an invalid autoadd location.
if self.config["autoadd_enable"]:
component.resume("AutoAdd")

View File

@ -2,6 +2,7 @@
# core.py
#
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2011 Pedro Algarvio <pedro@algarvio.me>
#
# Deluge is free software.
#
@ -38,36 +39,34 @@ from deluge._libtorrent import lt
import os
import glob
import base64
import shutil
import logging
import threading
import pkg_resources
import warnings
import tempfile
from urlparse import urljoin
from twisted.internet import reactor, defer
from twisted.internet.task import LoopingCall
import twisted.web.client
import twisted.web.error
from deluge.httpdownloader import download_file
from deluge.log import LOG as log
import deluge.configmanager
import deluge.common
import deluge.component as component
from deluge.event import *
from deluge.error import *
from deluge.core.authmanager import AUTH_LEVEL_ADMIN, AUTH_LEVEL_NONE
from deluge.core.authmanager import AUTH_LEVELS_MAPPING, AUTH_LEVELS_MAPPING_REVERSE
from deluge.core.torrentmanager import TorrentManager
from deluge.core.pluginmanager import PluginManager
from deluge.core.alertmanager import AlertManager
from deluge.core.filtermanager import FilterManager
from deluge.core.preferencesmanager import PreferencesManager
from deluge.core.autoadd import AutoAdd
from deluge.core.authmanager import AuthManager
from deluge.core.eventmanager import EventManager
from deluge.core.rpcserver import export
log = logging.getLogger(__name__)
class Core(component.Component):
def __init__(self, listen_interface=None):
log.debug("Core init..")
@ -77,27 +76,41 @@ class Core(component.Component):
log.info("Starting libtorrent %s session..", lt.version)
# Create the client fingerprint
version = [int(value.split("-")[0]) for value in deluge.common.get_version().split(".")]
version = deluge.common.VersionSplit(deluge.common.get_version()).version
while len(version) < 4:
version.append(0)
self.session = lt.session(lt.fingerprint("DE", *version), flags=0)
# Note: All libtorrent python bindings to set plugins/extensions need to be disabled
# due to GIL issue. https://code.google.com/p/libtorrent/issues/detail?id=369
# Setting session flags to 1 enables all libtorrent default plugins
self.session = lt.session(lt.fingerprint("DE", *version), flags=1)
# Load the session state if available
self.__load_session_state()
# Set the user agent
self.settings = lt.session_settings()
self.settings.user_agent = "Deluge %s" % deluge.common.get_version()
self.settings.user_agent = "Deluge/%(deluge_version)s Libtorrent/%(lt_version)s" % \
{ 'deluge_version': deluge.common.get_version(),
'lt_version': self.get_libtorrent_version().rpartition(".")[0] }
# Increase the alert queue size so that alerts don't get lost
self.settings.alert_queue_size = 10000
# Set session settings
self.settings.send_redundant_have = True
if deluge.common.windows_check():
self.settings.disk_io_write_mode = \
lt.io_buffer_mode_t.disable_os_cache
self.settings.disk_io_read_mode = \
lt.io_buffer_mode_t.disable_os_cache
self.session.set_settings(self.settings)
# Load metadata extension
self.session.add_extension(lt.create_metadata_plugin)
self.session.add_extension(lt.create_ut_metadata_plugin)
self.session.add_extension(lt.create_smart_ban_plugin)
# Note: All libtorrent python bindings to set plugins/extensions need to be disabled
# due to GIL issue. https://code.google.com/p/libtorrent/issues/detail?id=369
# self.session.add_extension(lt.create_metadata_plugin)
# self.session.add_extension(lt.create_ut_metadata_plugin)
# self.session.add_extension(lt.create_smart_ban_plugin)
# Create the components
self.eventmanager = EventManager()
@ -106,7 +119,6 @@ class Core(component.Component):
self.pluginmanager = PluginManager(self)
self.torrentmanager = TorrentManager()
self.filtermanager = FilterManager(self)
self.autoadd = AutoAdd()
self.authmanager = AuthManager()
# New release check information
@ -114,6 +126,7 @@ class Core(component.Component):
# Get the core config
self.config = deluge.configmanager.ConfigManager("core.conf")
self.config.save()
# If there was an interface value from the command line, use it, but
# store the one in the config so we can restore it on shutdown
@ -128,9 +141,12 @@ class Core(component.Component):
self.__new_release = None
def stop(self):
log.debug("Core stopping...")
# Save the DHT state if necessary
if self.config["dht"]:
self.save_dht_state()
# Save the libtorrent session state
self.__save_session_state()
@ -147,16 +163,16 @@ class Core(component.Component):
def __save_session_state(self):
"""Saves the libtorrent session state"""
try:
open(deluge.configmanager.get_config_dir("session.state"), "wb").write(
lt.bencode(self.session.state()))
session_state = deluge.configmanager.get_config_dir("session.state")
open(session_state, "wb").write(lt.bencode(self.session.save_state()))
except Exception, e:
log.warning("Failed to save lt state: %s", e)
def __load_session_state(self):
"""Loads the libtorrent session state"""
try:
self.session.load_state(lt.bdecode(
open(deluge.configmanager.get_config_dir("session.state"), "rb").read()))
session_state = deluge.configmanager.get_config_dir("session.state")
self.session.load_state(lt.bdecode(open(session_state, "rb").read()))
except Exception, e:
log.warning("Failed to load lt state: %s", e)
@ -212,7 +228,9 @@ class Core(component.Component):
log.exception(e)
try:
torrent_id = self.torrentmanager.add(filedump=filedump, options=options, filename=filename)
torrent_id = self.torrentmanager.add(
filedump=filedump, options=options, filename=filename
)
except Exception, e:
log.error("There was an error adding the torrent file %s", filename)
log.exception(e)
@ -236,20 +254,44 @@ class Core(component.Component):
:returns: a Deferred which returns the torrent_id as a str or None
"""
log.info("Attempting to add url %s", url)
def on_get_file(filename):
def on_download_success(filename):
# We got the file, so add it to the session
data = open(filename, "rb").read()
return self.add_torrent_file(filename, base64.encodestring(data), options)
f = open(filename, "rb")
data = f.read()
f.close()
try:
os.remove(filename)
except Exception, e:
log.warning("Couldn't remove temp file: %s", e)
return self.add_torrent_file(
filename, base64.encodestring(data), options
)
def on_get_file_error(failure):
# Log the error and pass the failure onto the client
log.error("Error occured downloading torrent from %s", url)
log.error("Reason: %s", failure.getErrorMessage())
return failure
def on_download_fail(failure):
if failure.check(twisted.web.error.PageRedirect):
new_url = urljoin(url, failure.getErrorMessage().split(" to ")[1])
result = download_file(
new_url, tempfile.mkstemp()[1], headers=headers,
force_filename=True
)
result.addCallbacks(on_download_success, on_download_fail)
elif failure.check(twisted.web.client.PartialDownloadError):
result = download_file(
url, tempfile.mkstemp()[1], headers=headers,
force_filename=True, allow_compression=False
)
result.addCallbacks(on_download_success, on_download_fail)
else:
# Log the error and pass the failure onto the client
log.error("Error occured downloading torrent from %s", url)
log.error("Reason: %s", failure.getErrorMessage())
result = failure
return result
d = download_file(url, url.split("/")[-1], headers=headers)
d.addCallback(on_get_file)
d.addErrback(on_get_file_error)
d = download_file(
url, tempfile.mkstemp()[1], headers=headers, force_filename=True
)
d.addCallbacks(on_download_success, on_download_fail)
return d
@export
@ -384,16 +426,24 @@ class Core(component.Component):
for torrent_id in torrent_ids:
self.torrentmanager[torrent_id].resume()
def create_torrent_status(self, torrent_id, torrent_keys, plugin_keys, diff=False, update=False):
try:
status = self.torrentmanager[torrent_id].get_status(torrent_keys, diff, update=update)
except KeyError:
import traceback
traceback.print_exc()
# Torrent was probaly removed meanwhile
return {}
# Ask the plugin manager to fill in the plugin keys
if len(plugin_keys) > 0:
status.update(self.pluginmanager.get_status(torrent_id, plugin_keys))
return status
@export
def get_torrent_status(self, torrent_id, keys, diff=False):
# Build the status dictionary
status = self.torrentmanager[torrent_id].get_status(keys, diff)
# Get the leftover fields and ask the plugin manager to fill them
leftover_fields = list(set(keys) - set(status.keys()))
if len(leftover_fields) > 0:
status.update(self.pluginmanager.get_status(torrent_id, leftover_fields))
return status
torrent_keys, plugin_keys = self.torrentmanager.separate_keys(keys, [torrent_id])
return self.create_torrent_status(torrent_id, torrent_keys, plugin_keys, diff=diff, update=True)
@export
def get_torrents_status(self, filter_dict, keys, diff=False):
@ -402,12 +452,17 @@ class Core(component.Component):
"""
torrent_ids = self.filtermanager.filter_torrent_ids(filter_dict)
status_dict = {}.fromkeys(torrent_ids)
d = self.torrentmanager.torrents_status_update(torrent_ids, keys, diff=diff)
# Get the torrent status for each torrent_id
for torrent_id in torrent_ids:
status_dict[torrent_id] = self.get_torrent_status(torrent_id, keys, diff)
return status_dict
def add_plugin_fields(args):
status_dict, plugin_keys = args
# Ask the plugin manager to fill in the plugin keys
if len(plugin_keys) > 0:
for key in status_dict.keys():
status_dict[key].update(self.pluginmanager.get_status(key, plugin_keys))
return status_dict
d.addCallback(add_plugin_fields)
return d
@export
def get_filter_tree(self , show_zero_hits=True, hide_cat=None):
@ -454,7 +509,7 @@ class Core(component.Component):
"""Set the config with values from dictionary"""
# Load all the values into the configuration
for key in config.keys():
if isinstance(config[key], unicode) or isinstance(config[key], str):
if isinstance(config[key], basestring):
config[key] = config[key].encode("utf8")
self.config[key] = config[key]
@ -535,6 +590,11 @@ class Core(component.Component):
"""Sets a higher priority to the first and last pieces"""
return self.torrentmanager[torrent_id].set_prioritize_first_last(value)
@export
def set_torrent_sequential_download(self, torrent_id, value):
"""Toggle sequencial pieces download"""
return self.torrentmanager[torrent_id].set_sequential_download(value)
@export
def set_torrent_auto_managed(self, torrent_id, value):
"""Sets the auto managed flag for queueing purposes"""
@ -565,6 +625,32 @@ class Core(component.Component):
"""Sets the path for the torrent to be moved when completed"""
return self.torrentmanager[torrent_id].set_move_completed_path(value)
@export(AUTH_LEVEL_ADMIN)
def set_torrents_owner(self, torrent_ids, username):
"""Set's the torrent owner.
:param torrent_id: the torrent_id of the torrent to remove
:type torrent_id: string
:param username: the new owner username
:type username: string
:raises DelugeError: if the username is not known
"""
if not self.authmanager.has_account(username):
raise DelugeError("Username \"%s\" is not known." % username)
if isinstance(torrent_ids, basestring):
torrent_ids = [torrent_ids]
for torrent_id in torrent_ids:
self.torrentmanager[torrent_id].set_owner(username)
return None
@export
def set_torrents_shared(self, torrent_ids, shared):
if isinstance(torrent_ids, basestring):
torrent_ids = [torrent_ids]
for torrent_id in torrent_ids:
self.torrentmanager[torrent_id].set_options({"shared": shared})
@export
def get_path_size(self, path):
"""Returns the size of the file or folder 'path' and -1 if the path is
@ -679,7 +765,8 @@ class Core(component.Component):
@export
def queue_top(self, torrent_ids):
log.debug("Attempting to queue %s to top", torrent_ids)
for torrent_id in torrent_ids:
# torrent_ids must be sorted in reverse before moving to preserve order
for torrent_id in sorted(torrent_ids, key=self.torrentmanager.get_queue_position, reverse=True):
try:
# If the queue method returns True, then we should emit a signal
if self.torrentmanager.queue_top(torrent_id):
@ -690,35 +777,48 @@ class Core(component.Component):
@export
def queue_up(self, torrent_ids):
log.debug("Attempting to queue %s to up", torrent_ids)
torrents = ((self.torrentmanager.get_queue_position(torrent_id), torrent_id) for torrent_id in torrent_ids)
torrent_moved = True
prev_queue_position = None
#torrent_ids must be sorted before moving.
torrent_ids = list(torrent_ids)
torrent_ids.sort(key = lambda id: self.torrentmanager.torrents[id].get_queue_position())
for torrent_id in torrent_ids:
try:
# If the queue method returns True, then we should emit a signal
if self.torrentmanager.queue_up(torrent_id):
component.get("EventManager").emit(TorrentQueueChangedEvent())
except KeyError:
log.warning("torrent_id: %s does not exist in the queue", torrent_id)
for queue_position, torrent_id in sorted(torrents):
# Move the torrent if and only if there is space (by not moving it we preserve the order)
if torrent_moved or queue_position - prev_queue_position > 1:
try:
torrent_moved = self.torrentmanager.queue_up(torrent_id)
except KeyError:
log.warning("torrent_id: %s does not exist in the queue", torrent_id)
# If the torrent moved, then we should emit a signal
if torrent_moved:
component.get("EventManager").emit(TorrentQueueChangedEvent())
else:
prev_queue_position = queue_position
@export
def queue_down(self, torrent_ids):
log.debug("Attempting to queue %s to down", torrent_ids)
torrents = ((self.torrentmanager.get_queue_position(torrent_id), torrent_id) for torrent_id in torrent_ids)
torrent_moved = True
prev_queue_position = None
#torrent_ids must be sorted before moving.
torrent_ids = list(torrent_ids)
torrent_ids.sort(key = lambda id: -self.torrentmanager.torrents[id].get_queue_position())
for torrent_id in torrent_ids:
try:
# If the queue method returns True, then we should emit a signal
if self.torrentmanager.queue_down(torrent_id):
component.get("EventManager").emit(TorrentQueueChangedEvent())
except KeyError:
log.warning("torrent_id: %s does not exist in the queue", torrent_id)
for queue_position, torrent_id in sorted(torrents, reverse=True):
# Move the torrent if and only if there is space (by not moving it we preserve the order)
if torrent_moved or prev_queue_position - queue_position > 1:
try:
torrent_moved = self.torrentmanager.queue_down(torrent_id)
except KeyError:
log.warning("torrent_id: %s does not exist in the queue", torrent_id)
# If the torrent moved, then we should emit a signal
if torrent_moved:
component.get("EventManager").emit(TorrentQueueChangedEvent())
else:
prev_queue_position = queue_position
@export
def queue_bottom(self, torrent_ids):
log.debug("Attempting to queue %s to bottom", torrent_ids)
for torrent_id in torrent_ids:
# torrent_ids must be sorted before moving to preserve order
for torrent_id in sorted(torrent_ids, key=self.torrentmanager.get_queue_position):
try:
# If the queue method returns True, then we should emit a signal
if self.torrentmanager.queue_bottom(torrent_id):
@ -747,7 +847,11 @@ class Core(component.Component):
def on_get_page(result):
return bool(int(result))
def logError(failure):
log.warning("Error testing listen port: %s", failure)
d.addCallback(on_get_page)
d.addErrback(logError)
return d
@ -768,7 +872,10 @@ class Core(component.Component):
"""
if not path:
path = self.config["download_location"]
return deluge.common.free_space(path)
try:
return deluge.common.free_space(path)
except InvalidPathError:
return 0
@export
def get_libtorrent_version(self):
@ -780,3 +887,23 @@ class Core(component.Component):
"""
return lt.version
@export(AUTH_LEVEL_ADMIN)
def get_known_accounts(self):
return self.authmanager.get_known_accounts()
@export(AUTH_LEVEL_NONE)
def get_auth_levels_mappings(self):
return (AUTH_LEVELS_MAPPING, AUTH_LEVELS_MAPPING_REVERSE)
@export(AUTH_LEVEL_ADMIN)
def create_account(self, username, password, authlevel):
return self.authmanager.create_account(username, password, authlevel)
@export(AUTH_LEVEL_ADMIN)
def update_account(self, username, password, authlevel):
return self.authmanager.update_account(username, password, authlevel)
@export(AUTH_LEVEL_ADMIN)
def remove_account(self, username):
return self.authmanager.remove_account(username)

View File

@ -33,9 +33,7 @@
#
import os
import gettext
import locale
import pkg_resources
import logging
from twisted.internet import reactor
import twisted.internet.error
@ -43,16 +41,19 @@ import deluge.component as component
import deluge.configmanager
import deluge.common
from deluge.core.rpcserver import RPCServer, export
from deluge.log import LOG as log
import deluge.error
log = logging.getLogger(__name__)
class Daemon(object):
def __init__(self, options=None, args=None, classic=False):
# Check for another running instance of the daemon
if os.path.isfile(deluge.configmanager.get_config_dir("deluged.pid")):
# Get the PID and the port of the supposedly running daemon
try:
(pid, port) = open(deluge.configmanager.get_config_dir("deluged.pid")).read().strip().split(";")
(pid, port) = open(
deluge.configmanager.get_config_dir("deluged.pid")
).read().strip().split(";")
pid = int(pid)
port = int(port)
except ValueError:
@ -62,13 +63,8 @@ class Daemon(object):
def process_running(pid):
if deluge.common.windows_check():
# Do some fancy WMI junk to see if the PID exists in Windows
from win32com.client import GetObject
def get_proclist():
WMI = GetObject('winmgmts:')
processes = WMI.InstancesOf('Win32_Process')
return [process.Properties_('ProcessID').Value for process in processes]
return pid in get_proclist()
import win32process
return pid in win32process.EnumProcesses()
else:
# We can just use os.kill on UNIX to test if the process is running
try:
@ -91,26 +87,14 @@ class Daemon(object):
else:
# This is a deluged!
s.close()
raise deluge.error.DaemonRunningError("There is a deluge daemon running with this config directory!")
# Initialize gettext
try:
locale.setlocale(locale.LC_ALL, '')
if hasattr(locale, "bindtextdomain"):
locale.bindtextdomain("deluge", pkg_resources.resource_filename("deluge", "i18n"))
if hasattr(locale, "textdomain"):
locale.textdomain("deluge")
gettext.bindtextdomain("deluge", pkg_resources.resource_filename("deluge", "i18n"))
gettext.textdomain("deluge")
gettext.install("deluge", pkg_resources.resource_filename("deluge", "i18n"))
except Exception, e:
log.error("Unable to initialize gettext/locale: %s", e)
import __builtin__
__builtin__.__dict__["_"] = lambda x: x
raise deluge.error.DaemonRunningError(
"There is a deluge daemon running with this config "
"directory!"
)
# Twisted catches signals to terminate, so just have it call the shutdown
# method.
reactor.addSystemEventTrigger("after", "shutdown", self.shutdown)
reactor.addSystemEventTrigger("before", "shutdown", self._shutdown)
# Catch some Windows specific signals
if deluge.common.windows_check():
@ -120,7 +104,7 @@ class Daemon(object):
def win_handler(ctrl_type):
log.debug("ctrl_type: %s", ctrl_type)
if ctrl_type == CTRL_CLOSE_EVENT or ctrl_type == CTRL_SHUTDOWN_EVENT:
self.__shutdown()
self._shutdown()
return 1
SetConsoleCtrlHandler(win_handler)
@ -133,9 +117,14 @@ class Daemon(object):
if options and options.config:
deluge.configmanager.set_config_dir(options.config)
if options and options.listen_interface:
listen_interface = options.listen_interface
else:
listen_interface = ""
from deluge.core.core import Core
# Start the core as a thread and join it until it's done
self.core = Core()
self.core = Core(listen_interface=listen_interface)
port = self.core.config["daemon_port"]
if options and options.port:
@ -177,26 +166,16 @@ class Daemon(object):
reactor.callLater(0, reactor.stop)
def _shutdown(self, *args, **kwargs):
try:
os.remove(deluge.configmanager.get_config_dir("deluged.pid"))
except Exception, e:
log.exception(e)
log.error("Error removing deluged.pid!")
if os.path.exists(deluge.configmanager.get_config_dir("deluged.pid")):
try:
os.remove(deluge.configmanager.get_config_dir("deluged.pid"))
except Exception, e:
log.exception(e)
log.error("Error removing deluged.pid!")
component.shutdown()
try:
reactor.stop()
except twisted.internet.error.ReactorNotRunning:
log.debug("Tried to stop the reactor but it is not running..")
@export()
def info(self):
"""
Returns some info from the daemon.
:returns: str, the version number
"""
return deluge.common.get_version()
log.info("Waiting for components to shutdown..")
d = component.shutdown()
return d
@export()
def get_method_list(self):
@ -204,3 +183,18 @@ class Daemon(object):
Returns a list of the exported methods.
"""
return self.rpcserver.get_method_list()
@export(1)
def authorized_call(self, rpc):
"""
Returns True if authorized to call rpc.
:param rpc: a rpc, eg, "core.get_torrents_status"
:type rpc: string
"""
if not rpc in self.get_method_list():
return False
auth_level = self.rpcserver.get_session_auth_level()
return auth_level >= self.rpcserver.get_rpc_auth_level()

View File

@ -33,8 +33,10 @@
#
#
import logging
import deluge.component as component
from deluge.log import LOG as log
log = logging.getLogger(__name__)
class EventManager(component.Component):
def __init__(self):
@ -53,7 +55,10 @@ class EventManager(component.Component):
if event.name in self.handlers:
for handler in self.handlers[event.name]:
#log.debug("Running handler %s for event %s with args: %s", event.name, handler, event.args)
handler(*event.args)
try:
handler(*event.args)
except Exception, e:
log.error("Event handler %s failed in %s with exception %s", event.name, handler, e)
def register_event_handler(self, event, handler):
"""

View File

@ -33,12 +33,13 @@
#
#
import logging
import deluge.component as component
from deluge.log import LOG as log
STATE_SORT = ["All", "Downloading", "Seeding", "Active", "Paused", "Queued"]
log = logging.getLogger(__name__)
#special purpose filters:
def filter_keywords(torrent_ids, values):
#cleanup.
@ -77,6 +78,27 @@ def filter_one_keyword(torrent_ids, keyword):
yield torrent_id
break
def filter_by_name(torrent_ids, search_string):
all_torrents = component.get("TorrentManager").torrents
try:
search_string, match_case = search_string[0].split('::match')
except ValueError:
search_string = search_string[0]
match_case = False
if match_case is False:
search_string = search_string.lower()
for torrent_id in torrent_ids:
torrent_name = all_torrents[torrent_id].get_name()
if match_case is False:
torrent_name = all_torrents[torrent_id].get_name().lower()
else:
torrent_name = all_torrents[torrent_id].get_name()
if search_string in torrent_name:
yield torrent_id
def tracker_error_filter(torrent_ids, values):
filtered_torrent_ids = []
tm = component.get("TorrentManager")
@ -91,9 +113,8 @@ def tracker_error_filter(torrent_ids, values):
# Check all the torrent's tracker_status for 'Error:' and only return torrent_ids
# that have this substring in their tracker_status
for torrent_id in torrent_ids:
if "Error:" in tm[torrent_id].get_status(["tracker_status"])["tracker_status"]:
if _("Error") + ":" in tm[torrent_id].get_status(["tracker_host"])["tracker_host"]:
filtered_torrent_ids.append(torrent_id)
return filtered_torrent_ids
class FilterManager(component.Component):
@ -107,6 +128,7 @@ class FilterManager(component.Component):
self.torrents = core.torrentmanager
self.registered_filters = {}
self.register_filter("keyword", filter_keywords)
self.register_filter("name", filter_by_name)
self.tree_fields = {}
self.register_tree_field("state", self._init_state_tree)
@ -116,6 +138,10 @@ class FilterManager(component.Component):
self.register_filter("tracker_host", tracker_error_filter)
def _init_users_tree():
return {"": 0}
self.register_tree_field("owner", _init_users_tree)
def filter_torrent_ids(self, filter_dict):
"""
returns a list of torrent_id's matching filter_dict.
@ -126,12 +152,11 @@ class FilterManager(component.Component):
#sanitize input: filter-value must be a list of strings
for key, value in filter_dict.items():
if isinstance(value, str):
filter_dict[key] = [value]
if isinstance(value, basestring):
filter_dict[key] = [value]
if "id"in filter_dict: #optimized filter for id:
torrent_ids = filter_dict["id"]
torrent_ids = list(filter_dict["id"])
del filter_dict["id"]
else:
torrent_ids = self.torrents.get_torrent_list()
@ -166,13 +191,11 @@ class FilterManager(component.Component):
#leftover filter arguments:
#default filter on status fields.
status_func = self.core.get_torrent_status #premature optimalisation..
for torrent_id in list(torrent_ids):
status = status_func(torrent_id, filter_dict.keys()) #status={key:value}
status = self.torrents[torrent_id].get_status(filter_dict.keys()) #status={key:value}
for field, values in filter_dict.iteritems():
if (not status[field] in values) and torrent_id in torrent_ids:
torrent_ids.remove(torrent_id)
return torrent_ids
def get_filter_tree(self, show_zero_hits=True, hide_cat=None):
@ -181,24 +204,22 @@ class FilterManager(component.Component):
for use in sidebar.
"""
torrent_ids = self.torrents.get_torrent_list()
status_func = self.core.get_torrent_status #premature optimalisation..
tree_keys = list(self.tree_fields.keys())
if hide_cat:
for cat in hide_cat:
tree_keys.remove(cat)
items = dict( (field, self.tree_fields[field]()) for field in tree_keys)
torrent_keys, plugin_keys = self.torrents.separate_keys(tree_keys, torrent_ids)
items = dict((field, self.tree_fields[field]()) for field in tree_keys)
#count status fields.
for torrent_id in list(torrent_ids):
status = status_func(torrent_id, tree_keys) #status={key:value}
status = self.core.create_torrent_status(torrent_id, torrent_keys, plugin_keys) #status={key:value}
for field in tree_keys:
value = status[field]
items[field][value] = items[field].get(value, 0) + 1
items["tracker_host"]["All"] = len(torrent_ids)
if "tracker_host" in items:
items["tracker_host"]["All"] = len(torrent_ids)
items["tracker_host"]["Error"] = len(tracker_error_filter(torrent_ids, ("Error",)))
if "state" in tree_keys and not show_zero_hits:
@ -239,9 +260,8 @@ class FilterManager(component.Component):
del self.tree_fields[field]
def filter_state_active(self, torrent_ids):
get_status = self.core.get_torrent_status
for torrent_id in list(torrent_ids):
status = get_status(torrent_id, ["download_payload_rate", "upload_payload_rate"])
status = self.torrents[torrent_id].get_status(["download_payload_rate", "upload_payload_rate"])
if status["download_payload_rate"] or status["upload_payload_rate"]:
pass #ok
else:

View File

@ -39,12 +39,14 @@ import os.path
import pickle
import cPickle
import shutil
import logging
from deluge._libtorrent import lt
from deluge.configmanager import ConfigManager, get_config_dir
import deluge.core.torrentmanager
from deluge.log import LOG as log
log = logging.getLogger(__name__)
#start : http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286203
def makeFakeClass(module, name):

View File

@ -36,13 +36,13 @@
"""PluginManager for Core"""
from twisted.internet import reactor
from twisted.internet.task import LoopingCall
import logging
from deluge.event import PluginEnabledEvent, PluginDisabledEvent
import deluge.pluginmanagerbase
import deluge.component as component
from deluge.log import LOG as log
log = logging.getLogger(__name__)
class PluginManager(deluge.pluginmanagerbase.PluginManagerBase,
component.Component):

View File

@ -1,7 +1,7 @@
#
# preferencesmanager.py
#
# Copyright (C) 2008 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2008-2010 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
@ -34,10 +34,9 @@
#
import os.path
import os
import logging
import threading
import pkg_resources
from twisted.internet import reactor
from twisted.internet.task import LoopingCall
from deluge._libtorrent import lt
@ -46,7 +45,8 @@ from deluge.event import *
import deluge.configmanager
import deluge.common
import deluge.component as component
from deluge.log import LOG as log
log = logging.getLogger(__name__)
DEFAULT_PREFS = {
"send_info": False,
@ -62,6 +62,7 @@ DEFAULT_PREFS = {
"torrentfiles_location": deluge.common.get_default_download_dir(),
"plugins_location": os.path.join(deluge.configmanager.get_config_dir(), "plugins"),
"prioritize_first_last_pieces": False,
"sequential_download": False,
"random_port": True,
"dht": True,
"upnp": True,
@ -85,8 +86,6 @@ DEFAULT_PREFS = {
"max_upload_speed_per_torrent": -1,
"max_download_speed_per_torrent": -1,
"enabled_plugins": [],
"autoadd_location": deluge.common.get_default_download_dir(),
"autoadd_enable": False,
"add_paused": False,
"max_active_seeding": 5,
"max_active_downloading": 3,
@ -140,7 +139,9 @@ DEFAULT_PREFS = {
"rate_limit_ip_overhead": True,
"geoip_db_location": "/usr/share/GeoIP/GeoIP.dat",
"cache_size": 512,
"cache_expiry": 60
"cache_expiry": 60,
"auto_manage_prefer_seeds": False,
"shared": False
}
class PreferencesManager(component.Component):
@ -148,92 +149,40 @@ class PreferencesManager(component.Component):
component.Component.__init__(self, "PreferencesManager")
self.config = deluge.configmanager.ConfigManager("core.conf", DEFAULT_PREFS)
if 'public' in self.config:
log.debug("Updating configuration file: Renamed torrent's public "
"attribute to shared.")
self.config["shared"] = self.config["public"]
del self.config["public"]
def start(self):
self.core = component.get("Core")
self.session = component.get("Core").session
self.settings = component.get("Core").settings
# Register set functions in the Config
self.config.register_set_function("torrentfiles_location",
self._on_set_torrentfiles_location)
self.config.register_set_function("listen_ports",
self._on_set_listen_ports)
self.config.register_set_function("listen_interface",
self._on_set_listen_interface)
self.config.register_set_function("random_port",
self._on_set_random_port)
self.config.register_set_function("outgoing_ports",
self._on_set_outgoing_ports)
self.config.register_set_function("random_outgoing_ports",
self._on_set_random_outgoing_ports)
self.config.register_set_function("peer_tos",
self._on_set_peer_tos)
self.config.register_set_function("dht", self._on_set_dht)
self.config.register_set_function("upnp", self._on_set_upnp)
self.config.register_set_function("natpmp", self._on_set_natpmp)
self.config.register_set_function("utpex", self._on_set_utpex)
self.config.register_set_function("lsd", self._on_set_lsd)
self.config.register_set_function("enc_in_policy",
self._on_set_encryption)
self.config.register_set_function("enc_out_policy",
self._on_set_encryption)
self.config.register_set_function("enc_level",
self._on_set_encryption)
self.config.register_set_function("enc_prefer_rc4",
self._on_set_encryption)
self.config.register_set_function("max_connections_global",
self._on_set_max_connections_global)
self.config.register_set_function("max_upload_speed",
self._on_set_max_upload_speed)
self.config.register_set_function("max_download_speed",
self._on_set_max_download_speed)
self.config.register_set_function("max_upload_slots_global",
self._on_set_max_upload_slots_global)
self.config.register_set_function("max_half_open_connections",
self._on_set_max_half_open_connections)
self.config.register_set_function("max_connections_per_second",
self._on_set_max_connections_per_second)
self.config.register_set_function("ignore_limits_on_local_network",
self._on_ignore_limits_on_local_network)
self.config.register_set_function("share_ratio_limit",
self._on_set_share_ratio_limit)
self.config.register_set_function("seed_time_ratio_limit",
self._on_set_seed_time_ratio_limit)
self.config.register_set_function("seed_time_limit",
self._on_set_seed_time_limit)
self.config.register_set_function("max_active_downloading",
self._on_set_max_active_downloading)
self.config.register_set_function("max_active_seeding",
self._on_set_max_active_seeding)
self.config.register_set_function("max_active_limit",
self._on_set_max_active_limit)
self.config.register_set_function("dont_count_slow_torrents",
self._on_set_dont_count_slow_torrents)
self.config.register_set_function("send_info",
self._on_send_info)
self.config.register_set_function("proxies",
self._on_set_proxies)
self.new_release_timer = None
self.config.register_set_function("new_release_check",
self._on_new_release_check)
self.config.register_set_function("rate_limit_ip_overhead",
self._on_rate_limit_ip_overhead)
self.config.register_set_function("geoip_db_location",
self._on_geoip_db_location)
self.config.register_set_function("cache_size",
self._on_cache_size)
self.config.register_set_function("cache_expiry",
self._on_cache_expiry)
# Set the initial preferences on start-up
for key in DEFAULT_PREFS:
self.do_config_set_func(key, self.config[key])
self.config.register_change_callback(self._on_config_value_change)
def stop(self):
if self.new_release_timer:
if self.new_release_timer and self.new_release_timer.running:
self.new_release_timer.stop()
# Config set functions
def do_config_set_func(self, key, value):
on_set_func = getattr(self, "_on_set_" + key, None)
if on_set_func:
on_set_func(key, value)
def session_set_setting(self, key, value):
settings = self.session.settings()
setattr(settings, key, value)
self.session.set_settings(settings)
def _on_config_value_change(self, key, value):
self.do_config_set_func(key, value)
component.get("EventManager").emit(ConfigValueChangedEvent(key, value))
def _on_set_torrentfiles_location(self, key, value):
@ -247,7 +196,9 @@ class PreferencesManager(component.Component):
# Only set the listen ports if random_port is not true
if self.config["random_port"] is not True:
log.debug("listen port range set to %s-%s", value[0], value[1])
self.session.listen_on(value[0], value[1], str(self.config["listen_interface"]))
self.session.listen_on(
value[0], value[1], str(self.config["listen_interface"])
)
def _on_set_listen_interface(self, key, value):
# Call the random_port callback since it'll do what we need
@ -269,13 +220,15 @@ class PreferencesManager(component.Component):
# Set the listen ports
log.debug("listen port range set to %s-%s", listen_ports[0],
listen_ports[1])
self.session.listen_on(listen_ports[0], listen_ports[1], str(self.config["listen_interface"]))
self.session.listen_on(
listen_ports[0], listen_ports[1],
str(self.config["listen_interface"])
)
def _on_set_outgoing_ports(self, key, value):
if not self.config["random_outgoing_ports"]:
log.debug("outgoing port range set to %s-%s", value[0], value[1])
self.settings.outgoing_ports = value[0], value[1]
self.session.set_settings(self.settings)
self.session_set_setting("outgoing_ports", (value[0], value[1]))
def _on_set_random_outgoing_ports(self, key, value):
if value:
@ -284,13 +237,11 @@ class PreferencesManager(component.Component):
def _on_set_peer_tos(self, key, value):
log.debug("setting peer_tos to: %s", value)
try:
self.settings.peer_tos = chr(int(value, 16))
self.session_set_setting("peer_tos", chr(int(value, 16)))
except ValueError, e:
log.debug("Invalid tos byte: %s", e)
return
self.session.set_settings(self.settings)
def _on_set_dht(self, key, value):
log.debug("dht value set to %s", value)
state_file = deluge.configmanager.get_config_dir("dht.state")
@ -337,7 +288,22 @@ class PreferencesManager(component.Component):
def _on_set_utpex(self, key, value):
log.debug("utpex value set to %s", value)
if value:
self.session.add_extension(lt.create_ut_pex_plugin)
# Note: All libtorrent python bindings to set plugins/extensions need to be disabled
# due to GIL issue. https://code.google.com/p/libtorrent/issues/detail?id=369
#self.session.add_extension(lt.create_ut_pex_plugin)
pass
def _on_set_enc_in_policy(self, key, value):
self._on_set_encryption(key, value)
def _on_set_enc_out_policy(self, key, value):
self._on_set_encryption(key, value)
def _on_set_enc_level(self, key, value):
self._on_set_encryption(key, value)
def _on_set_enc_prefer_rc4(self, key, value):
self._on_set_encryption(key, value)
def _on_set_encryption(self, key, value):
log.debug("encryption value %s set to %s..", key, value)
@ -387,53 +353,41 @@ class PreferencesManager(component.Component):
self.session.set_max_half_open_connections(value)
def _on_set_max_connections_per_second(self, key, value):
self.settings.connection_speed = value
self.session.set_settings(self.settings)
self.session_set_setting("connection_speed", value)
def _on_ignore_limits_on_local_network(self, key, value):
self.settings.ignore_limits_on_local_network = value
self.session.set_settings(self.settings)
def _on_set_ignore_limits_on_local_network(self, key, value):
self.session_set_setting("ignore_limits_on_local_network", value)
def _on_set_share_ratio_limit(self, key, value):
log.debug("%s set to %s..", key, value)
self.settings.share_ratio_limit = value
self.session.set_settings(self.settings)
self.session_set_setting("share_ratio_limit", value)
def _on_set_seed_time_ratio_limit(self, key, value):
log.debug("%s set to %s..", key, value)
self.settings.seed_time_ratio_limit = value
self.session.set_settings(self.settings)
self.session_set_setting("seed_time_ratio_limit", value)
def _on_set_seed_time_limit(self, key, value):
log.debug("%s set to %s..", key, value)
# This value is stored in minutes in deluge, but libtorrent wants seconds
self.settings.seed_time_limit = int(value * 60)
self.session.set_settings(self.settings)
self.session_set_setting("seed_time_limit", int(value * 60))
def _on_set_max_active_downloading(self, key, value):
log.debug("%s set to %s..", key, value)
log.debug("active_downloads: %s", self.settings.active_downloads)
self.settings.active_downloads = value
self.session.set_settings(self.settings)
self.session_set_setting("active_downloads", value)
def _on_set_max_active_seeding(self, key, value):
log.debug("%s set to %s..", key, value)
log.debug("active_seeds: %s", self.settings.active_seeds)
self.settings.active_seeds = value
self.session.set_settings(self.settings)
self.session_set_setting("active_seeds", value)
def _on_set_max_active_limit(self, key, value):
log.debug("%s set to %s..", key, value)
log.debug("active_limit: %s", self.settings.active_limit)
self.settings.active_limit = value
self.session.set_settings(self.settings)
self.session_set_setting("active_limit", value)
def _on_set_dont_count_slow_torrents(self, key, value):
log.debug("%s set to %s..", key, value)
self.settings.dont_count_slow_torrents = value
self.session.set_settings(self.settings)
self.session_set_setting("dont_count_slow_torrents", value)
def _on_send_info(self, key, value):
def _on_set_send_info(self, key, value):
log.debug("Sending anonymous stats..")
"""sends anonymous stats home"""
class Send_Info_Thread(threading.Thread):
@ -463,18 +417,18 @@ class PreferencesManager(component.Component):
if value:
Send_Info_Thread(self.config).start()
def _on_new_release_check(self, key, value):
def _on_set_new_release_check(self, key, value):
if value:
log.debug("Checking for new release..")
threading.Thread(target=self.core.get_new_release).start()
if self.new_release_timer:
if self.new_release_timer and self.new_release_timer.running:
self.new_release_timer.stop()
# Set a timer to check for a new release every 3 days
self.new_release_timer = LoopingCall(
self._on_new_release_check, "new_release_check", True)
self._on_set_new_release_check, "new_release_check", True)
self.new_release_timer.start(72 * 60 * 60, False)
else:
if self.new_release_timer:
if self.new_release_timer and self.new_release_timer.running:
self.new_release_timer.stop()
def _on_set_proxies(self, key, value):
@ -489,19 +443,20 @@ class PreferencesManager(component.Component):
log.debug("setting %s proxy settings", k)
getattr(self.session, "set_%s_proxy" % k)(proxy_settings)
def _on_rate_limit_ip_overhead(self, key, value):
def _on_set_rate_limit_ip_overhead(self, key, value):
log.debug("%s: %s", key, value)
self.settings.rate_limit_ip_overhead = value
self.session.set_settings(self.settings)
self.session_set_setting("rate_limit_ip_overhead", value)
def _on_geoip_db_location(self, key, value):
def _on_set_geoip_db_location(self, key, value):
log.debug("%s: %s", key, value)
# Load the GeoIP DB for country look-ups if available
geoip_db = ""
if os.path.exists(value):
geoip_db = value
elif os.path.exists(pkg_resources.resource_filename("deluge", os.path.join("data", "GeoIP.dat"))):
geoip_db = pkg_resources.resource_filename("deluge", os.path.join("data", "GeoIP.dat"))
elif os.path.exists(deluge.common.resource_filename("deluge", os.path.join("data", "GeoIP.dat"))):
geoip_db = deluge.common.resource_filename(
"deluge", os.path.join("data", "GeoIP.dat")
)
else:
log.warning("Unable to find GeoIP database file!")
@ -512,12 +467,14 @@ class PreferencesManager(component.Component):
log.error("Unable to load geoip database!")
log.exception(e)
def _on_cache_size(self, key, value):
def _on_set_cache_size(self, key, value):
log.debug("%s: %s", key, value)
self.settings.cache_size = value
self.session.set_settings(self.settings)
self.session_set_setting("cache_size", value)
def _on_cache_expiry(self, key, value):
def _on_set_cache_expiry(self, key, value):
log.debug("%s: %s", key, value)
self.settings.cache_expiry = value
self.session.set_settings(self.settings)
self.session_set_setting("cache_expiry", value)
def _on_auto_manage_prefer_seeds(self, key, value):
log.debug("%s set to %s..", key, value)
self.session_set_setting("auto_manage_prefer_seeds", value)

View File

@ -39,25 +39,35 @@ import sys
import zlib
import os
import stat
import logging
import traceback
from twisted.internet.protocol import Factory, Protocol
from twisted.internet import ssl, reactor, defer
from twisted.internet import reactor, defer
from OpenSSL import crypto, SSL
from types import FunctionType
import deluge.rencode as rencode
from deluge.log import LOG as log
try:
import rencode
except ImportError:
import deluge.rencode as rencode
import deluge.component as component
import deluge.configmanager
from deluge.core.authmanager import AUTH_LEVEL_NONE, AUTH_LEVEL_DEFAULT
from deluge.core.authmanager import (AUTH_LEVEL_NONE, AUTH_LEVEL_DEFAULT,
AUTH_LEVEL_ADMIN)
from deluge.error import (DelugeError, NotAuthorizedError, WrappedException,
_ClientSideRecreateError, IncompatibleClient)
from deluge.transfer import DelugeTransferProtocol
RPC_RESPONSE = 1
RPC_ERROR = 2
RPC_EVENT = 3
log = logging.getLogger(__name__)
def export(auth_level=AUTH_LEVEL_DEFAULT):
"""
Decorator function to register an object's method as an RPC. The object
@ -90,13 +100,13 @@ def export(auth_level=AUTH_LEVEL_DEFAULT):
def format_request(call):
"""
Format the RPCRequest message for debug printing
:param call: the request
:type call: a RPCRequest
:returns: a formatted string for printing
:rtype: str
"""
try:
s = call[1] + "("
@ -111,12 +121,6 @@ def format_request(call):
return "UnicodeEncodeError, call: %s" % call
else:
return s
class DelugeError(Exception):
pass
class NotAuthorizedError(DelugeError):
pass
class ServerContextFactory(object):
def getContext(self):
@ -132,53 +136,34 @@ class ServerContextFactory(object):
ctx.use_privatekey_file(os.path.join(ssl_dir, "daemon.pkey"))
return ctx
class DelugeRPCProtocol(Protocol):
__buffer = None
class DelugeRPCProtocol(DelugeTransferProtocol):
def dataReceived(self, data):
def message_received(self, request):
"""
This method is called whenever data is received from a client. The
This method is called whenever a message is received from a client. The
only message that a client sends to the server is a RPC Request message.
If the RPC Request message is valid, then the method is called in
If the RPC Request message is valid, then the method is called in
:meth:`dispatch`.
:param data: the data from the client. It should be a zlib compressed
rencoded string.
:type data: str
:param request: the request from the client.
:type data: tuple
"""
if self.__buffer:
# We have some data from the last dataReceived() so lets prepend it
data = self.__buffer + data
self.__buffer = None
if type(request) is not tuple:
log.debug("Received invalid message: type is not tuple")
return
while data:
dobj = zlib.decompressobj()
try:
request = rencode.loads(dobj.decompress(data))
except Exception, e:
#log.debug("Received possible invalid message (%r): %s", data, e)
# This could be cut-off data, so we'll save this in the buffer
# and try to prepend it on the next dataReceived()
self.__buffer = data
return
else:
data = dobj.unused_data
if len(request) < 1:
log.debug("Received invalid message: there are no items")
return
if type(request) is not tuple:
log.debug("Received invalid message: type is not tuple")
return
if len(request) < 1:
log.debug("Received invalid message: there are no items")
return
for call in request:
if len(call) != 4:
log.debug("Received invalid rpc request: number of items in request is %s", len(call))
continue
#log.debug("RPCRequest: %s", format_request(call))
reactor.callLater(0, self.dispatch, *call)
for call in request:
if len(call) != 4:
log.debug("Received invalid rpc request: number of items "
"in request is %s", len(call))
continue
#log.debug("RPCRequest: %s", format_request(call))
reactor.callLater(0, self.dispatch, *call)
def sendData(self, data):
"""
@ -187,16 +172,17 @@ class DelugeRPCProtocol(Protocol):
:param data: the object that is to be sent to the client. This should
be one of the RPC message types.
:type data: object
"""
self.transport.write(zlib.compress(rencode.dumps(data)))
self.transfer_message(data)
def connectionMade(self):
"""
This method is called when a new client connects.
"""
peer = self.transport.getPeer()
log.info("Deluge Client connection made from: %s:%s", peer.host, peer.port)
log.info("Deluge Client connection made from: %s:%s",
peer.host, peer.port)
# Set the initial auth level of this session to AUTH_LEVEL_NONE
self.factory.authorized_sessions[self.transport.sessionno] = AUTH_LEVEL_NONE
@ -218,6 +204,9 @@ class DelugeRPCProtocol(Protocol):
log.info("Deluge client disconnected: %s", reason.value)
def valid_session(self):
return self.transport.sessionno in self.factory.authorized_sessions
def dispatch(self, request_id, method, args, kwargs):
"""
This method is run when a RPC Request is made. It will run the local method
@ -239,33 +228,55 @@ class DelugeRPCProtocol(Protocol):
Sends an error response with the contents of the exception that was raised.
"""
exceptionType, exceptionValue, exceptionTraceback = sys.exc_info()
formated_tb = "".join(traceback.format_tb(exceptionTraceback))
try:
self.sendData((
RPC_ERROR,
request_id,
exceptionType.__name__,
exceptionValue._args,
exceptionValue._kwargs,
formated_tb
))
except Exception, err:
# This most likely not a deluge exception, let's wrap it
log.error("An exception occurred while sending RPC_ERROR to "
"client. Wrapping it and resending. Error to "
"send(causing exception goes next):\n%s", formated_tb)
log.exception(err)
try:
raise WrappedException(str(exceptionValue), exceptionType.__name__, formated_tb)
except:
sendError()
self.sendData((
RPC_ERROR,
request_id,
(exceptionType.__name__,
exceptionValue.args[0] if len(exceptionValue.args) == 1 else "",
"".join(traceback.format_tb(exceptionTraceback)))
))
if method == "daemon.login":
if method == "daemon.info":
# This is a special case and used in the initial connection process
self.sendData((RPC_RESPONSE, request_id, deluge.common.get_version()))
return
elif method == "daemon.login":
# This is a special case and used in the initial connection process
# We need to authenticate the user here
log.debug("RPC dispatch daemon.login")
try:
client_version = kwargs.pop('client_version', None)
if client_version is None:
raise IncompatibleClient(deluge.common.get_version())
ret = component.get("AuthManager").authorize(*args, **kwargs)
if ret:
self.factory.authorized_sessions[self.transport.sessionno] = ret
self.factory.authorized_sessions[self.transport.sessionno] = (ret, args[0])
self.factory.session_protocols[self.transport.sessionno] = self
except Exception, e:
sendError()
log.exception(e)
if not isinstance(e, _ClientSideRecreateError):
log.exception(e)
else:
self.sendData((RPC_RESPONSE, request_id, (ret)))
if not ret:
self.transport.loseConnection()
finally:
return
elif method == "daemon.set_event_interest" and self.transport.sessionno in self.factory.authorized_sessions:
elif method == "daemon.set_event_interest" and self.valid_session():
log.debug("RPC dispatch daemon.set_event_interest")
# This special case is to allow clients to set which events they are
# interested in receiving.
# We are expecting a sequence from the client.
@ -280,21 +291,24 @@ class DelugeRPCProtocol(Protocol):
finally:
return
if method in self.factory.methods and self.transport.sessionno in self.factory.authorized_sessions:
if method in self.factory.methods and self.valid_session():
log.debug("RPC dispatch %s", method)
try:
method_auth_requirement = self.factory.methods[method]._rpcserver_auth_level
auth_level = self.factory.authorized_sessions[self.transport.sessionno]
auth_level = self.factory.authorized_sessions[self.transport.sessionno][0]
if auth_level < method_auth_requirement:
# This session is not allowed to call this method
log.debug("Session %s is trying to call a method it is not authorized to call!", self.transport.sessionno)
raise NotAuthorizedError("Auth level too low: %s < %s" % (auth_level, method_auth_requirement))
log.debug("Session %s is trying to call a method it is not "
"authorized to call!", self.transport.sessionno)
raise NotAuthorizedError(auth_level, method_auth_requirement)
# Set the session_id in the factory so that methods can know
# which session is calling it.
self.factory.session_id = self.transport.sessionno
ret = self.factory.methods[method](*args, **kwargs)
except Exception, e:
sendError()
# Don't bother printing out DelugeErrors, because they are just for the client
# Don't bother printing out DelugeErrors, because they are just
# for the client
if not isinstance(e, DelugeError):
log.exception("Exception calling RPC request: %s", e)
else:
@ -338,7 +352,7 @@ class RPCServer(component.Component):
self.factory = Factory()
self.factory.protocol = DelugeRPCProtocol
self.factory.session_id = -1
# Holds the registered methods
self.factory.methods = {}
# Holds the session_ids and auth levels
@ -348,6 +362,7 @@ class RPCServer(component.Component):
# Holds the interested event list for the sessions
self.factory.interested_events = {}
self.listen = listen
if not listen:
return
@ -391,6 +406,17 @@ class RPCServer(component.Component):
log.debug("Registering method: %s", name + "." + d)
self.factory.methods[name + "." + d] = getattr(obj, d)
def deregister_object(self, obj):
"""
Deregisters an objects exported rpc methods.
:param obj: the object that was previously registered
"""
for key, value in self.factory.methods.items():
if value.im_self == obj:
del self.factory.methods[key]
def get_object_method(self, name):
"""
Returns a registered method.
@ -417,26 +443,63 @@ class RPCServer(component.Component):
def get_session_id(self):
"""
Returns the session id of the current RPC.
:returns: the session id, this will be -1 if no connections have been made
:rtype: int
"""
return self.factory.session_id
def get_session_user(self):
"""
Returns the username calling the current RPC.
:returns: the username of the user calling the current RPC
:rtype: string
"""
if not self.listen:
return "localclient"
session_id = self.get_session_id()
if session_id > -1 and session_id in self.factory.authorized_sessions:
return self.factory.authorized_sessions[session_id][1]
else:
# No connections made yet
return ""
def get_session_auth_level(self):
"""
Returns the auth level of the user calling the current RPC.
:returns: the auth level
:rtype: int
"""
if not self.listen or not self.is_session_valid(self.get_session_id()):
return AUTH_LEVEL_ADMIN
return self.factory.authorized_sessions[self.get_session_id()][0]
def get_rpc_auth_level(self, rpc):
"""
Returns the auth level requirement for an exported rpc.
:returns: the auth level
:rtype: int
"""
self.factory.methods[rpc]._rpcserver_auth_level
def is_session_valid(self, session_id):
"""
Checks if the session is still valid, eg, if the client is still connected.
:param session_id: the session id
:type session_id: int
:returns: True if the session is valid
:rtype: bool
"""
return session_id in self.factory.authorized_sessions
def emit_event(self, event):
"""
Emits the event to interested clients.
@ -446,7 +509,7 @@ class RPCServer(component.Component):
"""
log.debug("intevents: %s", self.factory.interested_events)
# Find sessions interested in this event
for session_id, interest in self.factory.interested_events.iteritems():
for session_id, interest in self.factory.interested_events.items():
if event.name in interest:
log.debug("Emit Event: %s %s", event.name, event.args)
# This session is interested so send a RPC_EVENT
@ -454,6 +517,29 @@ class RPCServer(component.Component):
(RPC_EVENT, event.name, event.args)
)
def emit_event_for_session_id(self, session_id, event):
"""
Emits the event to specified session_id.
:param session_id: the event to emit
:type session_id: int
:param event: the event to emit
:type event: :class:`deluge.event.DelugeEvent`
"""
if not self.is_session_valid(session_id):
log.debug("Session ID %s is not valid. Not sending event \"%s\".", session_id, event.name)
return
if session_id not in self.factory.interested_events:
log.debug("Session ID %s is not interested in any events. Not sending event \"%s\".", session_id, event.name)
return
if event.name not in self.factory.interested_events[session_id]:
log.debug("Session ID %s is not interested in event \"%s\". Not sending it.", session_id, event.name)
return
log.debug("Sending event \"%s\" with args \"%s\" to session id \"%s\".",
event.name, event.args, session_id)
self.factory.session_protocols[session_id].sendData((RPC_EVENT, event.name, event.args))
def check_ssl_keys():
"""
Check for SSL cert/key and create them if necessary
@ -497,8 +583,12 @@ def generate_ssl_keys():
# Write out files
ssl_dir = deluge.configmanager.get_config_dir("ssl")
open(os.path.join(ssl_dir, "daemon.pkey"), "w").write(crypto.dump_privatekey(crypto.FILETYPE_PEM, pkey))
open(os.path.join(ssl_dir, "daemon.cert"), "w").write(crypto.dump_certificate(crypto.FILETYPE_PEM, cert))
open(os.path.join(ssl_dir, "daemon.pkey"), "w").write(
crypto.dump_privatekey(crypto.FILETYPE_PEM, pkey)
)
open(os.path.join(ssl_dir, "daemon.cert"), "w").write(
crypto.dump_certificate(crypto.FILETYPE_PEM, cert)
)
# Make the files only readable by this user
for f in ("daemon.pkey", "daemon.cert"):
os.chmod(os.path.join(ssl_dir, f), stat.S_IREAD | stat.S_IWRITE)

File diff suppressed because it is too large Load Diff

View File

@ -17,9 +17,9 @@
#
# You should have received a copy of the GNU General Public License
# along with deluge. If not, write to:
# The Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA.
# The Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA.
#
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the OpenSSL
@ -38,27 +38,28 @@
import cPickle
import os
import time
import shutil
import operator
import logging
import time
from twisted.internet import reactor
from twisted.internet.task import LoopingCall
from twisted.internet.defer import Deferred, DeferredList
from twisted.internet import reactor
from deluge._libtorrent import lt
from deluge.event import *
from deluge.error import *
import deluge.common
import deluge.component as component
from deluge.configmanager import ConfigManager, get_config_dir
from deluge.core.authmanager import AUTH_LEVEL_ADMIN
from deluge.core.torrent import Torrent
from deluge.core.torrent import TorrentOptions
import deluge.core.oldstateupgrader
from deluge.ui.common import utf8_encoded
from deluge.common import utf8_encoded, decode_string
from deluge.log import LOG as log
log = logging.getLogger(__name__)
class TorrentState:
def __init__(self,
@ -74,6 +75,7 @@ class TorrentState:
max_upload_speed=-1.0,
max_download_speed=-1.0,
prioritize_first_last=False,
sequential_download=False,
file_priorities=None,
queue=None,
auto_managed=True,
@ -84,7 +86,10 @@ class TorrentState:
move_completed=False,
move_completed_path=None,
magnet=None,
time_added=-1
time_added=-1,
last_seen_complete=0,
owner="",
shared=False
):
self.torrent_id = torrent_id
self.filename = filename
@ -94,6 +99,8 @@ class TorrentState:
self.is_finished = is_finished
self.magnet = magnet
self.time_added = time_added
self.last_seen_complete = last_seen_complete
self.owner = owner
# Options
self.compact = compact
@ -104,6 +111,7 @@ class TorrentState:
self.max_upload_speed = max_upload_speed
self.max_download_speed = max_download_speed
self.prioritize_first_last = prioritize_first_last
self.sequential_download = sequential_download
self.file_priorities = file_priorities
self.auto_managed = auto_managed
self.stop_ratio = stop_ratio
@ -111,6 +119,7 @@ class TorrentState:
self.remove_at_ratio = remove_at_ratio
self.move_completed = move_completed
self.move_completed_path = move_completed_path
self.shared = shared
class TorrentManagerState:
def __init__(self):
@ -124,7 +133,8 @@ class TorrentManager(component.Component):
"""
def __init__(self):
component.Component.__init__(self, "TorrentManager", interval=5, depend=["CorePluginManager"])
component.Component.__init__(self, "TorrentManager", interval=5,
depend=["CorePluginManager", "AlertManager"])
log.debug("TorrentManager init..")
# Set the libtorrent session
self.session = component.get("Core").session
@ -139,18 +149,19 @@ class TorrentManager(component.Component):
# Create the torrents dict { torrent_id: Torrent }
self.torrents = {}
self.queued_torrents = set()
# This is a list of torrent_id when we shutdown the torrentmanager.
# We use this list to determine if all active torrents have been paused
# and that their resume data has been written.
self.shutdown_torrent_pause_list = []
# This is a map of torrent_ids to Deferreds used to track needed resume data.
# The Deferreds will be completed when resume data has been saved.
self.waiting_on_resume_data = {}
# self.num_resume_data used to save resume_data in bulk
self.num_resume_data = 0
# Keeps track of resume data that needs to be saved to disk
# Keeps track of resume data
self.resume_data = {}
self.torrents_status_requests = []
self.status_dict = {}
self.last_state_update_alert_ts = 0
# Register set functions
self.config.register_set_function("max_connections_per_torrent",
self.on_set_max_connections_per_torrent)
@ -192,6 +203,10 @@ class TorrentManager(component.Component):
self.on_alert_metadata_received)
self.alerts.register_handler("file_error_alert",
self.on_alert_file_error)
self.alerts.register_handler("file_completed_alert",
self.on_alert_file_completed)
self.alerts.register_handler("state_update_alert",
self.on_alert_state_update)
def start(self):
# Get the pluginmanager reference
@ -203,11 +218,14 @@ class TorrentManager(component.Component):
# Try to load the state from file
self.load_state()
# Save the state every 5 minutes
# Save the state periodically
self.save_state_timer = LoopingCall(self.save_state)
self.save_state_timer.start(200, False)
self.save_resume_data_timer = LoopingCall(self.save_resume_data)
self.save_resume_data_timer.start(190)
self.save_resume_data_timer.start(190, False)
# Force update for all resume data a bit less frequently
self.save_all_resume_data_timer = LoopingCall(self.save_resume_data, self.torrents.keys())
self.save_all_resume_data_timer.start(900, False)
def stop(self):
# Stop timers
@ -217,55 +235,31 @@ class TorrentManager(component.Component):
if self.save_resume_data_timer.running:
self.save_resume_data_timer.stop()
if self.save_all_resume_data_timer.running:
self.save_all_resume_data_timer.stop()
# Save state on shutdown
self.save_state()
# Make another list just to make sure all paused torrents will be
# passed to self.save_resume_data(). With
# self.shutdown_torrent_pause_list it is possible to have a case when
# torrent_id is removed from it in self.on_alert_torrent_paused()
# before we call self.save_resume_data() here.
save_resume_data_list = []
self.session.pause()
for key in self.torrents:
# Stop the status cleanup LoopingCall here
self.torrents[key].prev_status_cleanup_loop.stop()
if not self.torrents[key].handle.is_paused():
# We set auto_managed false to prevent lt from resuming the torrent
self.torrents[key].handle.auto_managed(False)
self.torrents[key].handle.pause()
self.shutdown_torrent_pause_list.append(key)
save_resume_data_list.append(key)
self.save_resume_data(save_resume_data_list)
# We have to wait for all torrents to pause and write their resume data
wait = True
while wait:
if self.shutdown_torrent_pause_list:
wait = True
else:
wait = False
for torrent in self.torrents.values():
if torrent.waiting_on_resume_data:
wait = True
break
time.sleep(0.01)
# Wait for all alerts
self.alerts.handle_alerts(True)
return self.save_resume_data(self.torrents.keys())
def update(self):
for torrent_id, torrent in self.torrents.items():
if self.config["stop_seed_at_ratio"] or torrent.options["stop_at_ratio"] and torrent.state not in ("Checking", "Allocating", "Paused", "Queued"):
# If the global setting is set, but the per-torrent isn't.. Just skip to the next torrent
# This is so that a user can turn-off the stop at ratio option on a per-torrent basis
if self.config["stop_seed_at_ratio"] and not torrent.options["stop_at_ratio"]:
if torrent.options["stop_at_ratio"] and torrent.state not in (
"Checking", "Allocating", "Paused", "Queued"):
# If the global setting is set, but the per-torrent isn't..
# Just skip to the next torrent.
# This is so that a user can turn-off the stop at ratio option
# on a per-torrent basis
if not torrent.options["stop_at_ratio"]:
continue
stop_ratio = self.config["stop_seed_ratio"]
if torrent.options["stop_at_ratio"]:
stop_ratio = torrent.options["stop_ratio"]
if torrent.get_ratio() >= stop_ratio and torrent.is_finished:
if self.config["remove_seed_at_ratio"] or torrent.options["remove_at_ratio"]:
if torrent.get_ratio() >= torrent.options["stop_ratio"] and torrent.is_finished:
if torrent.options["remove_at_ratio"]:
self.remove(torrent_id)
break
if not torrent.handle.is_paused():
@ -277,14 +271,24 @@ class TorrentManager(component.Component):
def get_torrent_list(self):
"""Returns a list of torrent_ids"""
return self.torrents.keys()
torrent_ids = self.torrents.keys()
if component.get("RPCServer").get_session_auth_level() == AUTH_LEVEL_ADMIN:
return torrent_ids
current_user = component.get("RPCServer").get_session_user()
for torrent_id in torrent_ids[:]:
torrent_status = self[torrent_id].get_status(["owner", "shared"])
if torrent_status["owner"] != current_user and torrent_status["shared"] == False:
torrent_ids.pop(torrent_ids.index(torrent_id))
return torrent_ids
def get_torrent_info_from_file(self, filepath):
"""Returns a torrent_info for the file specified or None"""
torrent_info = None
# Get the torrent data from the torrent file
try:
log.debug("Attempting to create torrent_info from %s", filepath)
if log.isEnabledFor(logging.DEBUG):
log.debug("Attempting to create torrent_info from %s", filepath)
_file = open(filepath, "rb")
torrent_info = lt.torrent_info(lt.bdecode(_file.read()))
_file.close()
@ -317,14 +321,17 @@ class TorrentManager(component.Component):
log.warning("Unable to delete the fastresume file: %s", e)
def add(self, torrent_info=None, state=None, options=None, save_state=True,
filedump=None, filename=None, magnet=None, resume_data=None):
filedump=None, filename=None, magnet=None, resume_data=None, owner=None):
"""Add a torrent to the manager and returns it's torrent_id"""
if owner is None:
owner = component.get("RPCServer").get_session_user()
if not owner:
owner = "localclient"
if torrent_info is None and state is None and filedump is None and magnet is None:
log.debug("You must specify a valid torrent_info, torrent state or magnet.")
return
log.debug("torrentmanager.add")
add_torrent_params = {}
if filedump is not None:
@ -346,6 +353,7 @@ class TorrentManager(component.Component):
options["max_upload_speed"] = state.max_upload_speed
options["max_download_speed"] = state.max_download_speed
options["prioritize_first_last_pieces"] = state.prioritize_first_last
options["sequential_download"] = state.sequential_download
options["file_priorities"] = state.file_priorities
options["compact_allocation"] = state.compact
options["download_location"] = state.save_path
@ -356,6 +364,7 @@ class TorrentManager(component.Component):
options["move_completed"] = state.move_completed
options["move_completed_path"] = state.move_completed_path
options["add_paused"] = state.paused
options["shared"] = state.shared
ti = self.get_torrent_info_from_file(
os.path.join(get_config_dir(),
@ -374,9 +383,38 @@ class TorrentManager(component.Component):
resume_data = self.legacy_get_resume_data_from_file(state.torrent_id)
self.legacy_delete_resume_data(state.torrent_id)
add_torrent_params["resume_data"] = resume_data
if resume_data:
add_torrent_params["resume_data"] = resume_data
else:
# We have a torrent_info object so we're not loading from state.
# We have a torrent_info object or magnet uri so we're not loading from state.
if torrent_info:
add_torrent_id = str(torrent_info.info_hash())
if add_torrent_id in self.get_torrent_list():
# Torrent already exists just append any extra trackers.
log.debug("Torrent (%s) exists, checking for trackers to add...", add_torrent_id)
add_torrent_trackers = []
for value in torrent_info.trackers():
tracker = {}
tracker["url"] = value.url
tracker["tier"] = value.tier
add_torrent_trackers.append(tracker)
torrent_trackers = {}
tracker_list = []
for tracker in self[add_torrent_id].get_status(["trackers"])["trackers"]:
torrent_trackers[(tracker["url"])] = tracker
tracker_list.append(tracker)
added_tracker = False
for tracker in add_torrent_trackers:
if tracker['url'] not in torrent_trackers:
tracker_list.append(tracker)
added_tracker = True
if added_tracker:
self[add_torrent_id].set_trackers(tracker_list)
return
# Check if options is None and load defaults
if options == None:
options = TorrentOptions()
@ -388,15 +426,22 @@ class TorrentManager(component.Component):
# Check for renamed files and if so, rename them in the torrent_info
# before adding to the session.
if options["mapped_files"]:
for index, name in options["mapped_files"].items():
log.debug("renaming file index %s to %s", index, name)
torrent_info.rename_file(index, utf8_encoded(name))
for index, fname in options["mapped_files"].items():
try:
fname = unicode(fname, "utf-8")
except TypeError:
pass
fname = deluge.core.torrent.sanitize_filepath(fname)
log.debug("renaming file index %s to %s", index, fname)
try:
torrent_info.rename_file(index, fname)
except TypeError:
torrent_info.rename_file(index, fname.encode("utf-8"))
add_torrent_params["ti"] = torrent_info
add_torrent_params["resume_data"] = ""
#log.info("Adding torrent: %s", filename)
log.debug("options: %s", options)
if log.isEnabledFor(logging.DEBUG):
log.debug("options: %s", options)
# Set the right storage_mode
if options["compact_allocation"]:
@ -418,7 +463,7 @@ class TorrentManager(component.Component):
handle = None
try:
if magnet:
handle = lt.add_magnet_uri(self.session, magnet, add_torrent_params)
handle = lt.add_magnet_uri(self.session, utf8_encoded(magnet), add_torrent_params)
else:
handle = self.session.add_torrent(add_torrent_params)
except RuntimeError, e:
@ -430,11 +475,19 @@ class TorrentManager(component.Component):
component.resume("AlertManager")
return
log.debug("handle id: %s", str(handle.info_hash()))
if log.isEnabledFor(logging.DEBUG):
log.debug("handle id: %s", str(handle.info_hash()))
# Set auto_managed to False because the torrent is paused
handle.auto_managed(False)
# Create a Torrent object
torrent = Torrent(handle, options, state, filename, magnet)
owner = state.owner if state else (
owner if owner else component.get("RPCServer").get_session_user()
)
account_exists = component.get("AuthManager").has_account(owner)
if not account_exists:
owner = 'localclient'
torrent = Torrent(handle, options, state, filename, magnet, owner)
# Add the torrent object to the dictionary
self.torrents[torrent.torrent_id] = torrent
if self.config["queue_new_to_top"]:
@ -446,6 +499,9 @@ class TorrentManager(component.Component):
if not options["add_paused"]:
torrent.resume()
# Add to queued torrents set
self.queued_torrents.add(torrent.torrent_id)
# Write the .torrent file to the state directory
if filedump:
try:
@ -473,9 +529,19 @@ class TorrentManager(component.Component):
# Save the session state
self.save_state()
# Emit the torrent_added signal
component.get("EventManager").emit(TorrentAddedEvent(torrent.torrent_id))
# Emit torrent_added signal
from_state = state is not None
component.get("EventManager").emit(
TorrentAddedEvent(torrent.torrent_id, from_state)
)
if log.isEnabledFor(logging.INFO):
name_and_owner = torrent.get_status(["name", "owner"])
log.info("Torrent %s from user \"%s\" %s" % (
name_and_owner["name"],
name_and_owner["owner"],
from_state and "loaded" or "added")
)
return torrent.torrent_id
def load_torrent(self, torrent_id):
@ -511,8 +577,9 @@ class TorrentManager(component.Component):
:raises InvalidTorrentError: if the torrent_id is not in the session
"""
if torrent_id not in self.torrents:
try:
torrent_name = self.torrents[torrent_id].get_status(["name"])["name"]
except KeyError:
raise InvalidTorrentError("torrent_id not in session")
# Emit the signal to the clients
@ -526,9 +593,7 @@ class TorrentManager(component.Component):
return False
# Remove fastresume data if it is exists
resume_data = self.load_resume_data_file()
resume_data.pop(torrent_id, None)
self.save_resume_data_file(resume_data)
self.resume_data.pop(torrent_id, None)
# Remove the .torrent file in the state
self.torrents[torrent_id].delete_torrentfile()
@ -551,10 +616,17 @@ class TorrentManager(component.Component):
# Stop the looping call
self.torrents[torrent_id].prev_status_cleanup_loop.stop()
# Remove from set if it wasn't finished
if not self.torrents[torrent_id].is_finished:
try:
self.queued_torrents.remove(torrent_id)
except KeyError:
log.debug("%s isn't in queued torrents set?", torrent_id)
# Remove the torrent from deluge's session
try:
del self.torrents[torrent_id]
except KeyError, ValueError:
except (KeyError, ValueError):
return False
# Save the session state
@ -562,7 +634,8 @@ class TorrentManager(component.Component):
# Emit the signal to the clients
component.get("EventManager").emit(TorrentRemovedEvent(torrent_id))
log.info("Torrent %s removed by user: %s", torrent_name,
component.get("RPCServer").get_session_user())
return True
def load_state(self):
@ -575,33 +648,41 @@ class TorrentManager(component.Component):
os.path.join(get_config_dir(), "state", "torrents.state"), "rb")
state = cPickle.load(state_file)
state_file.close()
except (EOFError, IOError, Exception), e:
except (EOFError, IOError, Exception, cPickle.UnpicklingError), e:
log.warning("Unable to load state file: %s", e)
# Try to use an old state
try:
state_tmp = TorrentState()
if dir(state.torrents[0]) != dir(state_tmp):
for attr in (set(dir(state_tmp)) - set(dir(state.torrents[0]))):
for s in state.torrents:
setattr(s, attr, getattr(state_tmp, attr, None))
if len(state.torrents) > 0:
state_tmp = TorrentState()
if dir(state.torrents[0]) != dir(state_tmp):
for attr in (set(dir(state_tmp)) - set(dir(state.torrents[0]))):
for s in state.torrents:
setattr(s, attr, getattr(state_tmp, attr, None))
except Exception, e:
log.warning("Unable to update state file to a compatible version: %s", e)
log.exception("Unable to update state file to a compatible version: %s", e)
# Reorder the state.torrents list to add torrents in the correct queue
# order.
state.torrents.sort(key=operator.attrgetter("queue"))
state.torrents.sort(key=operator.attrgetter("queue"), reverse=self.config["queue_new_to_top"])
resume_data = self.load_resume_data_file()
# Tell alertmanager to wait for the handlers while adding torrents.
# This speeds up startup loading the torrents by quite a lot for some reason (~40%)
self.alerts.wait_on_handler = True
for torrent_state in state.torrents:
try:
self.add(state=torrent_state, save_state=False,
resume_data=resume_data.get(torrent_state.torrent_id))
except AttributeError, e:
log.error("Torrent state file is either corrupt or incompatible! %s", e)
import traceback
traceback.print_exc()
break
self.alerts.wait_on_handler = False
component.get("EventManager").emit(SessionStartedEvent())
def save_state(self):
@ -613,10 +694,16 @@ class TorrentManager(component.Component):
if torrent.state == "Paused":
paused = True
torrent_status = torrent.get_status([
"total_uploaded",
"last_seen_complete"
], update=True
)
torrent_state = TorrentState(
torrent.torrent_id,
torrent.filename,
torrent.get_status(["total_uploaded"])["total_uploaded"],
torrent_status["total_uploaded"],
torrent.trackers,
torrent.options["compact_allocation"],
paused,
@ -626,6 +713,7 @@ class TorrentManager(component.Component):
torrent.options["max_upload_speed"],
torrent.options["max_download_speed"],
torrent.options["prioritize_first_last_pieces"],
torrent.options["sequential_download"],
torrent.options["file_priorities"],
torrent.get_queue_position(),
torrent.options["auto_managed"],
@ -636,7 +724,10 @@ class TorrentManager(component.Component):
torrent.options["move_completed"],
torrent.options["move_completed_path"],
torrent.magnet,
torrent.time_added
torrent.time_added,
torrent_status["last_seen_complete"],
torrent.owner,
torrent.options["shared"]
)
state.torrents.append(torrent_state)
@ -649,8 +740,8 @@ class TorrentManager(component.Component):
state_file.flush()
os.fsync(state_file.fileno())
state_file.close()
except IOError:
log.warning("Unable to save state file.")
except IOError, e:
log.warning("Unable to save state file: %s", e)
return True
# We have to move the 'torrents.state.new' file to 'torrents.state'
@ -667,17 +758,34 @@ class TorrentManager(component.Component):
def save_resume_data(self, torrent_ids=None):
"""
Saves resume data for list of torrent_ids or for all torrents if
torrent_ids is None
Saves resume data for list of torrent_ids or for all torrents
needing resume data updated if torrent_ids is None
:returns: A Deferred whose callback will be invoked when save is complete
:rtype: twisted.internet.defer.Deferred
"""
if torrent_ids is None:
torrent_ids = self.torrents.keys()
torrent_ids = (t[0] for t in self.torrents.iteritems() if t[1].handle.need_save_resume_data())
deferreds = []
def on_torrent_resume_save(result, torrent_id):
self.waiting_on_resume_data.pop(torrent_id, None)
for torrent_id in torrent_ids:
d = self.waiting_on_resume_data.get(torrent_id)
if not d:
d = Deferred().addBoth(on_torrent_resume_save, torrent_id)
self.waiting_on_resume_data[torrent_id] = d
deferreds.append(d)
self.torrents[torrent_id].save_resume_data()
self.num_resume_data = len(torrent_ids)
def on_all_resume_data_finished(result):
if result:
self.save_resume_data_file()
return DeferredList(deferreds).addBoth(on_all_resume_data_finished)
def load_resume_data_file(self):
resume_data = {}
@ -697,40 +805,26 @@ class TorrentManager(component.Component):
return resume_data
def save_resume_data_file(self, resume_data=None):
def save_resume_data_file(self):
"""
Saves the resume data file with the contents of self.resume_data. If
`resume_data` is None, then we grab the resume_data from the file on
disk, else, we update `resume_data` with self.resume_data and save
that to disk.
:param resume_data: the current resume_data, this will be loaded from disk if not provided
:type resume_data: dict
Saves the resume data file with the contents of self.resume_data.
"""
# Check to see if we're waiting on more resume data
if self.num_resume_data or not self.resume_data:
return
path = os.path.join(get_config_dir(), "state", "torrents.fastresume")
# First step is to load the existing file and update the dictionary
if resume_data is None:
resume_data = self.load_resume_data_file()
resume_data.update(self.resume_data)
self.resume_data = {}
try:
log.debug("Saving fastresume file: %s", path)
fastresume_file = open(path, "wb")
fastresume_file.write(lt.bencode(resume_data))
fastresume_file.write(lt.bencode(self.resume_data))
fastresume_file.flush()
os.fsync(fastresume_file.fileno())
fastresume_file.close()
except IOError:
log.warning("Error trying to save fastresume file")
def get_queue_position(self, torrent_id):
"""Get queue position of torrent"""
return self.torrents[torrent_id].get_queue_position()
def queue_top(self, torrent_id):
"""Queue torrent to top"""
if self.torrents[torrent_id].get_queue_position() == 0:
@ -749,7 +843,7 @@ class TorrentManager(component.Component):
def queue_down(self, torrent_id):
"""Queue torrent down one position"""
if self.torrents[torrent_id].get_queue_position() == (len(self.torrents) - 1):
if self.torrents[torrent_id].get_queue_position() == (len(self.queued_torrents) - 1):
return False
self.torrents[torrent_id].handle.queue_position_down()
@ -757,7 +851,7 @@ class TorrentManager(component.Component):
def queue_bottom(self, torrent_id):
"""Queue torrent to bottom"""
if self.torrents[torrent_id].get_queue_position() == (len(self.torrents) - 1):
if self.torrents[torrent_id].get_queue_position() == (len(self.queued_torrents) - 1):
return False
self.torrents[torrent_id].handle.queue_position_bottom()
@ -790,9 +884,9 @@ class TorrentManager(component.Component):
log.debug("on_alert_torrent_finished")
try:
torrent = self.torrents[str(alert.handle.info_hash())]
torrent_id = str(alert.handle.info_hash())
except:
return
torrent_id = str(alert.handle.info_hash())
log.debug("%s is finished..", torrent_id)
# Get the total_download and if it's 0, do not move.. It's likely
@ -808,11 +902,18 @@ class TorrentManager(component.Component):
if torrent.options["download_location"] != move_path:
torrent.move_storage(move_path)
torrent.is_finished = True
component.get("EventManager").emit(TorrentFinishedEvent(torrent_id))
torrent.is_finished = True
torrent.update_state()
# Torrent is no longer part of the queue
try:
self.queued_torrents.remove(torrent_id)
except KeyError:
# Sometimes libtorrent fires a TorrentFinishedEvent twice
log.debug("%s isn't in queued torrents set?", torrent_id)
# Only save resume data if it was actually downloaded something. Helps
# on startup with big queues with lots of seeding torrents. Libtorrent
# emits alert_torrent_finished for them, but there seems like nothing
@ -822,47 +923,51 @@ class TorrentManager(component.Component):
self.save_resume_data((torrent_id, ))
def on_alert_torrent_paused(self, alert):
log.debug("on_alert_torrent_paused")
if log.isEnabledFor(logging.DEBUG):
log.debug("on_alert_torrent_paused")
try:
torrent = self.torrents[str(alert.handle.info_hash())]
torrent_id = str(alert.handle.info_hash())
except:
return
torrent_id = str(alert.handle.info_hash())
# Set the torrent state
old_state = torrent.state
torrent.update_state()
if torrent.state != old_state:
component.get("EventManager").emit(TorrentStateChangedEvent(torrent_id, torrent.state))
# Don't save resume data for each torrent after self.stop() was called.
# We save resume data in bulk in self.stop() in this case.
if self.save_resume_data_timer.running:
# Write the fastresume file
self.save_resume_data((torrent_id, ))
if torrent_id in self.shutdown_torrent_pause_list:
self.shutdown_torrent_pause_list.remove(torrent_id)
# Write the fastresume file if we are not waiting on a bulk write
if torrent_id not in self.waiting_on_resume_data:
self.save_resume_data((torrent_id,))
def on_alert_torrent_checked(self, alert):
log.debug("on_alert_torrent_checked")
if log.isEnabledFor(logging.DEBUG):
log.debug("on_alert_torrent_checked")
try:
torrent = self.torrents[str(alert.handle.info_hash())]
except:
return
# Check to see if we're forcing a recheck and set it back to paused
# if necessary
if torrent.forcing_recheck:
torrent.forcing_recheck = False
if torrent.forcing_recheck_paused:
torrent.handle.pause()
# Set the torrent state
torrent.update_state()
def on_alert_tracker_reply(self, alert):
log.debug("on_alert_tracker_reply: %s", alert.message().decode("utf8"))
if log.isEnabledFor(logging.DEBUG):
log.debug("on_alert_tracker_reply: %s", decode_string(alert.message()))
try:
torrent = self.torrents[str(alert.handle.info_hash())]
except:
return
# Set the tracker status for the torrent
if alert.message() != "Got peers from DHT":
torrent.set_tracker_status(_("Announce OK"))
torrent.set_tracker_status(_("Announce OK"))
# Check to see if we got any peer information from the tracker
if alert.handle.status().num_complete == -1 or \
@ -871,7 +976,8 @@ class TorrentManager(component.Component):
torrent.scrape_tracker()
def on_alert_tracker_announce(self, alert):
log.debug("on_alert_tracker_announce")
if log.isEnabledFor(logging.DEBUG):
log.debug("on_alert_tracker_announce")
try:
torrent = self.torrents[str(alert.handle.info_hash())]
except:
@ -886,7 +992,7 @@ class TorrentManager(component.Component):
torrent = self.torrents[str(alert.handle.info_hash())]
except:
return
tracker_status = '%s: %s' % (_("Warning"), str(alert.message()))
tracker_status = '%s: %s' % (_("Warning"), decode_string(alert.message()))
# Set the tracker status for the torrent
torrent.set_tracker_status(tracker_status)
@ -896,7 +1002,7 @@ class TorrentManager(component.Component):
torrent = self.torrents[str(alert.handle.info_hash())]
except:
return
tracker_status = "%s: %s" % (_("Error"), alert.msg)
tracker_status = "%s: %s" % (_("Error"), decode_string(alert.msg))
torrent.set_tracker_status(tracker_status)
def on_alert_storage_moved(self, alert):
@ -905,17 +1011,16 @@ class TorrentManager(component.Component):
torrent = self.torrents[str(alert.handle.info_hash())]
except:
return
torrent.set_save_path(alert.handle.save_path())
torrent.set_save_path(os.path.normpath(alert.handle.save_path()))
torrent.set_move_completed(False)
def on_alert_torrent_resumed(self, alert):
log.debug("on_alert_torrent_resumed")
try:
torrent = self.torrents[str(alert.handle.info_hash())]
torrent_id = str(alert.handle.info_hash())
except:
return
torrent_id = str(alert.handle.info_hash())
torrent.is_finished = torrent.handle.is_seed()
old_state = torrent.state
torrent.update_state()
if torrent.state != old_state:
@ -924,7 +1029,8 @@ class TorrentManager(component.Component):
component.get("EventManager").emit(TorrentResumedEvent(torrent_id))
def on_alert_state_changed(self, alert):
log.debug("on_alert_state_changed")
if log.isEnabledFor(logging.DEBUG):
log.debug("on_alert_state_changed")
try:
torrent_id = str(alert.handle.info_hash())
torrent = self.torrents[torrent_id]
@ -933,66 +1039,50 @@ class TorrentManager(component.Component):
old_state = torrent.state
torrent.update_state()
# Torrent may need to download data after checking.
if torrent.state in ('Checking', 'Checking Resume Data', 'Downloading'):
torrent.is_finished = False
self.queued_torrents.add(torrent_id)
# Only emit a state changed event if the state has actually changed
if torrent.state != old_state:
component.get("EventManager").emit(TorrentStateChangedEvent(torrent_id, torrent.state))
def on_alert_save_resume_data(self, alert):
log.debug("on_alert_save_resume_data")
if log.isEnabledFor(logging.DEBUG):
log.debug("on_alert_save_resume_data")
torrent_id = str(alert.handle.info_hash())
try:
torrent = self.torrents[torrent_id]
except:
return
if torrent_id in self.torrents:
# Libtorrent in add_torrent() expects resume_data to be bencoded
self.resume_data[torrent_id] = lt.bencode(alert.resume_data)
# Libtorrent in add_torrent() expects resume_data to be bencoded
self.resume_data[torrent_id] = lt.bencode(alert.resume_data)
self.num_resume_data -= 1
torrent.waiting_on_resume_data = False
self.save_resume_data_file()
if torrent_id in self.waiting_on_resume_data:
self.waiting_on_resume_data[torrent_id].callback(None)
def on_alert_save_resume_data_failed(self, alert):
log.debug("on_alert_save_resume_data_failed: %s", alert.message())
try:
torrent = self.torrents[str(alert.handle.info_hash())]
except:
return
self.num_resume_data -= 1
torrent.waiting_on_resume_data = False
self.save_resume_data_file()
log.debug("on_alert_save_resume_data_failed: %s", decode_string(alert.message()))
torrent_id = str(alert.handle.info_hash())
if torrent_id in self.waiting_on_resume_data:
self.waiting_on_resume_data[torrent_id].errback(Exception(decode_string(alert.message())))
def on_alert_file_renamed(self, alert):
log.debug("on_alert_file_renamed")
log.debug("index: %s name: %s", alert.index, alert.name.decode("utf8"))
log.debug("index: %s name: %s", alert.index, decode_string(alert.name))
try:
torrent = self.torrents[str(alert.handle.info_hash())]
torrent_id = str(alert.handle.info_hash())
except:
return
torrent_id = str(alert.handle.info_hash())
# We need to see if this file index is in a waiting_on_folder list
folder_rename = False
for i, wait_on_folder in enumerate(torrent.waiting_on_folder_rename):
if alert.index in wait_on_folder[2]:
folder_rename = True
if len(wait_on_folder[2]) == 1:
# This is the last alert we were waiting for, time to send signal
component.get("EventManager").emit(TorrentFolderRenamedEvent(torrent_id, wait_on_folder[0], wait_on_folder[1]))
del torrent.waiting_on_folder_rename[i]
self.save_resume_data((torrent_id,))
break
# This isn't the last file to be renamed in this folder, so just
# remove the index and continue
torrent.waiting_on_folder_rename[i][2].remove(alert.index)
if not folder_rename:
# We need to see if this file index is in a waiting_on_folder dict
for wait_on_folder in torrent.waiting_on_folder_rename:
if alert.index in wait_on_folder:
wait_on_folder[alert.index].callback(None)
break
else:
# This is just a regular file rename so send the signal
component.get("EventManager").emit(TorrentFileRenamedEvent(torrent_id, alert.index, alert.name))
self.save_resume_data((torrent_id,))
@ -1003,12 +1093,93 @@ class TorrentManager(component.Component):
torrent = self.torrents[str(alert.handle.info_hash())]
except:
return
torrent.write_torrentfile()
torrent.on_metadata_received()
def on_alert_file_error(self, alert):
log.debug("on_alert_file_error: %s", alert.message())
log.debug("on_alert_file_error: %s", decode_string(alert.message()))
try:
torrent = self.torrents[str(alert.handle.info_hash())]
except:
return
torrent.update_state()
def on_alert_file_completed(self, alert):
log.debug("file_completed_alert: %s", decode_string(alert.message()))
try:
torrent_id = str(alert.handle.info_hash())
except:
return
component.get("EventManager").emit(
TorrentFileCompletedEvent(torrent_id, alert.index))
def separate_keys(self, keys, torrent_ids):
"""Separates the input keys into keys for the Torrent class
and keys for plugins.
"""
if self.torrents:
for torrent_id in torrent_ids:
if torrent_id in self.torrents:
status_keys = self.torrents[torrent_id].status_funcs.keys()
leftover_keys = list(set(keys) - set(status_keys))
torrent_keys = list(set(keys) - set(leftover_keys))
return torrent_keys, leftover_keys
return [], []
def on_alert_state_update(self, alert):
log.debug("on_status_notification: %s", alert.message())
self.last_state_update_alert_ts = time.time()
for s in alert.status:
torrent_id = str(s.info_hash)
if torrent_id in self.torrents:
self.torrents[torrent_id].update_status(s)
self.handle_torrents_status_callback(self.torrents_status_requests.pop())
def handle_torrents_status_callback(self, status_request):
"""
Builds the status dictionary with the values from the Torrent.
"""
d, torrent_ids, keys, diff = status_request
status_dict = {}.fromkeys(torrent_ids)
torrent_keys, plugin_keys = self.separate_keys(keys, torrent_ids)
# Get the torrent status for each torrent_id
for torrent_id in torrent_ids:
if not torrent_id in self.torrents:
# The torrent_id does not exist in the dict.
# Could be the clients cache (sessionproxy) isn't up to speed.
del status_dict[torrent_id]
else:
status_dict[torrent_id] = self.torrents[torrent_id].get_status(torrent_keys, diff)
self.status_dict = status_dict
d.callback((status_dict, plugin_keys))
def torrents_status_update(self, torrent_ids, keys, diff=False):
"""
returns status dict for the supplied torrent_ids async
If the torrent states were updated recently (less than 1.5 seconds ago,
post_torrent_updates is not called. Instead the cached state is used.
:param torrent_ids: the torrent IDs to get the status on
:type torrent_ids: list of str
:param keys: the keys to get the status on
:type keys: list of str
:param diff: if True, will return a diff of the changes since the last
call to get_status based on the session_id
:type diff: bool
:returns: a status dictionary for the equested torrents.
:rtype: dict
"""
d = Deferred()
now = time.time()
# If last update was recent, use cached data instead of request updates from libtorrent
if (now - self.last_state_update_alert_ts) < 1.5:
reactor.callLater(0, self.handle_torrents_status_callback, (d, torrent_ids, keys, diff))
else:
# Ask libtorrent for status update
self.torrents_status_requests.insert(0, (d, torrent_ids, keys, diff))
self.session.post_torrent_updates()
return d

View File

@ -1,2 +0,0 @@
From: http://famfamfam.com/lab/icons/flags/
"These flag icons are available for free use for any purpose with no requirement for attribution."

View File

@ -1,12 +0,0 @@
[Desktop Entry]
Version=1.0
Name=Deluge BitTorrent Client
GenericName=Bittorrent Client
Comment=Transfer files using the Bittorrent protocol
Exec=deluge-gtk
Icon=deluge
Terminal=false
Type=Application
Categories=Network;
StartupNotify=true
MimeType=application/x-bittorrent;

View File

@ -2,6 +2,7 @@
# error.py
#
# Copyright (C) 2008 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2011 Pedro Algarvio <pedro@algarvio.me>
#
# Deluge is free software.
#
@ -35,7 +36,21 @@
class DelugeError(Exception):
pass
def _get_message(self):
return self._message
def _set_message(self, message):
self._message = message
message = property(_get_message, _set_message)
del _get_message, _set_message
def __str__(self):
return self.message
def __new__(cls, *args, **kwargs):
inst = super(DelugeError, cls).__new__(cls, *args, **kwargs)
inst._args = args
inst._kwargs = kwargs
return inst
class NoCoreError(DelugeError):
pass
@ -48,3 +63,69 @@ class InvalidTorrentError(DelugeError):
class InvalidPathError(DelugeError):
pass
class WrappedException(DelugeError):
def _get_traceback(self):
return self._traceback
def _set_traceback(self, traceback):
self._traceback = traceback
traceback = property(_get_traceback, _set_traceback)
del _get_traceback, _set_traceback
def _get_type(self):
return self._type
def _set_type(self, type):
self._type = type
type = property(_get_type, _set_type)
del _get_type, _set_type
def __init__(self, message, exception_type, traceback):
self.message = message
self.type = exception_type
self.traceback = traceback
class _ClientSideRecreateError(DelugeError):
pass
class IncompatibleClient(_ClientSideRecreateError):
def __init__(self, daemon_version):
self.daemon_version = daemon_version
self.message = _(
"Your deluge client is not compatible with the daemon. "
"Please upgrade your client to %(daemon_version)s"
) % dict(daemon_version=self.daemon_version)
class NotAuthorizedError(_ClientSideRecreateError):
def __init__(self, current_level, required_level):
self.message = _(
"Auth level too low: %(current_level)s < %(required_level)s" %
dict(current_level=current_level, required_level=required_level)
)
self.current_level = current_level
self.required_level = required_level
class _UsernameBasedPasstroughError(_ClientSideRecreateError):
def _get_username(self):
return self._username
def _set_username(self, username):
self._username = username
username = property(_get_username, _set_username)
del _get_username, _set_username
def __init__(self, message, username):
super(_UsernameBasedPasstroughError, self).__init__(message)
self.message = message
self.username = username
class BadLoginError(_UsernameBasedPasstroughError):
pass
class AuthenticationRequired(_UsernameBasedPasstroughError):
pass
class AuthManagerError(_UsernameBasedPasstroughError):
pass

View File

@ -57,7 +57,9 @@ class DelugeEvent(object):
The base class for all events.
:prop name: this is the name of the class which is in-turn the event name
:type name: string
:prop args: a list of the attribute values
:type args: list
"""
__metaclass__ = DelugeEventMetaClass
@ -77,11 +79,14 @@ class TorrentAddedEvent(DelugeEvent):
"""
Emitted when a new torrent is successfully added to the session.
"""
def __init__(self, torrent_id):
def __init__(self, torrent_id, from_state):
"""
:param torrent_id: str, the torrent_id of the torrent that was added
:param torrent_id: the torrent_id of the torrent that was added
:type torrent_id: string
:param from_state: was the torrent loaded from state? Or is it a new torrent.
:type from_state: bool
"""
self._args = [torrent_id]
self._args = [torrent_id, from_state]
class TorrentRemovedEvent(DelugeEvent):
"""
@ -89,7 +94,8 @@ class TorrentRemovedEvent(DelugeEvent):
"""
def __init__(self, torrent_id):
"""
:param torrent_id: str, the torrent_id
:param torrent_id: the torrent_id
:type torrent_id: string
"""
self._args = [torrent_id]
@ -99,7 +105,8 @@ class PreTorrentRemovedEvent(DelugeEvent):
"""
def __init__(self, torrent_id):
"""
:param torrent_id: str, the torrent_id
:param torrent_id: the torrent_id
:type torrent_id: string
"""
self._args = [torrent_id]
@ -109,8 +116,10 @@ class TorrentStateChangedEvent(DelugeEvent):
"""
def __init__(self, torrent_id, state):
"""
:param torrent_id: str, the torrent_id
:param state: str, the new state
:param torrent_id: the torrent_id
:type torrent_id: string
:param state: the new state
:type state: string
"""
self._args = [torrent_id, state]
@ -126,9 +135,12 @@ class TorrentFolderRenamedEvent(DelugeEvent):
"""
def __init__(self, torrent_id, old, new):
"""
:param torrent_id: str, the torrent_id
:param old: str, the old folder name
:param new: str, the new folder name
:param torrent_id: the torrent_id
:type torrent_id: string
:param old: the old folder name
:type old: string
:param new: the new folder name
:type new: string
"""
self._args = [torrent_id, old, new]
@ -138,9 +150,12 @@ class TorrentFileRenamedEvent(DelugeEvent):
"""
def __init__(self, torrent_id, index, name):
"""
:param torrent_id: str, the torrent_id
:param index: int, the index of the file
:param name: str, the new filename
:param torrent_id: the torrent_id
:type torrent_id: string
:param index: the index of the file
:type index: int
:param name: the new filename
:type name: string
"""
self._args = [torrent_id, index, name]
@ -150,7 +165,8 @@ class TorrentFinishedEvent(DelugeEvent):
"""
def __init__(self, torrent_id):
"""
:param torrent_id: str, the torrent_id
:param torrent_id: the torrent_id
:type torrent_id: string
"""
self._args = [torrent_id]
@ -160,17 +176,42 @@ class TorrentResumedEvent(DelugeEvent):
"""
def __init__(self, torrent_id):
"""
:param torrent_id: str, the torrent_id
:param torrent_id: the torrent_id
:type torrent_id: string
"""
self._args = [torrent_id]
class TorrentFileCompletedEvent(DelugeEvent):
"""
Emitted when a file completes.
This will only work with libtorrent 0.15 or greater.
"""
def __init__(self, torrent_id, index):
"""
:param torrent_id: the torrent_id
:type torrent_id: string
:param index: the file index
:type index: int
"""
self._args = [torrent_id, index]
class CreateTorrentProgressEvent(DelugeEvent):
"""
Emitted when creating a torrent file remotely.
"""
def __init__(self, piece_count, num_pieces):
self._args = [piece_count, num_pieces]
class NewVersionAvailableEvent(DelugeEvent):
"""
Emitted when a more recent version of Deluge is available.
"""
def __init__(self, new_release):
"""
:param new_release: str, the new version that is available
:param new_release: the new version that is available
:type new_release: string
"""
self._args = [new_release]
@ -199,7 +240,8 @@ class ConfigValueChangedEvent(DelugeEvent):
"""
def __init__(self, key, value):
"""
:param key: str, the key that changed
:param key: the key that changed
:type key: string
:param value: the new value of the `:param:key`
"""
self._args = [key, value]
@ -208,20 +250,13 @@ class PluginEnabledEvent(DelugeEvent):
"""
Emitted when a plugin is enabled in the Core.
"""
def __init__(self, name):
"""
:param name: the plugin name
:type name: string
"""
self._args = [name]
def __init__(self, plugin_name):
self._args = [plugin_name]
class PluginDisabledEvent(DelugeEvent):
"""
Emitted when a plugin is disabled in the Core.
"""
def __init__(self, name):
"""
:param name: the plugin name
:type name: string
"""
self._args = [name]
def __init__(self, plugin_name):
self._args = [plugin_name]

View File

@ -36,21 +36,26 @@ from twisted.web import client, http
from twisted.web.error import PageRedirect
from twisted.python.failure import Failure
from twisted.internet import reactor
from deluge.log import setupLogger, LOG as log
from common import get_version
import logging
import os.path
import zlib
log = logging.getLogger(__name__)
class HTTPDownloader(client.HTTPDownloader):
"""
Factory class for downloading files and keeping track of progress.
"""
def __init__(self, url, filename, part_callback=None, headers=None, force_filename=False, allow_compression=True):
def __init__(self, url, filename, part_callback=None, headers=None,
force_filename=False, allow_compression=True):
"""
:param url: the url to download from
:type url: string
:param filename: the filename to save the file as
:type filename: string
:param force_filename: forces use of the supplied filename, regardless of header content
:type force_filename: bool
:param part_callback: a function to be called when a part of data
is received, it's signature should be: func(data, current_length, total_length)
:type part_callback: function
@ -84,15 +89,20 @@ class HTTPDownloader(client.HTTPDownloader):
self.decoder = zlib.decompressobj(zlib.MAX_WBITS + 32)
if "content-disposition" in headers and not self.force_filename:
try:
new_file_name = str(headers["content-disposition"][0]).split(";")[1].split("=")[1]
new_file_name = sanitise_filename(new_file_name)
new_file_name = os.path.join(os.path.split(self.fileName)[0], new_file_name)
except Exception, e:
log.exception(e)
else:
self.fileName = new_file_name
self.value = new_file_name
new_file_name = str(headers["content-disposition"][0]).split(";")[1].split("=")[1]
new_file_name = sanitise_filename(new_file_name)
new_file_name = os.path.join(os.path.split(self.fileName)[0], new_file_name)
count = 1
fileroot = os.path.splitext(new_file_name)[0]
fileext = os.path.splitext(new_file_name)[1]
while os.path.isfile(new_file_name):
# Increment filename if already exists
new_file_name = "%s-%s%s" % (fileroot, count, fileext)
count += 1
self.fileName = new_file_name
self.value = new_file_name
elif self.code in (http.MOVED_PERMANENTLY, http.FOUND, http.SEE_OTHER, http.TEMPORARY_REDIRECT):
location = headers["location"][0]
@ -129,8 +139,6 @@ def sanitise_filename(filename):
:type filename: string
:returns: the sanitised filename
:rtype: string
:raises IOError: when the filename exists
"""
# Remove any quotes
@ -141,18 +149,16 @@ def sanitise_filename(filename):
log.warning("Potentially malicious server: trying to write to file '%s'" % filename)
# Only use the basename
filename = os.path.basename(filename)
filename = filename.strip()
if filename.startswith(".") or ";" in filename or "|" in filename:
# Dodgy server, log it
log.warning("Potentially malicious server: trying to write to file '%s'" % filename)
if os.path.exists(filename):
raise IOError, "File '%s' already exists!" % filename
return filename
def download_file(url, filename, callback=None, headers=None, force_filename=False, allow_compression=True):
def download_file(url, filename, callback=None, headers=None,
force_filename=False, allow_compression=True):
"""
Downloads a file from a specific URL and returns a Deferred. You can also
specify a callback function to be called as parts are received.

View File

@ -1,290 +0,0 @@
deluge/configmanager.py
deluge/httpdownloader.py
deluge/error.py
deluge/component.py
deluge/log.py
deluge/metafile.py
deluge/config.py
deluge/main.py
deluge/__init__.py
deluge/common.py
deluge/bencode.py
deluge/pluginmanagerbase.py
deluge/event.py
deluge/rencode.py
deluge/decorators.py
deluge/_libtorrent.py
deluge/__rpcapi.py
deluge/maketorrent.py
deluge/plugins/__init__.py
deluge/plugins/pluginbase.py
deluge/plugins/init.py
deluge/plugins/feeder/setup.py
deluge/plugins/feeder/feeder/__init__.py
deluge/plugins/feeder/feeder/core.py
deluge/plugins/feeder/feeder/webui.py
deluge/plugins/feeder/build/lib/feeder/__init__.py
deluge/plugins/feeder/build/lib/feeder/core.py
deluge/plugins/feeder/build/lib/feeder/webui.py
deluge/plugins/label/setup.py
deluge/plugins/label/label/test.py
deluge/plugins/label/label/__init__.py
deluge/plugins/label/label/core.py
deluge/plugins/label/label/webui.py
deluge/plugins/label/label/gtkui/__init__.py
deluge/plugins/label/label/gtkui/label_config.py
deluge/plugins/label/label/gtkui/submenu.py
deluge/plugins/label/label/gtkui/sidebar_menu.py
deluge/plugins/label/label/data/label_pref.glade
deluge/plugins/label/label/data/label_options.glade
deluge/plugins/label/build/lib/label/test.py
deluge/plugins/label/build/lib/label/__init__.py
deluge/plugins/label/build/lib/label/core.py
deluge/plugins/label/build/lib/label/webui.py
deluge/plugins/label/build/lib/label/gtkui/__init__.py
deluge/plugins/label/build/lib/label/gtkui/label_config.py
deluge/plugins/label/build/lib/label/gtkui/submenu.py
deluge/plugins/label/build/lib/label/gtkui/sidebar_menu.py
deluge/plugins/label/build/lib/label/data/label_pref.glade
deluge/plugins/label/build/lib/label/data/label_options.glade
deluge/plugins/autoadd/setup.py
deluge/plugins/autoadd/autoadd/__init__.py
deluge/plugins/autoadd/autoadd/common.py
deluge/plugins/autoadd/autoadd/core.py
deluge/plugins/autoadd/autoadd/webui.py
deluge/plugins/autoadd/autoadd/gtkui.py
deluge/plugins/autoadd/autoadd/data/config.glade
deluge/plugins/autoadd/autoadd/data/autoadd_options.glade
deluge/plugins/autoadd/build/lib/autoadd/__init__.py
deluge/plugins/autoadd/build/lib/autoadd/common.py
deluge/plugins/autoadd/build/lib/autoadd/core.py
deluge/plugins/autoadd/build/lib/autoadd/webui.py
deluge/plugins/autoadd/build/lib/autoadd/gtkui.py
deluge/plugins/autoadd/build/lib/autoadd/data/config.glade
deluge/plugins/autoadd/build/lib/autoadd/data/autoadd_options.glade
deluge/plugins/scheduler/setup.py
deluge/plugins/scheduler/scheduler/__init__.py
deluge/plugins/scheduler/scheduler/common.py
deluge/plugins/scheduler/scheduler/core.py
deluge/plugins/scheduler/scheduler/webui.py
deluge/plugins/scheduler/scheduler/gtkui.py
deluge/plugins/scheduler/build/lib/scheduler/__init__.py
deluge/plugins/scheduler/build/lib/scheduler/common.py
deluge/plugins/scheduler/build/lib/scheduler/core.py
deluge/plugins/scheduler/build/lib/scheduler/webui.py
deluge/plugins/scheduler/build/lib/scheduler/gtkui.py
deluge/plugins/notifications/setup.py
deluge/plugins/notifications/notifications/test.py
deluge/plugins/notifications/notifications/__init__.py
deluge/plugins/notifications/notifications/common.py
deluge/plugins/notifications/notifications/core.py
deluge/plugins/notifications/notifications/webui.py
deluge/plugins/notifications/notifications/gtkui.py
deluge/plugins/notifications/notifications/data/config.glade
deluge/plugins/notifications/build/lib/notifications/test.py
deluge/plugins/notifications/build/lib/notifications/__init__.py
deluge/plugins/notifications/build/lib/notifications/common.py
deluge/plugins/notifications/build/lib/notifications/core.py
deluge/plugins/notifications/build/lib/notifications/webui.py
deluge/plugins/notifications/build/lib/notifications/gtkui.py
deluge/plugins/notifications/build/lib/notifications/data/config.glade
deluge/plugins/stats/setup.py
deluge/plugins/stats/stats/test_total.py
deluge/plugins/stats/stats/test.py
deluge/plugins/stats/stats/__init__.py
deluge/plugins/stats/stats/graph.py
deluge/plugins/stats/stats/common.py
deluge/plugins/stats/stats/core.py
deluge/plugins/stats/stats/webui.py
deluge/plugins/stats/stats/gtkui.py
deluge/plugins/stats/stats/data/tabs.glade
deluge/plugins/stats/stats/data/config.glade
deluge/plugins/stats/build/lib/stats/test_total.py
deluge/plugins/stats/build/lib/stats/test.py
deluge/plugins/stats/build/lib/stats/__init__.py
deluge/plugins/stats/build/lib/stats/graph.py
deluge/plugins/stats/build/lib/stats/common.py
deluge/plugins/stats/build/lib/stats/core.py
deluge/plugins/stats/build/lib/stats/webui.py
deluge/plugins/stats/build/lib/stats/gtkui.py
deluge/plugins/stats/build/lib/stats/data/tabs.glade
deluge/plugins/stats/build/lib/stats/data/config.glade
deluge/plugins/webui/setup.py
deluge/plugins/webui/webui/__init__.py
deluge/plugins/webui/webui/common.py
deluge/plugins/webui/webui/core.py
deluge/plugins/webui/webui/gtkui.py
deluge/plugins/webui/webui/data/config.glade
deluge/plugins/webui/build/lib/webui/__init__.py
deluge/plugins/webui/build/lib/webui/common.py
deluge/plugins/webui/build/lib/webui/core.py
deluge/plugins/webui/build/lib/webui/gtkui.py
deluge/plugins/webui/build/lib/webui/data/config.glade
deluge/plugins/extractor/setup.py
deluge/plugins/extractor/build/lib/extractor/__init__.py
deluge/plugins/extractor/build/lib/extractor/common.py
deluge/plugins/extractor/build/lib/extractor/core.py
deluge/plugins/extractor/build/lib/extractor/webui.py
deluge/plugins/extractor/build/lib/extractor/gtkui.py
deluge/plugins/extractor/build/lib/extractor/data/extractor_prefs.glade
deluge/plugins/extractor/extractor/__init__.py
deluge/plugins/extractor/extractor/common.py
deluge/plugins/extractor/extractor/core.py
deluge/plugins/extractor/extractor/webui.py
deluge/plugins/extractor/extractor/gtkui.py
deluge/plugins/extractor/extractor/data/extractor_prefs.glade
deluge/plugins/execute/setup.py
deluge/plugins/execute/build/lib/execute/__init__.py
deluge/plugins/execute/build/lib/execute/common.py
deluge/plugins/execute/build/lib/execute/core.py
deluge/plugins/execute/build/lib/execute/webui.py
deluge/plugins/execute/build/lib/execute/gtkui.py
deluge/plugins/execute/build/lib/execute/data/execute_prefs.glade
deluge/plugins/execute/execute/__init__.py
deluge/plugins/execute/execute/common.py
deluge/plugins/execute/execute/core.py
deluge/plugins/execute/execute/webui.py
deluge/plugins/execute/execute/gtkui.py
deluge/plugins/execute/execute/data/execute_prefs.glade
deluge/plugins/example/setup.py
deluge/plugins/example/build/lib/example/__init__.py
deluge/plugins/example/build/lib/example/common.py
deluge/plugins/example/build/lib/example/core.py
deluge/plugins/example/build/lib/example/webui.py
deluge/plugins/example/build/lib/example/gtkui.py
deluge/plugins/example/example/__init__.py
deluge/plugins/example/example/common.py
deluge/plugins/example/example/core.py
deluge/plugins/example/example/webui.py
deluge/plugins/example/example/gtkui.py
deluge/plugins/freespace/setup.py
deluge/plugins/freespace/build/lib/freespace/__init__.py
deluge/plugins/freespace/build/lib/freespace/common.py
deluge/plugins/freespace/build/lib/freespace/core.py
deluge/plugins/freespace/build/lib/freespace/webui.py
deluge/plugins/freespace/build/lib/freespace/gtkui.py
deluge/plugins/freespace/build/lib/freespace/data/config.glade
deluge/plugins/freespace/freespace/__init__.py
deluge/plugins/freespace/freespace/common.py
deluge/plugins/freespace/freespace/core.py
deluge/plugins/freespace/freespace/webui.py
deluge/plugins/freespace/freespace/gtkui.py
deluge/plugins/freespace/freespace/data/config.glade
deluge/plugins/blocklist/setup.py
deluge/plugins/blocklist/build/lib/blocklist/peerguardian.py
deluge/plugins/blocklist/build/lib/blocklist/decompressers.py
deluge/plugins/blocklist/build/lib/blocklist/detect.py
deluge/plugins/blocklist/build/lib/blocklist/readers.py
deluge/plugins/blocklist/build/lib/blocklist/__init__.py
deluge/plugins/blocklist/build/lib/blocklist/common.py
deluge/plugins/blocklist/build/lib/blocklist/core.py
deluge/plugins/blocklist/build/lib/blocklist/webui.py
deluge/plugins/blocklist/build/lib/blocklist/gtkui.py
deluge/plugins/blocklist/build/lib/blocklist/data/blocklist_pref.glade
deluge/plugins/blocklist/blocklist/peerguardian.py
deluge/plugins/blocklist/blocklist/decompressers.py
deluge/plugins/blocklist/blocklist/detect.py
deluge/plugins/blocklist/blocklist/readers.py
deluge/plugins/blocklist/blocklist/__init__.py
deluge/plugins/blocklist/blocklist/common.py
deluge/plugins/blocklist/blocklist/core.py
deluge/plugins/blocklist/blocklist/webui.py
deluge/plugins/blocklist/blocklist/gtkui.py
deluge/plugins/blocklist/blocklist/data/blocklist_pref.glade
deluge/core/eventmanager.py
deluge/core/autoadd.py
deluge/core/authmanager.py
deluge/core/rpcserver.py
deluge/core/torrentmanager.py
deluge/core/oldstateupgrader.py
deluge/core/__init__.py
deluge/core/torrent.py
deluge/core/pluginmanager.py
deluge/core/core.py
deluge/core/daemon.py
deluge/core/alertmanager.py
deluge/core/preferencesmanager.py
deluge/core/filtermanager.py
deluge/ui/sessionproxy.py
deluge/ui/ui.py
deluge/ui/session.py
deluge/ui/tracker_icons.py
deluge/ui/__init__.py
deluge/ui/common.py
deluge/ui/Win32IconImagePlugin.py
deluge/ui/client.py
deluge/ui/countries.py
deluge/ui/coreconfig.py
deluge/ui/web/server.py
deluge/ui/web/web.py
deluge/ui/web/__init__.py
deluge/ui/web/common.py
deluge/ui/web/pluginmanager.py
deluge/ui/web/gen_gettext.py
deluge/ui/web/auth.py
deluge/ui/web/json_api.py
deluge/ui/gtkui/connectionmanager.py
deluge/ui/gtkui/torrentdetails.py
deluge/ui/gtkui/queuedtorrents.py
deluge/ui/gtkui/addtorrentdialog.py
deluge/ui/gtkui/__init__.py
deluge/ui/gtkui/status_tab.py
deluge/ui/gtkui/preferences.py
deluge/ui/gtkui/mainwindow.py
deluge/ui/gtkui/notification.py
deluge/ui/gtkui/ipcinterface.py
deluge/ui/gtkui/createtorrentdialog.py
deluge/ui/gtkui/torrentview.py
deluge/ui/gtkui/listview.py
deluge/ui/gtkui/systemtray.py
deluge/ui/gtkui/common.py
deluge/ui/gtkui/pluginmanager.py
deluge/ui/gtkui/menubar.py
deluge/ui/gtkui/sidebar.py
deluge/ui/gtkui/statusbar.py
deluge/ui/gtkui/filtertreeview.py
deluge/ui/gtkui/new_release_dialog.py
deluge/ui/gtkui/options_tab.py
deluge/ui/gtkui/peers_tab.py
deluge/ui/gtkui/details_tab.py
deluge/ui/gtkui/files_tab.py
deluge/ui/gtkui/gtkui.py
deluge/ui/gtkui/edittrackersdialog.py
deluge/ui/gtkui/removetorrentdialog.py
deluge/ui/gtkui/toolbar.py
deluge/ui/gtkui/dialogs.py
deluge/ui/gtkui/aboutdialog.py
deluge/ui/gtkui/glade/filtertree_menu.glade
deluge/ui/gtkui/glade/main_window.glade
deluge/ui/gtkui/glade/remove_torrent_dialog.glade
deluge/ui/gtkui/glade/create_torrent_dialog.glade
deluge/ui/gtkui/glade/connection_manager.glade
deluge/ui/gtkui/glade/preferences_dialog.glade
deluge/ui/gtkui/glade/torrent_menu.glade
deluge/ui/gtkui/glade/queuedtorrents.glade
deluge/ui/gtkui/glade/move_storage_dialog.glade
deluge/ui/gtkui/glade/add_torrent_dialog.glade
deluge/ui/gtkui/glade/dgtkpopups.glade
deluge/ui/gtkui/glade/tray_menu.glade
deluge/ui/gtkui/glade/edit_trackers.glade
deluge/ui/console/colors.py
deluge/ui/console/eventlog.py
deluge/ui/console/main.py
deluge/ui/console/__init__.py
deluge/ui/console/statusbars.py
deluge/ui/console/screen.py
deluge/ui/console/commands/plugin.py
deluge/ui/console/commands/info.py
deluge/ui/console/commands/recheck.py
deluge/ui/console/commands/quit.py
deluge/ui/console/commands/connect.py
deluge/ui/console/commands/help.py
deluge/ui/console/commands/add.py
deluge/ui/console/commands/config.py
deluge/ui/console/commands/__init__.py
deluge/ui/console/commands/cache.py
deluge/ui/console/commands/debug.py
deluge/ui/console/commands/pause.py
deluge/ui/console/commands/rm.py
deluge/ui/console/commands/halt.py
deluge/ui/console/commands/resume.py

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More