Compare commits

...

770 Commits

Author SHA1 Message Date
90e4de54e9 Do not include unnecessary dlls in windows build 2010-09-18 16:03:21 -07:00
c1505bea3a Update versions 2010-09-18 11:31:31 -07:00
6235e832fe include missing theme images 2010-09-18 00:48:22 +10:00
a71f14c47e include the .order files 2010-09-16 09:23:35 -07:00
ed3b23b0fc add all the other scripts to package_data 2010-09-16 09:23:19 -07:00
6402634ec1 Update win32 build files 2010-09-14 11:48:05 -07:00
3e68733cfd More clean-up of setup.py 2010-09-14 11:40:41 -07:00
f847a7dc4e Remove the custom 'install' class and include_package_data 2010-09-14 11:40:34 -07:00
c7954c20eb Fix preference page index when removing a preference page 2010-09-13 18:22:08 -07:00
dc7ed11601 Update ChangeLog 2010-09-13 16:11:57 -07:00
d898def9ec Fix bugs with unicode torrents in AutoAdd plugin. 2010-09-13 02:22:18 -04:00
3e2f6c4060 Fix bug in AutoAdd plugin where watchdirs would not display in gtkui when first enabled. 2010-09-13 02:22:17 -04:00
321a22a6f0 Increase max piece size to 8 MiB in create torrent dialog (closes #1358) 2010-09-13 08:53:19 +10:00
b4774af2f3 Fix VersionSplit behavior when comparing to a dev version. 2010-09-11 05:39:40 -04:00
d0fd709c74 AutoAdd plugin can now recover when one of the watchfolders has an unhandled exception. 2010-09-03 22:30:24 -04:00
e24212b3f8 Fix "adjustment with non-zero page size" deprication warning in autoadd plugin. 2010-09-03 22:28:41 -04:00
f8f72af6dc Add TorrentFileCompleted event. 2010-09-03 17:11:57 -07:00
b9caa4eeeb 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:29:36 -07:00
6c3b216b40 Use a temp filename with add_torrent_url 2010-08-31 00:11:58 +10:00
eaad867885 Update get_free_space test 2010-08-31 00:11:54 +10:00
f6b9f67df8 Fix error in last commit. 2010-08-26 02:33:24 -04:00
24fe3f7fd5 Ensure preferencesmanager only changes intended libtorrent session settings. 2010-08-26 02:23:40 -04:00
da2fb41a3a Fix scheduler so that it keeps current state, even after global settings change. 2010-08-26 01:39:40 -04:00
f8d7f22167 Ignore global stop ratio related settings in logic, so per torrent ones are used. 2010-08-24 22:47:24 -04:00
b75abc70e5 Add max active downloading and seeding options to scheduler. 2010-08-24 00:58:28 -04:00
2d821bd79a Merge branch '1.3-stable' of deluge-torrent.org:deluge into 1.3-stable 2010-08-23 17:35:31 -07:00
12d9a7a5bd Fix key error after enabling a plugin that introduces a new status key 2010-08-23 17:35:19 -07:00
c118fa36a9 Moved xdg import so it is not called on Windows, where it is unused. fixes #1343 2010-08-22 15:38:22 -04:00
82c91cdc51 AutoAdd plugin changes
adds queue to top option
adds ability to append extension instead of deleting torrent once added
2010-08-22 00:01:58 -04:00
5501094214 Fix unhandled exception when adding a torrent to the session 2010-08-21 12:54:19 -07:00
b41aa808be Fix issue where the save_timer is cancelled when it's not active 2010-08-21 12:54:13 -07:00
b9336889f5 Update version 2010-08-20 14:20:51 -07:00
995f5387eb Update windows files 2010-08-20 14:19:42 -07:00
38958d3c4f Update ChangeLog 2010-08-20 14:15:21 -07:00
b45e019f08 Fix man deluged not showing '-u' on its own line 2010-08-20 01:16:09 +10:00
d93fcf6eea Fix #1341 issue where Config would try to cancel the save_timer when it is None. 2010-08-18 12:32:11 -07:00
a2d75a5274 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:17:31 -07:00
8797c3ce1b 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:17:23 -07:00
79749cca03 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:05:21 -07:00
5fd8628761 fix the script resource on windows 2010-08-14 17:38:31 +01:00
0e80b3ea0a add the apple iOS bookmark icons from #1339 2010-08-14 16:15:18 +01:00
aa61d33ee2 Merge branch '1.3-stable' of deluge-torrent.org:deluge into 1.3-stable 2010-08-14 16:06:00 +01:00
13f29a77dd fix the system.listMethods json call when running in classic mode 2010-08-14 16:05:41 +01:00
97453d1411 Add test suite for SessionProxy 2010-08-10 09:58:28 -07:00
62d02091b3 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:26:23 -07:00
161ad0ff0d use the get_libtorrent.sh script to get libtorrent if it is missing 2010-07-22 21:13:27 +01:00
7f323ec0fc add libtorrent fetch script 2010-07-22 18:17:51 +01:00
05aebbb575 remove the libtorrent submodule 2010-07-22 18:04:49 +01:00
de85e1dcdc a couple of fixes to stop the webui crashing when running within the gtkui 2010-07-18 23:11:02 +01:00
1ce480ff23 Only use an icon if it passes some sanity checks 2010-07-17 17:13:15 +10:00
007a9912d2 Use a blank icon when the tracker icon downloaded isn't a proper image 2010-07-15 19:17:48 -07:00
d793b9e6b8 Attempt to create a move_storage destination path if it doesn't exist 2010-07-15 10:50:15 -07:00
72ec926c1a Do not attempt to move a torrents storage if the destination path does
not exist
2010-07-12 14:45:51 -07:00
0d431ae7db 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:53 -07:00
f1e0e3be15 Add logging the user when a torrent is added or removed 2010-07-05 21:10:16 -07:00
e8bf5eb592 Fix ChangeLog 2010-07-04 02:13:31 +10:00
d9a2c4db72 Fix uncaught exception when closing deluge in classic mode 2010-07-02 02:43:07 +10:00
8fb7277a82 Fix typo 2010-07-02 02:41:30 +10:00
35128cf18f more improvements to the shift select 2010-07-01 14:21:37 +01:00
6ff1da2391 fix select 'upwards' 2010-07-01 14:08:20 +01:00
4614188c62 update changelog 2010-07-01 13:46:27 +01:00
80297b8e45 allow for shift selecting in tree grids 2010-07-01 13:45:22 +01:00
9173a9cfdd Update Changelog 2010-06-22 18:26:43 -07:00
571d1079f6 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:25:50 -07:00
0497c407e1 Always look for -mt boost libraries first 2010-06-18 09:51:50 -07:00
8b58c960f3 fix typo 2010-06-12 22:48:00 +01:00
b615ebe1b8 change bits to bytes, thanks to charles 2010-06-11 15:59:33 +01:00
3ed8279219 Fix typo in label plugin - thanks konti 2010-06-11 00:51:46 +10:00
f2944bdeef Handle os.remove failing on windows 2010-06-08 03:20:48 +10:00
0fcd90ee2c Python independent version of previous commit 2010-06-08 01:57:13 +10:00
26460808e7 Fix console ui not liking paths with backslashes on windows (#1293) 2010-06-08 01:30:10 +10:00
7aba1af0b2 Print a more informative error message if the torrent file doesn't exist 2010-06-08 01:26:49 +10:00
4d2b7df49d Fix execute plugin only executing last event (#1306) 2010-06-08 00:20:07 +10:00
bd775d0d40 Only encode if necessary 2010-06-07 20:18:37 +10:00
7fb3c3c04c Fix unicode support in console ui (#1307) 2010-06-07 20:18:35 +10:00
19c27ee8c5 Add some debug logging statements 2010-06-04 18:05:27 +01:00
d69b8e1099 Fix an error in the key 2010-06-04 17:37:45 +01:00
88daf82cb0 Fix saving the correct event name 2010-06-04 16:37:50 +01:00
99c1a61383 Save the execute config after adding/removing/saving commands 2010-06-04 16:30:51 +01:00
2e55769c18 Fix typo in execute plugin 2010-05-20 00:06:18 +10:00
259d2633e7 Fix man deluged not showing '-d' on its own line 2010-05-16 22:32:59 +10:00
8e5aab660c Fix remote save path dialog not disappearing after creating a torrent 2010-05-16 18:13:34 +10:00
fc96e9d02c Fix only being able to click "remote path" once when creating a torrent 2010-05-16 18:13:31 +10:00
821d403a6c Fix deluged crashing on windows when logfile's directory doesn't exist 2010-05-16 13:12:51 +10:00
5e0d988ef0 Revert "Fix trac wiki turning CamelCase words into broken links"
This reverts commit 925ac42f7c.
2010-05-11 23:46:48 +10:00
925ac42f7c Fix trac wiki turning CamelCase words into broken links 2010-05-11 23:29:02 +10:00
1ac72b81b6 Update email address and copyright 2010-05-11 03:52:17 +10:00
3417caf1d2 Fix label plugin not remembering newly created labels 2010-05-09 17:52:29 +10:00
1bcfc91c35 Remove unused code from label plugin 2010-05-09 17:52:25 +10:00
6ee0e5b6be Update docstrings to use names from previous commit 2010-05-09 17:07:11 +10:00
58a74202e1 Use better names for TrackerIcons' args 2010-05-09 17:01:47 +10:00
a4c6f4e8c9 Return the noIcon for empty strings as well 2010-05-09 16:44:12 +10:00
60f3d32de7 Raise IconsError instead of IndexError (fixes infinite looping) 2010-05-09 16:36:54 +10:00
b3eed8a1f0 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:10:12 -07:00
37137d9b54 Return 0 in get_free_space if the download_location is invalid 2010-05-08 20:09:57 -07:00
4fb14b581d Use previously defined host variable instead of getting the tracker host from the TreeModel 2010-05-08 20:09:49 -07:00
98da4d0291 Do not request a tracker icon if the host is "" 2010-05-08 20:09:37 -07:00
f0c06f4bc5 Update Changelog 2010-05-08 11:50:19 -07:00
63d701305c rebuild deluge-all and ext-extensions 2010-05-08 16:19:40 +01:00
99396afa0c update the build files for deluge-all and ext-extensions 2010-05-08 16:19:40 +01:00
6231dbd1ca fix the null comparison 2010-05-08 16:19:40 +01:00
8f021c7f06 set the baseCls for the add label form panel to x-plain 2010-05-08 16:19:40 +01:00
6bb4559d18 Make host_to_url support redirection and add another test 2010-05-08 16:26:08 +10:00
7c9eea0361 Try favicon.ico if there's a HTMLParseError 2010-05-08 15:50:57 +10:00
15247507d4 Fix relative redirecting in blocklist plugin 2010-05-06 23:31:25 +10:00
10de8d5475 Remove plugins that aren't release ready 2010-05-05 17:48:04 -07:00
e304c1f719 update the ChangeLog 2010-05-05 23:03:19 +01:00
48d3e89d84 Update windows build files 2010-05-05 15:01:52 -07:00
44f9e17a09 Update version
Update ChangeLog
2010-05-05 14:52:18 -07:00
e7907a63ee fix uploading plugins in shit browsers 2010-05-05 12:25:34 +01:00
cee416b1b5 fix expanding nested folders in the files tab 2010-05-05 11:55:21 +01:00
53a9c217e7 Fix tracker_icons not handling relative redirects 2010-05-05 04:05:52 +10:00
d6c8b13041 Handle trackers with incorrect / missing icon mimetypes 2010-05-05 03:19:54 +10:00
ba03356151 Add more HTTP status codes to httpdownloader 2010-05-05 02:49:55 +10:00
d28cf93686 Rename mimetype helper methods and rewrite to use a common dict 2010-05-05 02:31:05 +10:00
452656e09d remove some trailing commas that break the ui in IE 2010-05-04 12:02:49 +01:00
9c460266ac add _trial_temp to the gitignore file 2010-05-04 00:30:54 +01:00
bb0bd36c51 Properly fix creating torrents in the gtkui with non-ascii filenames 2010-05-04 00:28:24 +01:00
5ea7e21943 add some icon preloading and improve the statusbar css classes 2010-05-04 00:09:20 +01:00
facb4669e3 add the ubuntu icon 2010-05-03 22:01:20 +01:00
e4ef17975c stop parsing the html page once the parser has left the <head> of the page 2010-05-03 21:28:25 +01:00
c4b20aa595 Fix error when requesting a tracker icon for None 2010-05-03 13:24:54 -07:00
bc028998d7 Fix some tests in test_core 2010-05-03 13:13:26 -07:00
7e7da94a6e fix the Tracker resource for the webui 2010-05-03 20:52:38 +01:00
53930e0898 handle non-supported images/files in the icons folder 2010-05-03 20:38:57 +01:00
b13adbafbf add an ok icon and use it for the connection restored status 2010-05-03 20:32:22 +01:00
556c8b831a Update translation template 2010-05-03 11:50:16 -07:00
a6d10562f1 Don't request a tracker icon for labels or tracker states 2010-05-04 04:37:41 +10:00
a8ac98bb37 Update web ui to use new TrackerIcons 2010-05-04 04:37:41 +10:00
d7fa383da3 Update gtk ui to use new TrackerIcons 2010-05-04 04:37:41 +10:00
6ded75caef Remove no longer needed fetch_url 2010-05-04 04:37:41 +10:00
88929d4821 Rewrite tracker_icons.py (#995) 2010-05-04 04:37:19 +10:00
8747611e9e Add decorators module and test file 2010-05-04 04:33:21 +10:00
acba442ddb fix encoding issues where the users filesystem isn't utf-8 (needs testing) 2010-05-03 18:43:31 +01:00
5b0f93ba72 improve behaviour when webserver goes away 2010-05-03 02:14:51 +01:00
619092aee0 fix plugin info displaying upon select 2010-05-03 02:01:21 +01:00
89fb5b02d7 move the InstallPluginWindow class out of the PluginsPage file
convert the plugins grid over to a listview
2010-05-03 01:54:25 +01:00
75b69b1f11 fix setting the root node 2010-05-03 00:31:49 +01:00
f5eddafea9 tidy up the code for the files tab 2010-05-02 23:20:45 +01:00
d49e1eda79 fix updating the file tree in the file details tab 2010-05-02 23:00:05 +01:00
e86d2ad4e2 apply unicode patch from nullie, fixes (#1140) 2010-05-02 22:13:14 +01:00
5effdd4cd4 store listen_ports and outgoing_ports as tuples for the config set, fixes #1242 2010-05-02 18:32:21 +01:00
c2b4fad389 implement getting and saving label options 2010-05-02 18:16:07 +01:00
82a5b5262c fix the torrent grid, clear the torrents on disconnect, not logout 2010-05-02 18:16:07 +01:00
1b0e08b3d9 fix disabling the execute plugin 2010-05-02 18:16:06 +01:00
49ec3a1535 remove the paranthesis from the @exports 2010-05-02 18:16:06 +01:00
23544bd6b2 Close the connection manager on shutdown - patch from Jan Steffens 2010-05-02 22:39:25 +10:00
5766e04987 Fix deluge-gtk hanging on shutdown (#1247) - thanks Jan Steffens 2010-05-02 22:39:18 +10:00
0857af98d0 fix the spinner limits in the label options 2010-04-30 22:06:49 +01:00
5e78daf726 fix the spinners on the various preference pages 2010-04-30 22:06:32 +01:00
1efb700ed8 enable and disable the form fields upon the checkbox change 2010-04-30 21:34:28 +01:00
e0153e8bdc disable the JSON component upon webserver stop 2010-04-30 14:11:36 +01:00
b46562d932 disable the webui plugin settings and display an error message when deluge-web is missing 2010-04-30 14:04:15 +01:00
5c8eccdd82 reduce the size of the details panel 2010-04-30 13:31:17 +01:00
c45583e8e7 enable and disable the panel toolbar buttons upon selection change 2010-04-28 17:46:21 +01:00
ce46dcdf7a implement the webui so commands can be modified 2010-04-28 17:42:58 +01:00
63f5c8b116 add the icon-edit class, use the same icon as edit trackers 2010-04-28 16:58:07 +01:00
111bea19d9 fix #1240 and #1208 2010-04-28 16:43:14 +01:00
68f0e9ddc7 renderer the event column correctly and remove the bottom panel 2010-04-28 16:09:53 +01:00
5e1f6a8738 switch the gridpanel to a listview 2010-04-28 15:51:47 +01:00
28a313e74e fix up the label plugin making it more stable and work with the new filter panel api 2010-04-28 15:43:06 +01:00
5b6faa47b0 fix the header click event handler 2010-04-28 15:39:39 +01:00
0f12200f6f store the states as a dictionary 2010-04-28 15:33:05 +01:00
7420c6f12f use the header click event to ensure that the filters get updated
correctly
2010-04-28 15:29:40 +01:00
fb0adbcded return this.states instead of the store contents 2010-04-28 15:25:31 +01:00
59b7a175eb store the states without the zero values removed as this.states 2010-04-28 15:24:49 +01:00
cbcd277d91 remove windows line breaks (grr) 2010-04-28 15:19:28 +01:00
269e0b89b6 dont enable plugins twice 2010-04-28 15:10:58 +01:00
698a5ff475 update the deluge.config dictionary with the new values 2010-04-28 14:20:31 +01:00
fd122db7b7 change the multiple filters to be configurable, deprecating the show trackers with zero torrents option 2010-04-28 14:15:50 +01:00
67905b6f5b fix enabled plugins after connecting to a daemon 2010-04-28 14:00:39 +01:00
7df7f13e26 select the text when focusing the password field 2010-04-28 13:41:09 +01:00
066d199c78 fix setting a custom limit when one is already set
focus and select the spinner contents upon window show
2010-04-28 13:39:56 +01:00
c8c5e3449a add a window that allows you to quickly set a custom bandwidth limit 2010-04-28 13:28:47 +01:00
00dc5f0128 remove the button to launch the unfinished file browser 2010-04-28 13:28:00 +01:00
cd10555a8a construct the statusbar in the ui initialisation 2010-04-28 12:40:54 +01:00
158feaa8e0 integrate the statusbar menus into the statusbar and have the limit change handler in the deluge statusbarmenu class 2010-04-28 12:37:35 +01:00
3310cc636f move the statusbar menu class out into a seperate file 2010-04-28 12:03:07 +01:00
9849a16d2c rename files to match the classes they contain 2010-04-28 11:55:07 +01:00
bf28b3ac31 fix the connection manager when the ui disconnects from a daemon so it doesn't end up in a loop 2010-04-28 11:50:56 +01:00
759ae6356d remove the function wrap from the connection manager 2010-04-28 11:28:51 +01:00
c0fd70a856 fix removing the filter panels upon disconnect 2010-04-28 10:45:38 +01:00
028a35bfc8 fix adding an already removed torrent 2010-04-28 10:42:25 +01:00
fec735f948 fix the first item being selected upon creation 2010-04-28 08:42:29 +01:00
9f185da446 update the proxyfield comboboxes and switch some simplestores to arraystores 2010-04-28 08:24:37 +01:00
8414b9cfa9 fire only one event per check, pass an array of nodes
implement #1161 for the webui
2010-04-28 01:06:28 +01:00
91f44c2ad3 fire the same args as the OptionsManager changed event 2010-04-28 00:48:37 +01:00
31304d3397 lazily set the value if the items aren't rendered yet and re-enable setting the allocation in the add window 2010-04-27 23:58:30 +01:00
310b4bad31 allow the allocation to be changed again 2010-04-27 23:49:11 +01:00
9e7dde8997 change radiogroups so they can be used as a single form field 2010-04-27 23:48:04 +01:00
dfde04561f adjust the width of the columns in the con manager 2010-04-27 23:31:12 +01:00
545e4ef717 fix the change event on the spinner group 2010-04-27 23:26:31 +01:00
b1cf238489 show the preferences window when the protocol traffic and freespace icons are clicked 2010-04-27 23:19:52 +01:00
7fe5d37094 fix the spinnergroup widths 2010-04-27 23:18:03 +01:00
a7940d5bf9 use deferredRender: true on the card layout to fix the spinnergroups and
comboboxes
2010-04-27 22:56:02 +01:00
e0e2b1b350 improve the page switching 2010-04-27 22:05:15 +01:00
a58c391675 use blank classes for the sorter in the edit trackers window 2010-04-27 21:49:27 +01:00
9f46958f20 tidy up and convert the gridpanel to a listview 2010-04-27 21:40:55 +01:00
dd82f95975 split out the add connection window into a seperate file 2010-04-27 11:58:39 +01:00
67e27b9b7a fix reporting connection errors on the console (Closes: #1228) 2010-04-27 11:01:01 +01:00
1cc315878a complete the layout of the label options window 2010-04-27 10:31:53 +01:00
412b96ba55 xml escape notifications sent via libnotify (Closes: #1185) 2010-04-27 10:31:53 +01:00
d6b7917350 Fix test_add_torrent_url_with_cookies 2010-04-27 03:01:54 +10:00
8b23af062a add the layout for the maximum tab 2010-04-26 01:34:35 +01:00
3b1d038d2d add missing getFilter function and improve hasFilter 2010-04-26 01:34:35 +01:00
a47f9bc8dd make enabling the plugin more robust 2010-04-26 01:34:35 +01:00
466b245fdf make it easier to manipulate filters 2010-04-26 01:34:35 +01:00
bfdaa47aff add helper methods for adding and removing columns to the torrent status grid 2010-04-26 01:34:35 +01:00
c3290b4ac2 add the save path column to the grid 2010-04-26 01:34:35 +01:00
342001c642 implement the handler for the torrent menu 2010-04-26 01:34:35 +01:00
b4404feed7 add 2 new methods that return the torrent ids to make rpc calls easier 2010-04-26 01:34:35 +01:00
85c0725f83 add a method to get the current states in the filter 2010-04-26 01:34:35 +01:00
29634505e4 remove the old web templates 2010-04-26 01:34:35 +01:00
faa1752d04 select the first filter if the current selected one is removed 2010-04-26 01:34:35 +01:00
2edf19c187 fix displaying empty '' filters 2010-04-26 01:34:35 +01:00
42b3dc7dde add the ability to add labels
set the filter panel to show_zero
2010-04-26 01:34:35 +01:00
80f151be94 move the state updating into the FilterPanel to allow for a custom show_zero value to
be specified
2010-04-26 01:34:34 +01:00
c8ada0ba07 only enable the extra menu options if it is a label 2010-04-26 01:34:34 +01:00
e05384909a add inital options window layout
implement removing labels
specify a custom template for the label filters
2010-04-26 01:34:34 +01:00
3a12a50f3e allow custom templates to be specified for filters 2010-04-26 01:34:34 +01:00
5b0ce6b3d8 remove the function wrap and deluge.sidebar construction 2010-04-26 01:34:34 +01:00
9cde1f3e45 initial implementation of the label plugin webui, purely a mock up at the moment 2010-04-26 01:34:34 +01:00
1825ce09fb fix removing filters that no longer exist
add a filtercreate event
2010-04-26 01:34:34 +01:00
62158d7861 Renamed raiseError to raisesErrorsAs 2010-04-26 02:54:13 +10:00
4de8e57f56 remove some accidental alerts 2010-04-24 01:44:22 +01:00
a3d9b93480 register the execute plugin 2010-04-24 01:42:11 +01:00
7e12222d33 create a plugin registration system to allow for plugin loading on the fly
remove the plugin event handlers from the event manager
fix enabling/disabling plugins when the preferences page hasn't been rendered yet
2010-04-24 01:40:34 +01:00
bf2fc64ce0 remove an unrequired function() wrapping 2010-04-24 00:43:24 +01:00
3fdfedb7f7 revert previous change, we want remove_script to throw an error if the script doesn't exist
fix remove debug and dev scripts in the pluginmanager
2010-04-24 00:34:42 +01:00
01e847b997 fix the execute plugin disabling and change the namespace of the preferences page 2010-04-23 23:48:29 +01:00
50162694b5 fix plugin disabling 2010-04-23 23:47:10 +01:00
ade5f596f4 don't raise an error if the script isn't in the resource 2010-04-23 23:43:20 +01:00
8b7c1681ae fix the execute plugins webui section 2010-04-23 19:30:40 +01:00
2376e857d2 fix up the deluge-web plugin interface 2010-04-23 19:30:40 +01:00
d024c293ed Revert previous change 2010-04-20 20:08:08 -07:00
54617db03f Allow accessing network shares when adding torrents 2010-04-20 12:25:18 -07:00
70580e35db Fix starting plugins 2010-04-20 08:56:07 -07:00
8d02fc3db6 Fix #1238 starting plugins in the gtkui 2010-04-20 08:50:20 -07:00
112b0dc1f0 fix the zeroPad calls in the date function 2010-04-20 08:32:11 +01:00
3fcdcc8eec couple of tweaks to the plugin page layout 2010-04-19 23:17:27 +01:00
7711239452 add the updated override to FormLayout to allow for the field labels to be hidden/shown with field.show()/field.hide() 2010-04-19 22:29:11 +01:00
283cff7852 Apply patch supplied in #1235 to add the time to fdate 2010-04-19 22:27:12 +01:00
fb4bfe7656 re-add the SpinnerGroup type and enable the Network preferences page 2010-04-19 17:08:08 +01:00
070443f811 only use the fix for webkit browsers 2010-04-19 16:29:40 +01:00
76483bf766 restructure the ext-extensions folder and fix some copyright headers 2010-04-19 15:35:33 +01:00
dd1716c240 improve the selective downloading adding support for directories and don't recreate treenodes 2010-04-19 15:35:33 +01:00
c176ff900f fix updating the columns if the node hasn't yet been rendered 2010-04-19 15:35:33 +01:00
9e8d588a05 add a method to TreeGridNodeUI that allows column values to be updated 2010-04-19 15:35:33 +01:00
0fbbf4ac6c fix setting file download priority in the add window 2010-04-19 15:35:33 +01:00
61dd9a5589 Fix setting config values in the console ui including setting paths with
spaces in them
2010-04-18 18:07:26 -07:00
9a632fc3d3 1234: Add time to the torrents added date - patch from tobbez 2010-04-18 14:52:18 -07:00
e0f2c2473e fix error, use os.makedirs instead of os.mkdir, effectively mkdir -p 2010-04-17 22:13:17 +01:00
80e480854e Fix fsize by initialising gettext 2010-04-16 00:08:56 +10:00
86232cac8e Fix #1113 set move on completed to False after a success storage move 2010-04-14 15:49:21 -07:00
bba825703b refs #1180, old label preferences are removed from torrent when new label is set 2010-04-13 15:21:49 -04:00
3f3f7bb5b4 Fix #1225 by reverting change to fix #1180 since that isn't really
considered a bug and just causes more issues
2010-04-13 10:15:10 -07:00
047bdf9e3e Only pause torrents when importing blocklist on startup 2010-04-12 20:42:37 +10:00
0ae609c6df Apply patch from #1226 to allow use of certificate chain files 2010-04-11 23:14:07 +01:00
76fa8e707a Split out the OptionsPanel into seperate classes and files 2010-04-11 23:11:54 +01:00
fdc7d3d7fc Fix #1098 use triple quotes in the docstrings of the generated methods 2010-04-11 11:24:45 -07:00
35dfcf3a77 Pause transfers until blocklist is imported (#861) 2010-04-12 01:01:02 +10:00
f21dd242f6 Fix renaming files in add torrent dialog 2010-04-12 00:07:50 +10:00
8bafc9f966 tidy up and rename Remove.js to RemoveWindow.js 2010-04-09 22:13:42 +01:00
901d2d715c Fix #1222 do not try to set options on a torrent_id that is no longer in the session 2010-04-09 13:05:02 -07:00
02b71451c6 Fix enabling the Freespace plugin by initalizing self._timer on enable()
Stop the timer on disable()
2010-04-09 11:21:07 -07:00
6e737518d8 Fix splitting folders in add torrent dialog (fixes #1112) 2010-04-10 01:01:08 +10:00
addda6cfcc Fix #640 make file size suffixes translatable 2010-04-08 17:43:57 -07:00
afa283cd2d Add an errback for when calling a component's start() fails and revert it back to a Stopped
state in this case
2010-04-08 17:16:28 -07:00
84b33c3418 Fix get_torrent_status by creating a status dict from the cache after it's been updated 2010-04-08 17:09:55 -07:00
a15500d472 Fix menu item icons and glade warnings 2010-04-08 17:01:43 -07:00
7d4c791241 Fix #1180 properly set default options when switching a torrent label 2010-04-08 16:49:40 -07:00
4be615b084 Fix #1218 improper use of callLater 2010-04-08 15:00:07 -07:00
8e4d88f03c implement moving trackers up/down 2010-04-08 17:51:49 +01:00
38c85cf7bb convert the EditTrackers window to use a ListView and split out the various windows
into seperate files
2010-04-08 17:38:16 +01:00
bc165133d0 Fix get_torrent_status returning all keys when cache is outdated 2010-04-08 00:41:48 +10:00
117fe3bb43 Fix the sessionproxy when using keyworded filters.
The caching of state filters has been removed to simplify things a bit.  This shouldn't have too much
impact since the torrent status requests are still using diffs.
2010-04-02 15:53:03 -07:00
5dab17df89 Fix #1210 save sort column order in files tab -- patch from squisher 2010-04-02 12:46:18 -07:00
3560dac792 convert the PreferencesWindow over to using a ListView rather than a
GridPanel
2010-04-02 16:46:32 +01:00
c970a80030 finish converting the AddWindow over to a ListView 2010-04-02 15:44:26 +01:00
09de50ec18 import PIL.Image rather than just Image 2010-04-01 10:10:56 +01:00
78a1ef0cc5 Fix unintended revert of change 2010-04-01 09:55:16 +01:00
d2d9269c87 Close #1205 add free space icon to gtkui 2010-04-01 09:55:15 +01:00
0d091cdacc replace ∞ with its html code &infin; 2010-04-01 09:55:15 +01:00
ac7a1f0065 fix bug showing the menu via key in the torrentview (Closes #1191) 2010-04-01 08:30:30 +01:00
772653d872 Fix unintended revert of change 2010-03-31 20:14:39 -07:00
ce23ff34a7 Close #1205 add free space icon to gtkui 2010-03-31 18:15:29 -07:00
c1200ed63f use getHeaders which is backwards compatible with twisted 2010-04-01 01:19:46 +01:00
af17346ac6 return a valid version 2 filetree 2010-03-31 20:35:44 +01:00
e9a922f829 Fix #1145 show deluge instead of hiding if it is behind other windows 2010-03-31 11:47:54 -07:00
387ea4a911 fix when there is only 1 file 2010-03-31 17:42:46 +01:00
7f1dadf3cd remove all the trailing commas as ie doesn't like them 2010-03-31 17:21:16 +01:00
2417e8537b resize tracker icons if they are too big and PIL is installed 2010-03-31 15:40:40 +01:00
91692bc966 use object format rather than dictionary 2010-03-31 15:40:40 +01:00
4296344502 handle losing connection to the webserver so we don't get stuck firing off loads of ajax requests 2010-03-31 15:40:39 +01:00
7053163f88 use FileTree2 in the TorrentInfo class when specified
adjust the filetree walking functions to match the server side code
2010-03-31 15:40:39 +01:00
14d9f6b7ba fix displaying directory names
tidy up and fix the size of the files being displayed
tweak the layout of the OptionsTab
2010-03-31 15:40:39 +01:00
692ec5bb1b clean up the Url window a little bit and rename Url.js to UrlWindow.js
create the FileWindow on demand and change the filename to match the classname
2010-03-31 15:40:39 +01:00
6039280fb5 split out the AddWindow file into multiple files for easier management 2010-03-31 15:40:39 +01:00
48876fa45c tidy up the file window and fix using Deluge.Client still 2010-03-31 15:40:39 +01:00
ae54d3fa18 Fix creating remote torrents 2010-03-30 16:44:26 -07:00
47509ee705 fix up the FilterPanel and the css class for the selected item 2010-03-30 19:25:50 +01:00
47a80526b3 begin a tidyup of the sidebar, switching from a GridView to a ListView which is faster 2010-03-30 17:33:56 +01:00
183064f857 store the other menu item when we encounter it looping over for later 2010-03-30 14:31:36 +01:00
7c5dacba5f use Number.MAX_VALUE rather than 99999 2010-03-30 14:27:53 +01:00
1c807ad7c8 fix tracking spinner values 2010-03-30 14:27:41 +01:00
6d83556ba8 clear oldData when clear() is issued which fixes data disappearing in the details tab 2010-03-30 13:45:04 +01:00
de9ba4986d fix a couple of issues with the values in the status tab 2010-03-30 13:31:33 +01:00
2956a7db54 Keep track of newly added torrents in the SessionProxy 2010-03-29 18:49:41 -07:00
76de427b96 remove a needless loop in the update_ui() method call 2010-03-30 00:21:37 +01:00
e9df745dd0 move the ProxyField into the preferences package 2010-03-29 23:43:48 +01:00
bf224b0556 tidy up the encryption page 2010-03-29 23:43:20 +01:00
79e62e6069 add a fix for triggerfields in the preferences page 2010-03-29 23:35:53 +01:00
7b84f54974 make greater use of the SessionProxy 2010-03-29 20:22:15 +01:00
4ca14d68c1 make use of the sessionproxy 2010-03-29 20:12:08 +01:00
ee9c7d1971 Fix #1202 set self.state during instantiation regardless of the libtorrent state 2010-03-29 10:57:29 -07:00
7dff81b60b Fix some typos 2010-03-28 22:20:47 -07:00
66bd2e3030 Add sessionproxy.rst 2010-03-28 12:45:51 -07:00
da9af84dc1 Add new component SessionProxy
Use SessionProxy in place of core.get_torrent_status calls
2010-03-28 12:43:23 -07:00
0b44023f92 update all the copyright headers 2010-03-28 13:02:09 +01:00
dd8400558c use a platform agnostic way of combining paths in the FileTree 2010-03-28 12:16:35 +01:00
61b5659972 fix the toggle field and scrolling in the preferences window 2010-03-28 12:16:35 +01:00
c987b74d61 split out the ProxyField to a seperate file 2010-03-28 12:16:35 +01:00
c430ef9a84 Merge branch 'master' of deluge-torrent.org:deluge 2010-03-27 20:07:51 -07:00
7be5b4c8bc Add 2 new states to Component: Starting and Stopping
Fix issue where a Component could have it's start and stop methods called more than once while waiting for their deferreds to fire
2010-03-27 20:05:20 -07:00
ab38ca2ad4 fix the order of the data directory and add peer record ip address sorting again 2010-03-28 03:45:02 +01:00
4d5d31a2b0 add support for defining order via a .order file 2010-03-28 03:45:02 +01:00
eaa03a6f2c change a Deluge.Events to deluge.events 2010-03-28 03:45:01 +01:00
01bb9c4df5 initial commit of the big javascript refactor 2010-03-28 03:45:01 +01:00
46a6576c68 Fix test_component to properly return deferreds from it's test methods 2010-03-27 19:43:42 -07:00
0182641bbb Use the python diff for *.py 2010-03-27 18:51:50 -07:00
e939f17654 fix updating the peers grid 2010-03-27 15:00:48 +00:00
17903c78d4 update the sorter to point to the correct function 2010-03-27 15:00:47 +00:00
676c59c318 rename Deluge.Sorters to Deluge.data.SortTypes and reflect this within the file 2010-03-27 15:00:47 +00:00
4ec10575f3 fix the records names to match the json object we receieve 2010-03-27 15:00:47 +00:00
323638a751 add a new namespace for data records, Deluge.data
rename Deluge.Torrent to Deluge.data.Torrent
add new file Deluge.data.Peer that contains records in the Peers grid
add a singleton that contains sort functions
2010-03-27 15:00:47 +00:00
ce0dc49572 Update .gitignore file to work with git <= 1.6 2010-03-27 17:28:44 +11:00
3f0edee17a Add win32 files from 1.2-stable to keep in sync 2010-03-26 13:14:51 -07:00
ea65974dc2 Remove old win32 files 2010-03-26 13:13:58 -07:00
ddd0f40d4c Add .gitattributes file 2010-03-26 13:12:30 -07:00
12b2f47762 Merge branch 'master' of deluge-torrent.org:deluge 2010-03-26 13:10:58 -07:00
250471fe47 Add .gitignore file 2010-03-26 13:10:35 -07:00
1a26287a5a Merge branch 'master' into autoadd
Conflicts:
	deluge/plugins/pluginbase.py
2010-03-26 11:16:03 -04:00
5c42cfbf64 Fix pluginbase 2010-03-25 15:01:15 -07:00
1cfc4f522e Merge branch 'master' into autoadd 2010-03-25 17:56:20 -04:00
73db03a33b Fix up some docstrings 2010-03-25 14:43:15 -07:00
efe2c06347 remove some useless code 2010-03-25 17:41:15 -04:00
53fd0a57ee add quotes around attribute name 2010-03-25 15:55:01 -04:00
017d1e058e autoadd plugin will now transfer settings from core autoadd folder 2010-03-25 15:30:54 -04:00
e7e480cf3e Fix up some docstrings 2010-03-25 12:01:40 -07:00
c978c6d016 Fix test_alertmanager 2010-03-25 11:47:05 -07:00
8fb56f0410 Update versions in the man files 2010-03-25 10:49:51 -07:00
211d0bee5d Added autoadd plugin 2010-03-25 12:03:36 -04:00
e7c7b8f4db Fix typo 2010-03-24 22:55:45 -07:00
78f9f22a40 Raise a KeyError exception if trying to stop a component that hasn't
isn't registered
2010-03-24 22:52:03 -07:00
c8f2173a04 Use a hack to get the version instead of relying on pkg_resources. This allows the docs to be built without having to install deluge. 2010-03-24 15:36:28 -07:00
256ae0745c Update year 2010-03-24 14:29:17 -07:00
8dad06cfbd Fix some typos 2010-03-24 14:17:58 -07:00
b8270be10f Add ability for plugins to set their component update interval by
setting a 'update_interval' value in their object.
2010-03-24 13:29:41 -07:00
afbca066d7 Fix typo in super call 2010-03-24 13:24:04 -07:00
ee8531aa24 update the debug and compressed js files 2010-03-24 18:04:06 +00:00
7d27b847fb remove unrequired attributes from the button configs 2010-03-24 18:03:38 +00:00
73ec9b0338 Fix the progress bars for directories, was calculating the progress incorrectly 2010-03-23 23:45:52 +00:00
4005003003 remove the last of the resources that used absolute paths and move them to css with relative paths 2010-03-23 23:20:03 +00:00
3e4f2f94dd fix the progress bar usage 2010-03-23 14:36:34 +00:00
d39b5bd071 fix the name for the add window instance 2010-03-23 11:09:49 +00:00
52ea19249c Fix issue where plugins would try to be stopped after they have been
deregistered
2010-03-22 19:59:11 -07:00
a93bbc35a1 Merged test_versionsplit.py into test_common.py 2010-03-22 18:16:17 +11:00
79ab0f118f Add test case for deluge/common.py 2010-03-22 18:11:21 +11:00
9d13b17a3c Fix VersionSplit comparison to do a proper compare and not simply
against the version strings
2010-03-21 15:57:53 -07:00
6aacc6e75c add 2 extra debug logging statements to the Upload controller 2010-03-21 18:59:05 +00:00
c03f519f9a add some base parameter validation 2010-03-21 10:33:02 +00:00
c6caae848f Fix another problem with component change 2010-03-20 20:54:36 -07:00
5945b24476 Fix pluginmanagerbase using new component module 2010-03-20 19:29:36 -07:00
606b623d73 AlertManager will now cancel all pending delayedCalls prior to stopping. 2010-03-20 19:15:33 -07:00
16b832f7ab Fix importing libtorrent 2010-03-20 19:15:33 -07:00
b0714f625f Rewrite component module to handle deferreds properly
Add test_component
Fix test_core to work with new component module
2010-03-20 19:15:33 -07:00
670ad51de1 drop the Config resource and just include it in a script tag on the index page
this allows for dynamic base setting
add support for setting the base via a request header X-Deluge-Header
2010-03-20 14:14:46 +00:00
986e632475 add a missing Ext.namespace in order to create Deluge.preferences 2010-03-20 14:14:30 +00:00
f08c0e053c tidy up doc strings and change InstallPlugin to InstallPluginWindow 2010-03-20 13:35:21 +00:00
fd9dc2d892 add the new command line switches that deluge-web has 2010-03-20 12:41:51 +00:00
67bcaa267a allow the base path to be specified by a command line switch on deluge-web 2010-03-20 12:01:02 +00:00
5a9b671c85 add the jsdoc showing it extends from Ext.util.Observable 2010-03-20 11:26:54 +00:00
af9eeb02b0 rename Deluge.Events to Deluge.EventsManager 2010-03-20 11:02:13 +00:00
ff1ad9d764 fix logging out 2010-03-20 11:01:44 +00:00
7e5e28ea2b update to the new namespace format 2010-03-19 08:48:13 +00:00
51555cab83 fix the quick limits menus
fix displaying speeds with limits
2010-03-18 23:01:42 +00:00
dd866f07de big refactor to meet the new coding style to allow for tidier namespaces 2010-03-18 22:56:18 +00:00
26defff7fc fix building after the theme switch about 2010-03-18 12:41:07 +00:00
7947773a88 move the docs generating out of the js folder and include ext-js when generating the docs 2010-03-17 23:54:59 +00:00
ed03721789 upgrade to extjs 3.1.1 2010-03-17 23:17:13 +00:00
0f6cab42a8 reorganise the themes to make it easier to upgrade extjs 2010-03-17 23:13:32 +00:00
4031b9f94b ensure that we are definitely using the filename 2010-03-17 23:09:44 +00:00
a23648c657 fix the statusbar bandwidth limits (Closes: #1181) 2010-03-17 00:10:33 +00:00
9672480d39 add support for selecting multiple filters 2010-03-16 23:47:44 +00:00
7a115622df add "All" to the list of filters for tracker hosts 2010-03-16 23:44:38 +00:00
f7071b4428 fix the sidebar and torrent filtering (Closes: #1176) 2010-03-16 22:42:52 +00:00
296d790421 If the torrent has been added via a magnet link then try and extract the name from the dn key in the url. Fixes #1154. 2010-03-16 01:14:27 +00:00
228d623aef compress the response of Upload 2010-03-15 12:12:44 +00:00
e83737805d show the connection manager when the ui disconnects 2010-03-14 10:00:04 +00:00
2952a5a7a3 fix up the statusbar switching 2010-03-14 09:20:57 +00:00
21431f18e1 reset the torrents object upon a disconnect so there aren't any errors when reconnecting 2010-03-14 09:05:12 +00:00
4929ba3c44 pass in true to the formatter so fsize doesn't ignore zero values 2010-03-14 08:55:26 +00:00
81d28b686f add a failure callback when uploading a torrent file 2010-03-14 08:46:46 +00:00
e2840148af remove a torrent from the grid as well as displaying an error message 2010-03-14 08:46:46 +00:00
450d526eca Fix issue where the gtkui sometimes won't start if there is a stale lock file or socket in the ipc/
directory.
2010-03-13 12:17:34 -08:00
ae426eb0cd add support for asking the user to change their password if it is their first login 2010-03-13 18:42:46 +00:00
3e6c956ac6 change first_load to first_login in the ui config keys as well 2010-03-13 18:42:46 +00:00
3a54a9aebc change load to login as it seems more sensible 2010-03-13 18:42:46 +00:00
f6c058dd34 add a first_load config parameter 2010-03-13 18:42:46 +00:00
cd7681b909 Fix #1172 notify startup complete when adding torrents externally 2010-03-13 10:08:16 -08:00
d2dafe4180 update the libtorrent submodule to point to 0.15-stable 2010-03-12 10:04:47 +00:00
92837080cd add the libtorrent submodule pointing at RC_0_15 2010-03-11 23:06:47 +00:00
97c2d0346a remove libtorrent submodule that is tracking trunk 2010-03-11 22:59:34 +00:00
da9cb956a8 fix the submodule in master 2010-03-11 22:43:29 +00:00
0ed6eb8564 convert the port field from a "uxspinner" to a "spinnerfield", fixes #1170 2010-03-11 20:13:02 +00:00
f7f928f0b9 fix the entry point for web plugins 2010-03-10 10:39:20 +00:00
24ce77cdf0 add a home icon and corresponding icon class
adjust the file browser window title and add the remaining toolbar items
2010-03-09 23:48:56 +00:00
3a56af99c0 add the toolbar for the filebrowser in initComponent
add a browse button to MoveStorage
2010-03-09 23:40:29 +00:00
c1bf8c1da1 update the sort after an update 2010-03-09 23:32:12 +00:00
f825e8996a update the sort after an update 2010-03-09 23:26:54 +00:00
b919613a51 fix the spinner css classes to use relative paths 2010-03-09 23:06:24 +00:00
38802245b6 display the speed in the title bar 2010-03-09 22:48:33 +00:00
c6da126f55 fix the path to the spacer image when using a different base to / 2010-03-09 22:21:15 +00:00
84374fd83a use Deluge.config.base for the path to the status html page rather than just / 2010-03-09 22:19:01 +00:00
8de2d30de0 add forward and back icons for the filebrowser toolbar 2010-03-09 22:16:03 +00:00
a961947720 add a toolbar to the file browser 2010-03-09 22:16:03 +00:00
ae5071d6cb fix the button css adding !important to ensure that the background-image from them is used
use iconCls for the toolbar rather than fixed paths
2010-03-09 22:16:03 +00:00
00c896ff1d fix the paths of static content so a base config parameter can be used 2010-03-09 22:16:03 +00:00
0f126bcbd5 add the add and create icons to the css file 2010-03-09 22:16:03 +00:00
57fa3d8834 fix the tracker icons when used via a Proxy 2010-03-09 22:16:03 +00:00
e0a8fd70f5 use relative rather than absolute paths for icons 2010-03-09 22:16:03 +00:00
e2b78be264 improve support for a base config parameter 2010-03-09 22:16:03 +00:00
6fd3cd56ff fix the header year and file path 2010-03-09 22:16:03 +00:00
88004c0d54 build deluge-all to bring it up to date with the latest code 2010-03-09 22:16:03 +00:00
739636cc0b On queue_column_sort and seed_peer_column_sort, sorting is now made on a separate function, queue_peer_seed_sort_function so that code can be re-used and only the necessary treemodel lookups are made. 2010-03-08 03:08:13 +00:00
238e183851 Cleaned up the seed_peer_column_sort function. Code reuse is always better. 2010-03-08 02:52:09 +00:00
8a15a18361 PEP-8 and seed/peer sorting support. 2010-03-08 02:06:15 +00:00
2ed9f97bb0 add a stub file/class for a filebrowser 2010-03-07 19:16:20 +00:00
a1be15ffb2 update the libtorrent submodule to point to the public git repository 2010-03-07 19:16:20 +00:00
44d3e2fa2f Merge branch 'master' of deluge-torrent.org:deluge 2010-03-01 17:55:00 -08:00
2ce62bf19b Fix #1161 ask the user if they want to switch to Full allocation if
trying to change file priorities in the add torrent dialog while using
Compact.
2010-03-01 17:53:33 -08:00
3a86fd7068 give the fileuploadfield a width so the text field expands correctly 2010-03-01 22:45:35 +00:00
a69ed83e25 begin adding support for a base config parameter 2010-03-01 17:51:35 +00:00
e5c734fb05 Fix #1162 problem with the queued torrents dialog from not properly adding to the add torrent dialog if set to auto add 2010-02-28 16:58:19 -08:00
cfeae2baf4 Fix #1109 auto add halting when a torrent with invalid filename encoding is in the directory 2010-02-28 16:21:46 -08:00
0ffca9a1f6 Fix silly error from last commit 2010-02-26 14:49:19 +00:00
b8521e7e28 include the ability to profile the web server, code lifted straight from the daemon 2010-02-26 14:26:52 +00:00
50ae65b58a Use faster (non-regex) version of is_url. 2010-02-25 02:01:08 +11:00
4a7782af28 Fix #1143 deluge-console crashes when autocompleting non-existing
directory
2010-02-22 17:11:53 -08:00
5bbe8bec5c update the required libtorrent version to 0.14.9 to match 1.2-stable 2010-02-22 11:59:09 +00:00
a065f95075 Cross-platform fix for #1147. 2010-02-21 18:43:44 +11:00
8dd4d2f094 Fixed typo. 2010-02-21 02:32:24 +11:00
9ad59d5f48 fix #1148, saving execute commands, tuples can't be assigned to stupid me 2010-02-19 23:48:54 +00:00
7999bd1e8c now the size and speed formatters hide on 0 fix the status tab so it displays the same as the gtkui 2010-02-19 20:43:27 +00:00
c81b1620ca fix the doc for fspeed and hide if speed == 0 2010-02-19 20:22:37 +00:00
6d4cf138c8 fix #1147 in trunk as well 2010-02-19 19:50:24 +00:00
a011d6d659 Merge branch 'master' of deluge-torrent.org:deluge
Conflicts:
	libtorrent
2010-02-19 00:39:11 +00:00
1790a1cf2d add an additional check to ensure that the libtorrent folder has files in it 2010-02-18 18:23:36 +00:00
b5533a22bc need to not remove the libtorrent folder 2010-02-18 18:19:29 +00:00
6750e9f122 add libtorrent 0.15 branch as a submodule 2010-02-18 17:26:13 +00:00
04abf6d17b remove the libtorrent folder as we'll now be using git submodules 2010-02-18 17:22:49 +00:00
00734d14b6 update the ChangeLog 2010-02-18 02:32:27 +00:00
bb00387903 fix the peers progress renderer 2010-02-18 02:20:43 +00:00
ea365bf671 fix the cancel button in the edit trackers window 2010-02-18 02:02:32 +00:00
1d2a6f7f0e implement a better remote events system 2010-02-17 01:50:05 +00:00
7bd5ba3cdb use createDelegate and add the onHide method that stops updating the hosts grid 2010-02-17 01:34:42 +00:00
68b5f92ec0 build up the details tab html within the javascript as well as making it easy for plugins to add extra items 2010-02-10 23:16:17 +00:00
04242ba91c fix the broken torrent menu and use icon classes rather than straight icon urls 2010-02-10 22:35:47 +00:00
eef9d8ec13 update the copyright header year for all the js files
implement a new update method that will be compatible with the torrent status deltas
add a new script containing a record for a Torrent
2010-02-10 22:15:29 +00:00
0e9a691954 Fix weird gtk bug that breaks create dialog box's pieces size selection. 2010-02-04 11:17:26 +00:00
9b23ce9e06 Use the preferred locale encoding when renaming files on add 2010-02-03 02:41:24 +00:00
f9d2e96d39 fix the ip address sort function 2010-01-29 16:40:49 +00:00
caed5accea use get_host() in connect() 2010-01-29 15:35:51 +00:00
343521ca25 stop the torrent grid from resetting its position upon update 2010-01-29 11:04:26 +00:00
1d29f67a75 fix the progress bar in the grid 2010-01-28 22:49:56 +00:00
da8367de4d fix the row height 2010-01-28 18:43:30 +00:00
0647c4e3d7 use the BufferView to ease torrent loading in the interface 2010-01-28 18:39:16 +00:00
976824ad99 revert to the default theme if the selected themes stylesheet is missing 2010-01-27 20:23:15 +00:00
a4e12c1d94 change the favicon on the docs template 2010-01-27 11:14:05 +00:00
db4d0fabe7 remove the entry for jsdoc 2010-01-26 18:21:09 +00:00
25b282fdb8 add the full path to the info returned by the file tree 2010-01-26 18:20:43 +00:00
518a73079a fix some issues with the add window 2010-01-26 18:18:14 +00:00
0634592bd9 add a doc string 2010-01-26 18:17:24 +00:00
3e13fe1229 change the formatting 2010-01-26 17:42:17 +00:00
7125eab8b2 add a doc string 2010-01-26 17:42:02 +00:00
57a9e925a7 no need to have this wrapped in an inline function
add a solitary doc string
2010-01-26 17:35:18 +00:00
4afcae325a use createDelegate rather than bind, saving implementing our own method of setting a functions scope 2010-01-26 17:31:32 +00:00
dc764b2ad5 add some basic doc strings 2010-01-26 17:26:53 +00:00
454321614b update the doc strings 2010-01-26 17:07:23 +00:00
d39f6843c9 add the deluge docs template and a build_docs shell script 2010-01-26 17:05:48 +00:00
f63435db90 remove the old jsdoc-toolkit docs folder 2010-01-26 15:25:38 +00:00
8c3b6cb0db add a project file for ext-doc 2010-01-26 15:23:45 +00:00
a89d0d42aa rebuild the non-dev scripts 2010-01-26 14:03:14 +00:00
3368c4c67d re-enable a number of disabled scripts
use hbox for the buttonPanel and remove the pre ext3 hack
2010-01-26 13:59:25 +00:00
447cb52bf1 add .x-mixed-download to the priorities css
fix the way the directory stats are updated (parent directories weren't being updated)
2010-01-26 13:25:44 +00:00
2afd0a4e97 fix the progressbar renderer for the file tree
add a new file priority "Mixed"
add progress bars and priorities for directories using the new tree format
2010-01-26 13:18:16 +00:00
7727a98c45 add a second FileTree class that stores everything as a dict within the tree so information can be stored for directories 2010-01-26 13:12:32 +00:00
744f11e19b rename the TreeGridCustomColumn to TreeGridRenderColumn and add the column object to the template so its accessible from the renderer 2010-01-26 13:11:29 +00:00
0a86a30c2a Initialize session_id to -1 so that it will always return something even
if no connections to the daemon have been established
2010-01-26 02:42:30 +00:00
ec410fc1a9 Remove some debug code 2010-01-26 02:01:53 +00:00
7af689e57f change the priority renderer to return '' if there is no value 2010-01-25 15:10:14 +00:00
fa0d6b1aa0 Increased GTK UI limit for download / upload to 60000. 2010-01-25 09:46:08 +00:00
8fc4caa2f1 Wait on the session state before requesting torrent status updates 2010-01-25 04:58:01 +00:00
25afa04ba3 Use torrent status diffs in the TorrentView to reduce the amount of rpc
traffic from the core->gtkui
2010-01-25 00:15:12 +00:00
c202f7727f Add some rpc stats to the gtkui debug logging 2010-01-24 22:44:44 +00:00
d74050e7a6 partially working files tab added back in 2010-01-24 04:06:06 +00:00
c7635b0ff0 remove commented out line that scanned for the width which is redundant now width is a property of the renderer 2010-01-24 03:29:44 +00:00
0d069d0fe8 change the queue number server side 2010-01-24 03:27:43 +00:00
e441f96204 use Ext.ux.StatusBar 2010-01-24 03:01:12 +00:00
99197b2063 set the correct svn:ignore properties 2010-01-24 02:59:37 +00:00
92d19fd58d initial commit of the big js layout overhall (ui loads but there are parts missing) 2010-01-24 02:55:32 +00:00
b4b95c9423 Don't opitimise when doing a debug build. 2010-01-24 02:23:57 +00:00
e79f6ada2f Move the formatting of RPCRequests to a function so that it's not done every time a rpc request comes
in
2010-01-23 23:50:43 +00:00
0e0cc30128 Add ability to get the session id and validate it.
Fix up some docstrings
2010-01-23 23:41:06 +00:00
9b26f6ebee Fix up the build_debug so that it removes 'NDEBUG' from the CFLAGS 2010-01-23 22:33:24 +00:00
30280b0803 Remove debug print 2010-01-23 22:05:49 +00:00
fe6bcd62be remove all the torrents from the store upon logout 2010-01-23 20:34:32 +00:00
14cea4fbc7 change the data store to a json store to save translating the data into an array first 2010-01-23 15:50:32 +00:00
899ac7c86e remove starting the events manager upon client connect 2010-01-23 15:39:05 +00:00
39341f623f fix the formatting and change it so the events manager is started on the login event 2010-01-23 15:38:07 +00:00
42cbf4f5c6 change the default theme to gray 2010-01-23 15:37:04 +00:00
a3d98029f9 fix formatting and set Ext.USE_NATIVE_JSON to true 2010-01-23 15:35:44 +00:00
031f75a2bb disable the override to formlayout for the time being 2010-01-23 15:34:50 +00:00
a59332b4ef fix logging in 2010-01-23 15:34:32 +00:00
1b2d5bc6ad tweak the way the login is built up 2010-01-23 15:31:17 +00:00
f14b3a8459 fix typo 2010-01-23 14:38:28 +00:00
76fcfa498d add gzip encoding to responses that are just text 2010-01-22 12:39:33 +00:00
2073ae0221 change the default theme to blue for the time being 2010-01-21 21:17:18 +00:00
cd24acd74f upgrade to ext js 3.1 2010-01-21 21:01:02 +00:00
1ac0403f05 switch the css file in the server list 2010-01-21 20:28:10 +00:00
90e562ff98 update the rest of the css files 2010-01-21 19:53:02 +00:00
e010a789c4 remove the carriage returns 2010-01-21 19:50:55 +00:00
964d85d908 update the theme images 2010-01-21 19:34:05 +00:00
3068f006e2 remove the slate theme that is no longer supported 2010-01-21 19:28:40 +00:00
f4cf3d9893 convert spaces to tabs 2010-01-21 19:19:37 +00:00
708ad2e665 add a __contains__ method to the config class
fix upgrading old configs when the key doesn't exist in the old config
2010-01-20 21:04:40 +00:00
0819697c5b update the gettext.js generation script and gettext.js 2010-01-20 20:37:14 +00:00
0121d721cb Make sure all data is passed to pagePart. Accept x-gzip encodings. 2010-01-20 12:36:07 +00:00
a82b6e4fb5 add 2 new commands that allow for libtorrent to be built with debugging enabled 2010-01-20 12:08:29 +00:00
4420f2fae5 Fix hanging when using commands from the command-line
Fix displaying plugin command output on the command-line
2010-01-19 23:00:48 +00:00
f8f9438950 Fix #1128 Show an error dialog when unable to start a 'deluged' process 2010-01-18 02:36:03 +00:00
e211b6feca Update main window glade orientations 2010-01-17 22:18:45 +00:00
d9b9f22998 Completely disable gzip decoding when allow_compression=False. Add extra test. 2010-01-16 04:50:01 +00:00
aaa7dae18e Fix date in 1.2_RC changelog. Add release date to trunk changelog. 2010-01-16 04:21:25 +00:00
2de185adea bump version to 1.2.900 rather than 1.2.9.900 2010-01-14 14:17:05 +00:00
0e2dd9f389 Add gzip decoding support to httpdownloader (implements #1012). 2010-01-14 12:43:59 +00:00
cbac2fbd5a Fix typo. Remove obselete function. 2010-01-14 12:32:04 +00:00
be70305365 Make sure that the port test status image is always reset between tests. Added a "loading" image when the test is in course. 2010-01-12 03:15:50 +00:00
f586b91a59 Remove workaround for lt 0.15 when setting the trackers 2010-01-10 20:17:59 +00:00
623c5ab57b Fix displaying new release dialog in Windows 2010-01-10 19:47:31 +00:00
ed00536468 Add missing import(removed on a previous check-in???). 2010-01-10 16:26:41 +00:00
430b96f4f5 Do not save_state right away, but rather wait for the timer loop 2010-01-08 23:36:44 +00:00
ac66f305e7 Fix displaying root folder when using the 'path.utf-8' keys in torrents 2010-01-08 21:26:33 +00:00
8175b2af58 Use cStringIO to open zip files in python 2.5 2010-01-07 15:27:05 +00:00
4dbc93b1fa Rewrote call to use maybeDeferred (this handles methods that return deferreds).
Fixes #1114.
2010-01-07 00:45:47 +00:00
9b97c6a578 put the default password in the manpage for those too lazy to type "deluge default web password" in google 2010-01-05 14:07:16 +00:00
97375f1a7c Fix #1117 can't use the '3' key 2010-01-04 00:18:53 +00:00
6312ad4a7e Add rudimentary support for local files 2010-01-03 18:02:30 +00:00
b06f46ea7c Fix blocklist ignoring try_times.
Make blocklist print error messages on failures.
2010-01-03 16:27:05 +00:00
a570e67a4d Fix #1116 not being able to use command aliases when not connected to a daemon 2010-01-03 01:37:57 +00:00
221c9984d6 Fix #1115 not showing usage for the 'debug' command 2010-01-02 23:25:45 +00:00
ccc97f83a8 Yet, some more logging clean-ups.... 2010-01-01 22:49:02 +00:00
d557cda55c Clean-up logging. 2010-01-01 22:45:03 +00:00
eee6d4c030 The !FreeSpace plugin only calculates free-space on existing directories. Cleaned-up logging. 2010-01-01 21:44:55 +00:00
177ec7d5c2 Allow choosing which columns are seen on the torrent view by right-clicking it's headers. 2010-01-01 21:27:13 +00:00
f30a10f2b8 Add "Save Path" column to the torrent view. 2010-01-01 21:23:57 +00:00
1c665b7d2f Simplify logic flow a bit (should make local file support easier).
Improve docstrings.
2010-01-01 16:02:20 +00:00
717897b343 Don't apply 'stop/remove on completed' rules to torrents in a Queued or Paused state 2009-12-28 21:50:13 +00:00
7f33292aca Fix not being able to rename folder due to constant updating 2009-12-26 17:10:14 +00:00
3e67620e55 Fix torrent info name not being utf-8 decoded when root file/folder name is blank 2009-12-26 17:09:05 +00:00
bc8cacdbd1 Update svn:externals to point to libtorrent RC_0_15 branch 2009-12-25 21:33:01 +00:00
ec9564d0c1 #496: Remove deprecated functions in favour of get_session_status() 2009-12-25 21:29:47 +00:00
ffb241a4de Strip lines/spaces 2009-12-25 21:27:07 +00:00
d57b2b43ec Implement #457 progress bars for folders 2009-12-24 20:06:23 +00:00
19e2ab2187 Have the .desktop file run 'deluge-gtk' 2009-12-23 23:54:00 +00:00
8e7d4f2cd4 Change share ratio calculation to use the total done instead of the all time downloaded value. This change will make the share ratio calculation not use data downloaded in failed hash checks. 2009-12-23 18:44:00 +00:00
ef2ca43c3d Add in a '_' builtin method if unable to initialize gettext 2009-12-23 01:34:58 +00:00
8bedc613a0 Fix possible TorrentFinishedEvents being emitted on startup for already completed torrents 2009-12-23 01:28:33 +00:00
cd3221baf6 Fix exceptions when gettext/locale cannot be initialized properly 2009-12-21 19:41:31 +00:00
e0ebffb8fa More relaxed definition of what a commented line is in a blocklist.
Decorate readranges with raiseError rather than parse to increase performance.
2009-12-21 13:58:24 +00:00
5a8c443d50 Add another test to httpdownloader.
Make it compatible with python 2.5.
2009-12-21 13:48:00 +00:00
c7d52f3ce5 fix filtering on the tracker host, use == rather than in so tracker urls that contain another trackers url within them aren't picked up as well 2009-12-21 10:26:50 +00:00
fad6ba2193 Fix blocklist status icon not opening proper preferences page.
Show blocklist's file date using the locale's date / time representation.
2009-12-20 09:01:07 +00:00
22c9d7c0ee Fix some packing due to the last commit 2009-12-20 04:23:50 +00:00
3a864bcdad Plugin preference pages will now expand to fill 2009-12-20 04:18:21 +00:00
14f894959f Fix displaying folders in the add torrent dialog 2009-12-20 04:02:41 +00:00
6aebcef2b5 Fix file renaming 2009-12-20 03:45:14 +00:00
9e53e33c24 Fix #1104, #735 use path.utf-8 if available 2009-12-18 04:36:42 +00:00
62a336b7d8 Remove redundant variable. 2009-12-17 23:08:55 +00:00
0cc00ba5df Partial fix for #1103 if the per-torrent option for stopping at a ratio has been unchecked, then do
not stop it at the global setting.
2009-12-17 21:40:21 +00:00
a161bbfcb6 Fix #1095 incorrect piece size used when using some non-English languages 2009-12-17 21:27:04 +00:00
f03d1818fa Upgrade older confs instead of just dying.
Fix major logic error when checking if an update is needed.
2009-12-16 13:46:39 +00:00
13b2e7da26 Fix import on startup which got broken in previous commit. 2009-12-16 12:46:57 +00:00
377f8cf886 Fix blocklist not working for all locales (#1059). 2009-12-16 11:55:34 +00:00
72c9a46fa3 Apply #1100 sort plugins list by name 2009-12-15 17:37:05 +00:00
53b9cdebcd Fix #1099 use triple quotes on docstrings 2009-12-15 06:36:02 +00:00
dc9e2597da Fix showing the remove torrent dialog twice if using the delete key and pressing cancel in the dialog 2009-12-14 23:20:35 +00:00
bc27c2cdf7 Remove Notifications from list 2009-12-14 23:16:56 +00:00
a9631daf7f Fix #768 save tracker list for create torrent dialog 2009-12-14 18:46:08 +00:00
d1f6ca90fc Fix #1086 deprecated gtk.Tooltips usage 2009-12-14 18:20:51 +00:00
68749a7ad5 Fix #594 tray password dialog freeze in Windows
Made the password dialog prettier
2009-12-14 02:15:08 +00:00
5b94861fc9 Fix issue where stoping a daemon that you aren't connected to causes the gtkui to shutdown the
currently connected daemon.
2009-12-14 00:48:18 +00:00
a8697114c1 Fix #823 setting config values to -1.0 2009-12-13 22:47:15 +00:00
0042fb1767 Add #891 remove torrents by pressing the Delete key 2009-12-13 22:16:05 +00:00
b69e25e308 disconnect the client if getting information fails 2009-12-13 21:50:16 +00:00
3c24d72489 use metavar to change the output of --help by optparse 2009-12-13 21:49:10 +00:00
358b5f4b19 Fix issue where hosts will show up erroneously as Offline 2009-12-13 21:46:55 +00:00
43df21517e Disconnect from daemon if getting the info fails 2009-12-13 21:34:26 +00:00
43a5a9111b Fix autoconnecting to a host other than the first one in the list 2009-12-13 21:29:46 +00:00
773f65d708 Add an error dialog when trying to add a duplicate host
Center the add host dialog over the connection manager
2009-12-13 21:25:22 +00:00
cd7b5082a0 Fix #1036 autoconnecting to localhost daemon on start-up 2009-12-13 20:49:23 +00:00
f3f3b3669f Fix #782 do not ask for tray password when window is not minimized to tray 2009-12-12 22:38:26 +00:00
7e0d09a7bc Fix #692 no longer require tray password when quitting from the tray icon while the window is
visible.
2009-12-12 21:22:51 +00:00
42e904b63c reset the add torrent window on hide 2009-12-12 15:56:49 +00:00
35186faf78 Fix printing 'rm' command usage when called with no arguments 2009-12-11 21:19:48 +00:00
62dfd6a664 Implement #1063 option to delete torrent file copy on torrent removal - patch from Ghent 2009-12-11 21:00:12 +00:00
8212a66d5a fix #1075 (changing priority on a whole folder) 2009-12-11 20:45:59 +00:00
eac2a10a12 Fix possible exception when upgrading from a 0.5 state file 2009-12-10 21:28:51 +00:00
9f034657b0 Fix [6003] as it reverted a change 2009-12-10 21:15:56 +00:00
f7b3e11729 update some of the icons in the webui 2009-12-10 18:24:31 +00:00
b47f6badd7 disable the files and options tabs until a torrent has been selected 2009-12-10 17:45:40 +00:00
2ecb233b5b fix uploading plugins when the daemon is not localhost 2009-12-10 17:35:35 +00:00
040f1a5c6d fix the onResize method for the togglefield so it resizes the textfield to the correct size 2009-12-10 17:26:45 +00:00
a126081d2c implement installing plugins via the webui 2009-12-10 15:40:37 +00:00
104852d47e fix the upload_plugin method as it wasn't upgraded to deluge-rpc spec 2009-12-10 15:31:27 +00:00
a2cc2cdd8f remove the margin and padding from the bottom of the options fieldset 2009-12-10 14:35:10 +00:00
7650ebc373 fix enabling plugins on the fly 2009-12-10 14:32:55 +00:00
a4e8d1eb46 Fix using the console in Windows, but only in command-line mode 2009-12-10 01:26:26 +00:00
b9d2094a15 tweak the download prefs page so no scrollbars appear 2009-12-10 00:38:48 +00:00
3f383df479 improve the ToggleField widget, having the checkbox to the left of the
field rather than above it
2009-12-10 00:32:24 +00:00
1ba3955025 add tooltips to the statusbar items
add disk free space to the statusbar
2009-12-10 00:06:34 +00:00
0d3f364aac Apply cookie date fix from adios 2009-12-09 13:13:04 +00:00
d119fa3629 fix a bug in the execute plugin when move_completed is used the incorrect path was passed in 2009-12-08 11:24:56 +00:00
5129682727 tweak the sizes of some form elements to improve the layout 2009-12-08 02:09:03 +00:00
96becf60bd begin the makings of the togglefield widget that allows enabling of move completed/copy torrent files/auto add torrent files fields 2009-12-08 01:56:15 +00:00
9c3efd17cb Change the compressed js script to deluge-all.js to avoid naming conflicts on case sensitive filesystems 2009-12-01 17:11:07 +00:00
19455a7adf copy server.py across from the 1.2 branch 2009-12-01 13:02:46 +00:00
57c96477c1 Add button to Other preferences to associate magnet links with Deluge 2009-11-30 03:50:28 +00:00
f9c61bbc11 Fix #1085 only use ints for specific options to prevent unhandled exception 2009-11-29 21:32:56 +00:00
a80c4e18e7 Fix crash in Windows when creating a torrent 2009-11-29 07:38:29 +00:00
e73c65e602 Properly show 100.00% and reduce number of progress bar updates during a torrent creation 2009-11-29 07:37:29 +00:00
8c283875fb Register just 'deluge' not '/usr/bin/deluge' in the magnet uri handler 2009-11-29 01:45:46 +00:00
1353ce6903 Attempt to register as the default magnet uri handler in GNOME on startup 2009-11-29 01:40:30 +00:00
3136e5490f Add some checks for OSX since it doesn't support SVG icons 2009-11-29 00:52:00 +00:00
cffce4a706 swap the order of the buttons in the remove window 2009-11-26 14:59:04 +00:00
1c318504cf update the build script and rebuild deluge.js and ext-extensions.js 2009-11-25 18:52:00 +00:00
115a7c3795 rename deluge-yc.js to deluge.js in trunk 2009-11-25 18:51:19 +00:00
3fcb0e7ae5 exclude some more things from the sdist 2009-11-25 18:37:40 +00:00
a567b23262 prevent undefineds ending up as a key in the option manager 2009-11-25 18:37:06 +00:00
93468f342a Set batch_write to False in __init__ 2009-11-25 18:23:55 +00:00
635260e686 add the updated setup and new MANIFEST file from 1.2 2009-11-25 17:58:50 +00:00
94625c48b2 Fix loading the saved metadata when loading state with magnet uris 2009-11-25 01:55:51 +00:00
20dc0a5e8a Fix files list when using magnet uris 2009-11-25 01:41:50 +00:00
e6135aa2a9 Fix some accidental reverts 2009-11-25 01:00:25 +00:00
1cb42252b8 Don't throw errors when de-registering notifications.
If sound notifications is not possible or disabled, also disable the sound customization notebook page.
2009-11-22 08:14:09 +00:00
7812f7b4e4 Update the Notifications and FreeSpace plugins descriptions.
On the Notifications plugin, moved the Core and GtkUi notification implementations to `core.py` and `gtkui.py` respectively.
2009-11-22 06:56:50 +00:00
127b577440 If plugin is installed on an older client, known_events might not exist yet. 2009-11-22 06:13:11 +00:00
a5e8a9dc69 Only import gtk inside the GtkUi notifications implementation. Like this one won't need have gtk installed if only the daemon is running. 2009-11-22 05:58:32 +00:00
9bfa5f10b6 Since the WebUI does not yet do anything, remove it's entry point from the notifications plugin.
Cleanup debugging output.
2009-11-22 03:55:36 +00:00
67c0f8609b Merge Heads. 2009-11-22 03:08:28 +00:00
7061e09a8e Remove unused module. 2009-11-22 02:35:55 +00:00
e327d87ebc Moved all notifications into their own classes from which the Core, GtkUi, and possibly latter, Web, plugins inherit from.
The plugins now just handle configuration stuff.
2009-11-22 02:35:47 +00:00
c4f0920c18 Notifications are now working for the built-in TorrentFinishedEvent and the custom one for email, popup, blink and sound notifications. Sounds can even be tweaked for each of the events types.
Needs some code cleanup.
2009-11-22 02:35:37 +00:00
adb22bdfa5 Add the test module so that it can be version tracked. 2009-11-22 02:35:28 +00:00
01a43544d5 Remove un-used module. 2009-11-22 02:35:19 +00:00
8420d6105b Custom notifications now working for emails, popups, blinks and sound.
Blinks might need some changes because, there's no need to formar or gather extra info, so, it might not be needed to allow plugin developers to register custom handlers for it.
2009-11-22 02:35:12 +00:00
1b7a50f88b Checkpoint:
* Custom notification providers working for email.
  * Configuration through the GtkUI working.
2009-11-22 02:35:02 +00:00
8a6ec7232d Merge SVN and HG heads. 2009-11-22 02:34:51 +00:00
535940e2e6 Notifications(email, blink, popup, sound) are working both for classic mode and daemon mode.
Still need some further tests for using `component.get('Notifications').notify*()`.
2009-11-22 02:34:35 +00:00
0723a77214 First notifications plugin commit.
Working when not in classic mode. In classic mode, needs some more coding.
2009-11-22 02:34:23 +00:00
1f58910a38 Fix adding torrents with different metadata by storing the bencoded dict too. If we bencode the stored metadata dict, there is a chance the order of the dict will be different and change the info-hash. 2009-11-20 19:13:12 +00:00
634ecdeb1d Fix issues adding magnet uris 2009-11-19 04:51:19 +00:00
aa86aa6fe1 Fix issue where some torrents with special characters could not be added 2009-11-19 02:39:07 +00:00
789356d44d Fix exception on startup when the system tray icon is not enabled 2009-11-19 02:29:37 +00:00
2b3bd4f1f3 Change the event_list to be a dictionary of known_events and their docstrings 2009-11-16 00:39:15 +00:00
ad04b2a137 Add way to get a list of DelugeEvent classes 2009-11-14 23:42:04 +00:00
1a1ab4e780 Fix endless loop when trying to autoconnect to an offline daemon 2009-11-13 05:26:54 +00:00
330b8b3ced Fix autoconnecting to the next host in the list if the selected one isn't available 2009-11-13 05:22:38 +00:00
bdba9cd00a Fix #1071 issue where Deluge will fail to start if there is a stale ipc lockfile 2009-11-13 01:07:36 +00:00
f98c3adf2f Comment out a debug log 2009-11-10 18:28:27 +00:00
ec2c5ab937 Reduce height of Add Torrent Dialog by ~80 pixels 2009-11-10 02:45:36 +00:00
8dff2375d0 remove alpha from the title 2009-11-09 23:48:32 +00:00
4e2c0a70c4 Allow for colons in PeerGuardian/SafePeer lists' descriptions.
Check that the start & end range resembles an ip when checking a list's validity.
2009-11-09 08:54:13 +00:00
41353c9ae4 Force blocklist to re-detect the format when a download is forced.
Move remove_zeros to common.py and simplify / speed up.
Change debug logging lines to be more uniform.
2009-11-09 01:52:58 +00:00
e73052df1c Fix printing info, help, etc.. on the command line 2009-11-08 17:22:57 +00:00
9b8282010c Fix disabling/enabling plugins after switching daemons 2009-11-08 04:04:40 +00:00
dd67a935cb Fix #1067 import os 2009-11-06 19:22:13 +00:00
0a84bc73c5 Only try to stop LoopingCalls if they are running 2009-11-05 04:35:17 +00:00
baa177a1b1 Fix deleting old .fastresume files with fresh configs 2009-11-05 03:44:46 +00:00
fa5b7e7a66 allow commands that are .pyc files to be used 2009-11-04 23:49:07 +00:00
902ef3fa28 run the path from the add command through os.path.expanduser 2009-11-04 23:36:27 +00:00
8144d15689 add a basic move storage window that fixes #1057 2009-11-04 20:45:21 +00:00
dd860e67f7 remove the connected call upon an update to reduce the number of ajax calls 2009-11-04 19:54:59 +00:00
19d9c71b13 Allow the 'help' command to be called when not connected to a daemon 2009-11-03 22:08:18 +00:00
46906f5447 remove accidentally left in debug line 2009-11-03 14:48:24 +00:00
1893b92f37 make the delete key work in the console ui 2009-11-03 12:47:23 +00:00
fb1d7cfece Fix adding torrents from the Queued Torrents dialog 2009-11-03 03:25:57 +00:00
59b93f4d2e Fix showing the 'Other' speed dialogs in Windows 2009-11-03 03:19:30 +00:00
6880a142e3 Remove debian/ folder 2009-11-02 17:50:32 +00:00
3d76122666 escape the hyphens in the console and web manpages 2009-11-02 17:33:06 +00:00
0f81e2816f forward port the setup.py fix to trunk and update the 1.2 branch ChangeLog 2009-11-02 15:35:56 +00:00
59c7fcf854 Update translations 2009-11-02 01:35:13 +00:00
f6a4d19084 Add the clear() back 2009-11-01 17:49:32 +00:00
ec259d6aea Use batch writing mode in the help command 2009-10-31 22:05:35 +00:00
7983187818 Do not include an 'announce-list' key in torrents when there is only one tracker 2009-10-31 19:49:14 +00:00
2a4cf7cb56 Improve 'info' command draw speed 2009-10-31 18:52:52 +00:00
3b07cc40bd Don't bother clearing the screen during a refresh 2009-10-31 18:44:27 +00:00
fd24e1c17c Fix crash when string length makes line longer than terminal width 2009-10-31 18:43:48 +00:00
f876c17efd Fix crash when removing multiple torrents 2009-10-31 05:50:01 +00:00
ee7f4e452d Fix adding torrents when not showing the add torrent dialog in Windows 2009-10-31 00:08:53 +00:00
7c10dd4c0e Fix #1052 crash when issuing commands while not connected to a daemon 2009-10-30 20:06:07 +00:00
a110ad1d20 Fix improper dos line endings 2009-10-30 19:08:23 +00:00
7c2a2af1f0 Fix displaying non-ascii strings in the console ui -- patch from Ian Martin 2009-10-30 18:00:13 +00:00
6d2d3c0fd0 Fix torrent name being blank when root folder is renamed to /
Update changelog (for previous commit as well)
2009-10-30 00:15:22 +00:00
888997372c Make sure renamed files are utf-8 encoded. 2009-10-30 00:02:25 +00:00
5991abcec5 Use filename suggested by content-disposition header.
Closes #1040.
2009-10-29 06:02:20 +00:00
675d1219cd Consider 0 unlimited when displaying limits in the statusbar 2009-10-28 17:43:29 +00:00
a1e4c51c9c fix #990, showing 0 as a limit when it means unlimited in the statusbar 2009-10-28 17:38:35 +00:00
93e3d2acf6 need to actually continue from the loop otherwise another error still occurs 2009-10-28 13:33:27 +00:00
219f745e68 create a method to escape all possible forms of newlines in a translation as well as the quotes 2009-10-28 13:24:37 +00:00
d6e18f7729 fix displaying the protocol speed in the webui
also update the update_ui method in json_api so it gets the status more like how the gtkui does
2009-10-27 11:39:53 +00:00
d27d7c6733 fix the eta sort order in the webui 2009-10-27 11:16:55 +00:00
831b81529c update the ChangeLog so andar doesn't beat me up
fix displaying tracker urls with & in the url in the gtkui
2009-10-27 11:07:30 +00:00
826f1a2be9 add < and > escaping to the html escape method 2009-10-27 10:57:47 +00:00
e17bd472a8 fix actually escaping (foolish me had left it commented out) and also only update if there has been a change 2009-10-27 10:34:07 +00:00
de82302c67 create a simple html escape method and escape the fields in the details tab 2009-10-27 10:26:59 +00:00
81949449ae fix a couple of bugs in the M.O.M and fix the options tab and file priorities in the torrent add window (success!) 2009-10-27 10:25:16 +00:00
acc850dab9 fixes #1046, changing the option name in the ui rather than the core which would break the other uis 2009-10-27 09:12:22 +00:00
208eef713a Fix #1047 move completed does not work if saving to non default path 2009-10-27 03:08:47 +00:00
dbe90d2882 Use custom user-agent when downloading files with httpdownloader. 2009-10-26 13:58:42 +00:00
3153a545ca Update translations 2009-10-26 01:54:19 +00:00
65545df485 modify the M.O.M so the API is practically the same as the O.M, so the only method that accepts an id is changeId 2009-10-25 17:48:28 +00:00
29d01993c9 Fix typo, update plugin info. 2009-10-25 13:42:11 +00:00
9627b7cb92 Fix exception when using the 'halt' command 2009-10-24 19:49:20 +00:00
c068384845 Fix create_plugin.py script 2009-10-24 05:51:26 +00:00
92eb10be29 Fix #215 ETA sort order 2009-10-24 04:56:10 +00:00
c6d4208a29 Fix previous commit [5864] 2009-10-24 03:47:35 +00:00
c6eaec6998 Fix #799 translate connection status 2009-10-24 02:04:19 +00:00
b77e846744 Fix starting plugins when the pluginmanager is started 2009-10-23 23:23:38 +00:00
566d3c5ebf Fix possible exception when trying to load pre-1.2 plugins 2009-10-23 01:15:30 +00:00
6eee4fb31f Fix 'autostart localhost if needed' option 2009-10-23 01:07:46 +00:00
36e74e05ca fix removing torrents that fail to download when added via url 2009-10-21 20:30:07 +00:00
2289b5f173 fix switching the options when a different torrent is selected
fix showing the private flag
2009-10-21 20:15:16 +00:00
f6b5eb0a0c fixes to the M.O.M and the options details tab, still not 100% though 2009-10-21 19:48:44 +00:00
d70edb245b show the infinity symbol if ratio is less than 0 2009-10-20 22:45:32 +00:00
21701cb096 fix setting bandwidth limits via the statusbar 2009-10-20 22:33:18 +00:00
da2a7ef138 fix setting the add options in the mom 2009-10-20 21:53:54 +00:00
3f1d769ffc merge changes into trunk 2009-10-20 21:44:27 +00:00
9c491c13cc Add option to create torrent name sub-folders in extract folder
Fix issue where the plugin would not stop extracting files after being disabled
2009-10-19 02:10:43 +00:00
bdc173cf4b use os._exit() rather than exit() when forking 2009-10-14 15:53:31 +00:00
4ae439a99a Pause the TorrentDetails component when the window is minimized.
Clean up the pause/resume component code in mainwindow
2009-10-14 15:49:55 +00:00
04217e16d4 big bunch of fixes to the M.O.M along with a couple to the O.M 2009-10-13 16:21:28 +00:00
4a00edc066 move the parameter type converting into a seperate method 2009-10-13 15:22:24 +00:00
aa274eca74 improve the forking code 2009-10-13 15:20:45 +00:00
c0b5bcc7d3 add the option to fork the webui 2009-10-13 11:32:40 +00:00
551d38c7a0 fix a bug in the connection manager where the host list wasn't refreshed after a host was added 2009-10-13 09:56:49 +00:00
c3f433500b allow setting of the value without firing an event 2009-10-12 16:45:28 +00:00
23c949d4ec give names to both the radio buttons so they end up in a group (duh) 2009-10-12 16:44:30 +00:00
3d85791a03 fix a bug in converting non-boolean values back to boolean in the options manager 2009-10-12 09:53:13 +00:00
a3636ccdb7 Fix saving torrent state on fresh configs
Do not try to call doIteration() on the reactor if it has already stopped
2009-10-11 18:46:35 +00:00
e0111271a3 change the value of torrent.queue from -1 to 99999 so the grid sorting works the same as the gtk ui 2009-10-10 14:06:08 +00:00
44217fd977 add a man page for deluge-web 2009-10-10 13:45:31 +00:00
6274a32ca1 Add man pages for deluge-console and deluge-gtk
Update the other man pages
2009-10-09 16:26:10 +00:00
11c0e9a304 Likewise in trunk.. 2009-10-09 00:40:46 +00:00
844f98db04 Fix path errors when adding torrents externally in Windows 2009-10-09 00:19:07 +00:00
3c69822761 Modify setup.py to allow building without libtorrent/ 2009-10-08 02:51:49 +00:00
3a90109724 Likewise in trunk 2009-10-08 02:43:54 +00:00
ce0968e6dc Update gettextize.sh script to use proper encoding
Regenerate deluge.pot
2009-10-05 00:00:37 +00:00
2e6b21aa85 Add script to regenerate the POTFILES.in file
Update the POTFILES.in file
2009-10-04 23:48:18 +00:00
8a5ccbc2d4 Update setup.py 2009-10-04 23:19:34 +00:00
1531 changed files with 244394 additions and 230752 deletions

10
.gitattributes vendored Normal file
View File

@ -0,0 +1,10 @@
/libtorrent export-ignore
/win32 export-ignore
docs/build export-ignore
docs/source export-ignore
/tests export-ignore
deluge/scripts export-ignore
.gitattributes export-ignore
.gitmodules export-ignore
.gitignore export-ignore
*.py diff=python

9
.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
*~
build
dist
*egg-info
*.egg
*.log
*.pyc
*.tar.*
_trial_temp

226
ChangeLog
View File

@ -1,98 +1,176 @@
=== Deluge 1.2.0 (In Development) ===
=== Deluge 1.3.0 (18 September 2010) ===
* 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
* Add max active downloading and seeding options to scheduler.
* Ignore global stop ratio related settings in logic, so per torrent ones are used.
* Fix scheduler so that it keeps current state, even after global settings change.
* 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
* AutoAdd plugin can now recover when one of the watchfolders has an unhandled exception.
* Increase max piece size to 8 MiB in create torrent dialog (closes #1358)
* 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 ====
* Implement new RPC protocol DelugeRPC replacing XMLRPC
* Move to a twisted framework
* Add an 'Error' filter for Trackers to show trackers that currently have a tracker error
* Use system GeoIP database if available, this is now an optional dependency
==== GtkUI ====
* Remove SignalReceiver
* Implemented a cross-platform IPC method thus removing the DBUS dependency
* Implement a "True" Classic Mode where there is no longer a separate daemon process
* Add preferences option "Add torrent in paused state"
* Add tracker icons to the Tracker column
* Implement #259 show tooltip with country name in the peers tab
* Add an error category to the tracker sidebar list
* Add Find More Plugins button to Plugins preference page
* Fix #518 remove header in add torrent dialog to save vertical space
* Add a Cache preferences page to adjust cache settings and examine cache status
* Add ability to rename files prior to adding them
* Fix shutdown handler with GNOME session manager
* Allow 4 MiB piece sizes when creating a torrent
* 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 ====
* Changed to use curses for a more interactive client
* #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 ====
* Move over to using Twisted-Web for the webserver.
* Move to only AJAX interface built upon Ext-JS.
* #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
* Implement #1012 httpdownloader supports gzip decoding
* #496: Remove deprecated functions in favour of get_session_status()
* #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 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 ====
* Implement new RPC protocol DelugeRPC replacing XMLRPC
* Move to a twisted framework
* Add an 'Error' filter for Trackers to show trackers that currently have a tracker error
* Use system GeoIP database if available, this is now an optional dependency
==== GtkUI ====
* Remove SignalReceiver
* Implemented a cross-platform IPC method thus removing the DBUS dependency
* Implement a "True" Classic Mode where there is no longer a separate daemon process
* Add preferences option "Add torrent in paused state"
* Add tracker icons to the Tracker column
* Implement #259 show tooltip with country name in the peers tab
* Add an error category to the tracker sidebar list
* Add Find More Plugins button to Plugins preference page
* Fix #518 remove header in add torrent dialog to save vertical space
* Add a Cache preferences page to adjust cache settings and examine cache status
* Add ability to rename files prior to adding them
* Fix shutdown handler with GNOME session manager
* Allow 4 MiB piece sizes when creating a torrent
==== ConsoleUI ====
* Changed to use curses for a more interactive client
==== WebUI ====
* Move over to using Twisted-Web for the webserver.
* Move to only AJAX interface built upon Ext-JS.
==== Plugins ====
* Add Scheduler plugin
* Add Extractor plugin
* Add Scheduler plugin
* Add Extractor plugin
==== Misc ====
* PyGTK dependency bumped to => 2.12 to use new tooltip system
* Add new scripts for invoking UIs: deluge-gtk, deluge-web, deluge-console
* Remove GeoIP database from the source tree
* PyGTK dependency bumped to => 2.12 to use new tooltip system
* Add new scripts for invoking UIs: deluge-gtk, deluge-web, deluge-console
* Remove GeoIP database from the source tree
=== Deluge 1.1.0 - "Time gas!" (10 January 2009) ===
==== Core ====
* Implement #79 ability to change outgoing port range
* Implement #296 ability to change peer TOS byte
* Add per-torrent move on completed settings
* Implement #414 use async save_resume_data method
* Filter Manager with torrent filtering in get_torrents_status , for sidebar and plugins.
* Implement #368 add torrents by infohash/magnet uri (trackerless torrents)
* Remove remaining gtk functions in common
* Tracker icons.
* Add ETA for torrents with stop at seed ratio set
* Fix #47 the state and config files are no longer invalidated when there is no diskspace
* Fix #619 return "" instead of "Infinity" if seconds == 0 in ftime
* Add -P, --pidfile option to deluged
* Implement #79 ability to change outgoing port range
* Implement #296 ability to change peer TOS byte
* Add per-torrent move on completed settings
* Implement #414 use async save_resume_data method
* Filter Manager with torrent filtering in get_torrents_status , for sidebar and plugins.
* Implement #368 add torrents by infohash/magnet uri (trackerless torrents)
* Remove remaining gtk functions in common
* Tracker icons.
* Add ETA for torrents with stop at seed ratio set
* Fix #47 the state and config files are no longer invalidated when there is no diskspace
* Fix #619 return "" instead of "Infinity" if seconds == 0 in ftime
* Add -P, --pidfile option to deluged
==== GtkUI ====
* Add peer progress to the peers tab
* Add ability to manually add peers
* Sorting # column will place downloaders above seeds
* Remove dependency on libtorrent for add torrent dialog
* Allow adding multiple trackers at once in the edit tracker dialog
* Implement #28 Create Torrent Dialog
* Redesiged sidebar with filters for Active and Tracker (see Filter Manager)
* Implement #428 the ability to rename files and directories
* Implement #229 add date added column
* Implement #596 show speeds in title
* Fix #636 not setting the daemon's config directory when using --config= with the UI in classic mode.
* Fix #624 do not allow changing file priorities when using compact allocation
* Fix #602 re-did files/peers tab state saving/loading
* Fix gtk warnings
* Add protocol traffic statusbar item
* Rework the Remove Torrent Dialog to only have 2 options, remove data and remove from session.
* Add "Install Plugin" and "Rescan Plugins" buttons to the Plugins preferences
* Make active port test use internal graphic instead of launching browser
* Add peer progress to the peers tab
* Add ability to manually add peers
* Sorting # column will place downloaders above seeds
* Remove dependency on libtorrent for add torrent dialog
* Allow adding multiple trackers at once in the edit tracker dialog
* Implement #28 Create Torrent Dialog
* Redesiged sidebar with filters for Active and Tracker (see Filter Manager)
* Implement #428 the ability to rename files and directories
* Implement #229 add date added column
* Implement #596 show speeds in title
* Fix #636 not setting the daemon's config directory when using --config= with the UI in classic mode.
* Fix #624 do not allow changing file priorities when using compact allocation
* Fix #602 re-did files/peers tab state saving/loading
* Fix gtk warnings
* Add protocol traffic statusbar item
* Rework the Remove Torrent Dialog to only have 2 options, remove data and remove from session.
* Add "Install Plugin" and "Rescan Plugins" buttons to the Plugins preferences
* Make active port test use internal graphic instead of launching browser
==== WebUI ====
* Lots of smaller tweaks.
* All details tabs have the same features as in gtk-ui 1.0.x
* Persistent sessions #486
* Plugin improvements for easy use of templates and images in eggs. #497
* Classic template takes over some style elements from white template.
* https (for users that know how to create certificates)
* Easier apache mod_proxy use.
* Redesigned sidebar
* Lots of smaller tweaks.
* All details tabs have the same features as in gtk-ui 1.0.x
* Persistent sessions #486
* Plugin improvements for easy use of templates and images in eggs. #497
* Classic template takes over some style elements from white template.
* https (for users that know how to create certificates)
* Easier apache mod_proxy use.
* Redesigned sidebar
==== AjaxUI ====
* Hosted in a webui template.
* Hosted in a webui template.
==== ConsoleUI ====
* New ConsoleUI written by Idoa01
* Callable from command-line for scripts.
* New ConsoleUI written by Idoa01
* Callable from command-line for scripts.
==== Plugins ====
* Stats plugin for graphs.
* Label plugin for grouping torrents and per torrent settings.
* Stats plugin for graphs.
* Label plugin for grouping torrents and per torrent settings.
==== Misc ====
* Implement #478 display UI options in usage help
* Fix #547 add description to name field per HIG entry 2.1.1.1
* Fix #531 set default log level to ERROR and add 2 command-line options, "-L, --loglevel" and "-q, --quiet".
* Implement #478 display UI options in usage help
* Fix #547 add description to name field per HIG entry 2.1.1.1
* Fix #531 set default log level to ERROR and add 2 command-line options, "-L, --loglevel" and "-q, --quiet".

12
MANIFEST.in Normal file
View File

@ -0,0 +1,12 @@
recursive-include docs/man *
recursive-include deluge *
recursive-include win32 *
recursive-exclude deluge *.egg-link
exclude deluge/ui/web/gen_gettext.py
exclude deluge/ui/web/css/*-debug.css
exclude deluge/ui/web/js/build.sh
exclude deluge/ui/web/js/Deluge*.js
exclude deluge/ui/web/js/*-debug.js
prune deluge/ui/web/docs
prune deluge/scripts

23
create_potfiles_in.py Normal file
View File

@ -0,0 +1,23 @@
import os
# Paths to exclude
EXCLUSIONS = [
"deluge/scripts"
]
POTFILE_IN = "deluge/i18n/POTFILES.in"
print "Creating " + POTFILE_IN + " .."
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:
to_translate.append(os.path.join(dirpath, filename))
f = open(POTFILE_IN, "wb")
for line in to_translate:
f.write(line + "\n")
f.close()
print "Done"

5
debian/changelog vendored
View File

@ -1,5 +0,0 @@
deluge-torrent (0.9.08-1) unstable; urgency=low
* R8 release
-- Andrew Resch (andar) <andrewresch@gmail.com> Tue, 26 Aug 2008 16:31:14 -0800

View File

@ -1,5 +0,0 @@
deluge-torrent (0.6.0-svn3235-1) lenny; urgency=low
* Daily Build
-- Andrew Resch (andar) <andrewresch@gmail.com> Tue, 17 Jun 2008 16:31:14 -0800

View File

@ -1,5 +0,0 @@
deluge-torrent (0.6.0-svn3235-1) unstable; urgency=low
* Daily Build
-- Andrew Resch (andar) <andrewresch@gmail.com> Tue, 17 Jun 2008 16:31:14 -0800

View File

@ -1,5 +0,0 @@
deluge-torrent (0.6.0-svn3235-1) gutsy; urgency=low
* Daily Build
-- Andrew Resch (andar) <andrewresch@gmail.com> Tue, 17 Jun 2008 16:31:14 -0800

View File

@ -1,5 +0,0 @@
deluge-torrent (0.6.0-svn3235-1) hardy; urgency=low
* Daily Build
-- Andrew Resch (andar) <andrewresch@gmail.com> Tue, 17 Jun 2008 16:31:14 -0800

1
debian/compat vendored
View File

@ -1 +0,0 @@
5

21
debian/control vendored
View File

@ -1,21 +0,0 @@
Source: deluge-torrent
Section: net
Priority: optional
Maintainer: Andrew Resch (andar) <andrewresch@gmail.com>
Build-Depends: debhelper (>= 5.0.37.2), python-all-dev (>= 2.3.5-11), python-all, python-support (>= 0.5.3), libboost-dev (>= 1.34.1), libboost-thread-dev (>= 1.34.1), libboost-date-time-dev (>= 1.34.1), libboost-filesystem-dev (>= 1.34.1), libboost-python-dev (>= 1.34.1), libboost-iostreams-dev (>= 1.34.1), zlib1g-dev, libssl-dev, dpatch, python-setuptools
Standards-Version: 3.7.2
Package: deluge-torrent
Architecture: any
Depends: ${shlibs:Depends}, ${python:Depends}, python-gtk2, python-glade2, python-xdg, python-notify, notification-daemon | notification-daemon-xfce, python-dbus, librsvg2-common, python-pyopenssl, python-setuptools, python-pkg-resources
Conflicts: deluge-torrent-common
Replaces: deluge-torrent-common
Description: A Bittorrent client written in Python/PyGTK
Deluge is a Bittorrent client, created using Python and GTK+.
.
Deluge is intended to bring a native, full-featured client to Linux GTK
desktop environments such as Gnome and XFCE.
.
It uses Rasterbar's version of libtorrent.
.
Homepage: http://www.deluge-torrent.org/

View File

@ -1,19 +0,0 @@
Source: deluge-torrent
Section: net
Priority: optional
Maintainer: Andrew Resch (andar) <andrewresch@gmail.com>
Build-Depends: debhelper (>= 5.0.37.2), python-all-dev (>= 2.3.5-11), python-all, python-support (>= 0.5.3), libboost-dev (>= 1.33.1), libboost-thread-dev (>= 1.33.1), libboost-date-time-dev (>= 1.33.1), libboost-filesystem-dev (>= 1.33.1), libboost-serialization-dev (>= 1.33.1), libboost-program-options-dev (>= 1.33.1), libboost-regex-dev (>= 1.33.1), libboost-python-dev (>= 1.33.1), zlib1g-dev, libssl-dev, dpatch, python-setuptools
Standards-Version: 3.7.2
Package: deluge-torrent
Architecture: any
Depends: ${shlibs:Depends}, ${python:Depends}, python-gtk2, python-glade2, python-xdg, python-notify, notification-daemon | notification-daemon-xfce, python-dbus, librsvg2-common, python-pyopenssl, python-setuptools
Description: A Bittorrent client written in Python/PyGTK
Deluge is a Bittorrent client, created using Python and GTK+.
.
Deluge is intended to bring a native, full-featured client to Linux GTK
desktop environments such as Gnome and XFCE.
.
It uses Rasterbar's version of libtorrent.
.
Homepage: http://www.deluge-torrent.org/

View File

@ -1,19 +0,0 @@
Source: deluge-torrent
Section: net
Priority: optional
Maintainer: Andrew Resch (andar) <andrewresch@gmail.com>
Build-Depends: debhelper (>= 5.0.37.2), python-all-dev (>= 2.3.5-11), python-all, python-support (>= 0.5.3), libboost1.36-dev (>= 1.36), libboost-thread1.36-dev (>= 1.36), libboost-date-time1.36-dev (>= 1.36), libboost-filesystem1.36-dev (>= 1.36), libboost-serialization1.36-dev (>= 1.36), libboost-program-options1.36-dev (>= 1.36), libboost-regex1.36-dev (>= 1.36), libboost-python1.36-dev (>= 1.36), zlib1g-dev, libssl-dev, dpatch, python-setuptools
Standards-Version: 3.7.2
Package: deluge-torrent
Architecture: any
Depends: ${shlibs:Depends}, ${python:Depends}, python-gtk2, python-glade2, python-xdg, python-notify, notification-daemon | notification-daemon-xfce, python-dbus, librsvg2-common, python-pyopenssl, python-setuptools
Description: A Bittorrent client written in Python/PyGTK
Deluge is a Bittorrent client, created using Python and GTK+.
.
Deluge is intended to bring a native, full-featured client to Linux GTK
desktop environments such as Gnome and XFCE.
.
It uses Rasterbar's version of libtorrent.
.
Homepage: http://www.deluge-torrent.org/

99
debian/copyright vendored
View File

@ -1,99 +0,0 @@
This package was debianized by Marcos Pinto (markybob) <markybob@gmail.com> on
Fri, 31 Jul 2008 22:03:13 +0100.
It was downloaded from http://www.deluge-torrent.org/
Upstream Authors & Copyright:
Andrew Resch
Marcos Pinto
Sadrul Habib Chowdhury
Martijn Voncken
License:
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this package; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, 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.
On Debian systems, the complete text of the GNU General
Public License can be found in `/usr/share/common-licenses/GPL'.
libtorrent is (C) 2003-2008 Arvid Norberg arvid@cs.umu.se and its
python bindings were initially written by Daniel Wallin in 2006.
It is distributed unders terms of the BSD License below:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
* Neither the name of the author nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
"libtorrent/include/libtorrent/asio*" are (C) 2003-2008 Christopher
M. Kohlhoff <chris@kohlhoff.com> and distributed under terms of the Boost
Software License, Version 1.0 :
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"deluge/i18n/*" are (C) 2006 Rosetta Contributors and Canonical Ltd 2006 and distributed
under the same license as the deluge software.
The Debian packaging is (C) 2006-2008, Marcos Pinto (markybob)
<markybob@gmail.com> and is licensed under GPL3, see above.

2
debian/manpages vendored
View File

@ -1,2 +0,0 @@
docs/man/deluge.1
docs/man/deluged.1

3
debian/menu vendored
View File

@ -1,3 +0,0 @@
?package(deluge-torrent): needs="X11" section="Applications/Network/File Transfer" \
title="Deluge BitTorrent Client" longtitle="Bittorrent client written in Python/PyGTK" \
command="/usr/bin/deluge" icon="/usr/share/pixmaps/deluge.png"

View File

1
debian/pyversions vendored
View File

@ -1 +0,0 @@
2.5

View File

@ -1 +0,0 @@
2.5

View File

@ -1 +0,0 @@
2.5

75
debian/rules vendored
View File

@ -1,75 +0,0 @@
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# Dpatch targets
include /usr/share/dpatch/dpatch.make
# Available python (using debian/pyversions) and destdir
PYVERS = 2.5
DESTDIR = $(CURDIR)/debian/deluge-torrent
# We need to known the target arch to enable/disable amd64 hack
ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU)
ARCH64 = ia64 amd64 alpha kfreebsd-amd64 ppc64
CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
# python-libtorrent need to define AMD64 to work fine on a 64 bits system
ifneq (,$(findstring $(ARCH),$(ARCH64)))
CFLAGS += -DAMD64
endif
build: patch-stamp $(PYVERS:%=build-stamp%)
build-stamp%: patch-stamp
dh_testdir
CFLAGS="$(CFLAGS)" python$* setup.py build
touch $@
clean: unpatch
dh_testdir
dh_testroot
rm -rf build/
find . -name \*.pyc | xargs rm -f
rm -rf build-stamp*
dh_clean
install: build install-prereq $(PYVERS:%=install-%) install-finish
install-prereq:
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
install-%:
python$* setup.py install --root=$(DESTDIR) --prefix=/usr --no-compile
install-finish:
# Desktop menu
rm -rf $(DESTDIR)/usr/share/applications
install -D -m644 $(CURDIR)/deluge/data/share/applications/deluge.desktop $(DESTDIR)/usr/share/applications/deluge.desktop
binary-indep: build install
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_installmenu
dh_strip
dh_compress
dh_fixperms
dh_pysupport
dh_desktop
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install

View File

@ -45,7 +45,7 @@ supports.
"""
REQUIRED_VERSION = "0.14.5.0"
REQUIRED_VERSION = "0.14.9.0"
def check_version(LT):
from deluge.common import VersionSplit
@ -57,4 +57,4 @@ try:
check_version(lt)
except ImportError:
import libtorrent as lt
check_version(lt)
check_version(lt)

View File

@ -63,7 +63,24 @@ if not hasattr(json, "dumps"):
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 *
@ -132,6 +149,7 @@ def get_default_config_dir(filename=None):
else:
return os.path.join(os.environ.get("APPDATA"), "deluge")
else:
import xdg.BaseDirectory
if filename:
return os.path.join(xdg.BaseDirectory.save_config_path("deluge"), filename)
else:
@ -210,7 +228,7 @@ def open_url_in_browser(url):
:param url: the url to open
:type url: string
"""
import webbrowser
webbrowser.open(url)
@ -234,12 +252,12 @@ def fsize(fsize_b):
"""
fsize_kb = fsize_b / 1024.0
if fsize_kb < 1024:
return "%.1f KiB" % fsize_kb
return "%.1f %s" % (fsize_kb, _("KiB"))
fsize_mb = fsize_kb / 1024.0
if fsize_mb < 1024:
return "%.1f MiB" % fsize_mb
return "%.1f %s" % (fsize_mb, _("MiB"))
fsize_gb = fsize_mb / 1024.0
return "%.1f GiB" % fsize_gb
return "%.1f %s" % (fsize_gb, _("GiB"))
def fpcnt(dec):
"""
@ -340,21 +358,21 @@ def ftime(seconds):
def fdate(seconds):
"""
Formats a date string in the locale's date representation based on the systems timezone
Formats a date time string in the locale's date representation based on the systems timezone
:param seconds: time in seconds since the Epoch
:type seconds: float
:returns: a string in the locale's date representation or "" if seconds < 0
:returns: a string in the locale's datetime representation or "" if seconds < 0
:rtype: string
"""
if seconds < 0:
return ""
return time.strftime("%x", time.localtime(seconds))
return time.strftime("%x %X", time.localtime(seconds))
def is_url(url):
"""
A simple regex test to check if the URL is valid
A simple test to check if the URL is valid
:param url: the url to test
:type url: string
@ -367,8 +385,7 @@ def is_url(url):
True
"""
import re
return bool(re.search('^(https?|ftp|udp)://', url))
return url.partition('://')[0] in ("http", "https", "ftp", "udp")
def is_magnet(uri):
"""
@ -389,30 +406,6 @@ def is_magnet(uri):
return True
return False
def fetch_url(url):
"""
Downloads a torrent file from a given URL and checks the file's validity
:param url: the url of the .torrent file to fetch
:type url: string
:returns: the filepath to the downloaded file
:rtype: string
"""
import urllib
from deluge.log import LOG as log
try:
filename, headers = urllib.urlretrieve(url)
except IOError:
log.debug("Network error while trying to fetch torrent from %s", url)
else:
if filename.endswith(".torrent") or headers["content-type"] ==\
"application/x-bittorrent":
return filename
else:
log.debug("URL doesn't appear to be a valid torrent file: %s", url)
return None
def create_magnet_uri(infohash, name=None, trackers=[]):
"""
Creates a magnet uri
@ -469,13 +462,13 @@ def free_space(path):
:type path: string
:returns: the free space at path in bytes
:rtype: int
:raises InvalidPathError: if the path is not valid
"""
if not os.path.exists(path):
raise InvalidPathError("%s is not a valid path" % path)
if windows_check():
import win32file
sectors, bytes, free, total = map(long, win32file.GetDiskFreeSpace(path))
@ -514,47 +507,90 @@ def is_ip(ip):
return True
except socket.error:
return False
def path_join(*parts):
"""
An implementation of os.path.join that always uses / for the separator
to ensure that the correct paths are produced when working with internal
paths on Windows.
"""
path = ''
for part in parts:
if not part:
continue
elif part[0] == '/':
path = part
elif not path:
path = part
else:
path += '/' + part
return path
XML_ESCAPES = (
('&', '&amp;'),
('<', '&lt;'),
('>', '&gt;'),
('"', '&quot;'),
("'", '&apos;')
)
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.
:rtype: string
"""
for char, escape in XML_ESCAPES:
string = string.replace(escape, char)
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.
:rtype: string
"""
for char, escape in XML_ESCAPES:
string = string.replace(char, escape)
return string
class VersionSplit(object):
"""
Used for comparing version numbers.
:param ver: the version
:type ver: string
"""
def __init__(self, ver):
ver = ver.lower()
vs = ver.split("_") if "_" in ver else ver.split("-")
self.version = vs[0]
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", "alpha", "beta")):
self.suffix = vs[1]
if vs[-1] == 'dev':
self.dev = True
def __cmp__(self, ver):
"""
The comparison method.
:param ver: the version to compare with
:type ver: VersionSplit
"""
if self.version > ver.version or (self.suffix and self.suffix[:3] == "dev"):
return 1
if self.version < ver.version:
return -1
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
"""
# 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)

View File

@ -1,7 +1,7 @@
#
# component.py
#
# Copyright (C) 2007, 2008 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2007-2010 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
@ -33,196 +33,372 @@
#
#
from twisted.internet.defer import maybeDeferred, succeed, DeferredList, fail
from twisted.internet.task import LoopingCall
from deluge.log import LOG as log
COMPONENT_STATE = [
"Stopped",
"Started",
"Paused"
]
class ComponentAlreadyRegistered(Exception):
pass
class Component(object):
"""
Component objects are singletons managed by the :class:`ComponentRegistry`.
When a new Component object is instantiated, it will be automatically
registered with the :class:`ComponentRegistry`.
The ComponentRegistry has the ability to start, stop, pause and shutdown the
components registered with it.
**Events:**
**start()** - This method is called when the client has connected to a
Deluge core.
**stop()** - This method is called when the client has disconnected from a
Deluge core.
**update()** - This method is called every 1 second by default while the
Componented is in a *Started* state. The interval can be
specified during instantiation. The update() timer can be
paused by instructing the :class:`ComponentRegistry` to pause
this Component.
**shutdown()** - This method is called when the client is exiting. If the
Component is in a "Started" state when this is called, a
call to stop() will be issued prior to shutdown().
**States:**
A Component can be in one of these 5 states.
**Started** - The Component has been started by the :class:`ComponentRegistry`
and will have it's update timer started.
**Starting** - The Component has had it's start method called, but it hasn't
fully started yet.
**Stopped** - The Component has either been stopped or has yet to be started.
**Stopping** - The Component has had it's stop method called, but it hasn't
fully stopped yet.
**Paused** - The Component has had it's update timer stopped, but will
still be considered in a Started state.
"""
def __init__(self, name, interval=1, depend=None):
# Register with the ComponentRegistry
register(name, self, depend)
self._interval = interval
self._timer = None
self._state = COMPONENT_STATE.index("Stopped")
self._name = name
self._component_name = name
self._component_interval = interval
self._component_depend = depend
self._component_state = "Stopped"
self._component_timer = None
self._component_starting_deferred = None
self._component_stopping_deferred = None
_ComponentRegistry.register(self)
def get_state(self):
return self._state
def get_component_name(self):
return self._name
def start(self):
pass
def _start(self):
self._state = COMPONENT_STATE.index("Started")
def _component_start_timer(self):
if hasattr(self, "update"):
self._timer = LoopingCall(self.update)
self._timer.start(self._interval)
self._component_timer = LoopingCall(self.update)
self._component_timer.start(self._component_interval)
def stop(self):
pass
def _component_start(self):
def on_start(result):
self._component_state = "Started"
self._component_starting_deferred = None
self._component_start_timer()
return True
def _stop(self):
self._state = COMPONENT_STATE.index("Stopped")
try:
self._timer.stop()
except:
pass
def on_start_fail(result):
self._component_state = "Stopped"
self._component_starting_deferred = None
log.error(result)
return result
def _pause(self):
self._state = COMPONENT_STATE.index("Paused")
try:
self._timer.stop()
except:
pass
if self._component_state == "Stopped":
if hasattr(self, "start"):
self._component_state = "Starting"
d = maybeDeferred(self.start)
d.addCallback(on_start)
d.addErrback(on_start_fail)
self._component_starting_deferred = d
else:
d = maybeDeferred(on_start, None)
elif self._component_state == "Starting":
return self._component_starting_deferred
elif self._component_state == "Started":
d = succeed(True)
else:
d = fail("Cannot start a component not in a Stopped state!")
def _resume(self):
self._start()
return d
def shutdown(self):
pass
def _component_stop(self):
def on_stop(result):
self._component_state = "Stopped"
if self._component_timer and self._component_timer.running:
self._component_timer.stop()
return True
class ComponentRegistry:
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)
self._component_stopping_deferred = d
else:
d = maybeDeferred(on_stop, None)
if self._component_state == "Stopping":
return self._component_stopping_deferred
return succeed(None)
def _component_pause(self):
def on_pause(result):
self._component_state = "Paused"
if self._component_state == "Started":
if self._component_timer and self._component_timer.running:
d = maybeDeferred(self._component_timer.stop)
d.addCallback(on_pause)
else:
d = succeed(None)
elif self._component_state == "Paused":
d = succeed(None)
else:
d = fail("Cannot pause a component in a non-Started state!")
return d
def _component_resume(self):
def on_resume(result):
self._component_state = "Started"
if self._component_state == "Paused":
d = maybeDeferred(self._component_start_timer)
d.addCallback(on_resume)
else:
d = fail("Component cannot be resumed from a non-Paused state!")
return d
def _component_shutdown(self):
def on_stop(result):
if hasattr(self, "shutdown"):
return maybeDeferred(self.shutdown)
return succeed(None)
d = self._component_stop()
d.addCallback(on_stop)
return d
class ComponentRegistry(object):
"""
The ComponentRegistry holds a list of currently registered
:class:`Component` objects. It is used to manage the Components by
starting, stopping, pausing and shutting them down.
"""
def __init__(self):
self.components = {}
self.depend = {}
def register(self, name, obj, depend):
"""Registers a component.. depend must be list or None"""
log.debug("Registered %s with ComponentRegistry..", name)
self.components[name] = obj
if depend != None:
self.depend[name] = depend
def register(self, obj):
"""
Registers a component object with the registry. This is done
automatically when a Component object is instantiated.
def get(self, name):
"""Returns a reference to the component 'name'"""
return self.components[name]
:param obj: the Component object
:type obj: object
def start(self):
"""Starts all components"""
for component in self.components.keys():
self.start_component(component)
:raises ComponentAlreadyRegistered: if a component with the same name is already registered.
def start_component(self, name):
"""Starts a component"""
# Check to see if this component has any dependencies
if self.depend.has_key(name):
for depend in self.depend[name]:
self.start_component(depend)
"""
name = obj._component_name
if name in self.components:
raise ComponentAlreadyRegistered(
"Component already registered with name %s" % name)
# Only start if the component is stopped.
if self.components[name].get_state() == \
COMPONENT_STATE.index("Stopped"):
log.debug("Starting component %s..", name)
self.components[name].start()
self.components[name]._start()
self.components[obj._component_name] = obj
def stop(self):
"""Stops all components"""
for component in self.components.keys():
self.stop_component(component)
def deregister(self, name):
"""
Deregisters a component from the registry. A stop will be
issued to the component prior to deregistering it.
def stop_component(self, component):
if self.components[component].get_state() != \
COMPONENT_STATE.index("Stopped"):
log.debug("Stopping component %s..", component)
self.components[component].stop()
self.components[component]._stop()
:param name: the name of the component
:type name: string
def pause(self):
"""Pauses all components. Stops calling update()"""
for component in self.components.keys():
self.pause_component(component)
"""
def pause_component(self, component):
if self.components[component].get_state() not in \
[COMPONENT_STATE.index("Paused"), COMPONENT_STATE.index("Stopped")]:
log.debug("Pausing component %s..", component)
self.components[component]._pause()
if name in self.components:
log.debug("Deregistering Component: %s", name)
d = self.stop([name])
def on_stop(result, name):
del self.components[name]
return d.addCallback(on_stop, name)
else:
return succeed(None)
def resume(self):
"""Resumes all components. Starts calling update()"""
for component in self.components.keys():
self.resume_component(component)
def start(self, names=[]):
"""
Starts Components that are currently in a Stopped state and their
dependencies. If *names* is specified, will only start those
Components and their dependencies and if not it will start all
registered components.
def resume_component(self, component):
if self.components[component].get_state() == COMPONENT_STATE.index("Paused"):
log.debug("Resuming component %s..", component)
self.components[component]._resume()
:param names: a list of Components to start
:type names: list
def update(self):
"""Updates all components"""
for component in self.components.keys():
# Only update the component if it's started
if self.components[component].get_state() == \
COMPONENT_STATE.index("Started"):
self.components[component].update()
:returns: a Deferred object that will fire once all Components have been sucessfully started
:rtype: twisted.internet.defer.Deferred
return True
"""
# Start all the components if names is empty
if not names:
names = self.components.keys()
elif isinstance(names, str):
names = [names]
def on_depends_started(result, name):
return self.components[name]._component_start()
deferreds = []
for name in names:
if self.components[name]._component_depend:
# This component has depends, so we need to start them first.
d = self.start(self.components[name]._component_depend)
d.addCallback(on_depends_started, name)
deferreds.append(d)
else:
deferreds.append(self.components[name]._component_start())
return DeferredList(deferreds)
def stop(self, names=[]):
"""
Stops Components that are currently not in a Stopped state. If
*names* is specified, then it will only stop those Components,
and if not it will stop all the registered Components.
:param names: a list of Components to start
:type names: list
:returns: a Deferred object that will fire once all Components have been sucessfully stopped
:rtype: twisted.internet.defer.Deferred
"""
if not names:
names = self.components.keys()
elif isinstance(names, str):
names = [names]
deferreds = []
for name in names:
if name in self.components:
deferreds.append(self.components[name]._component_stop())
return DeferredList(deferreds)
def pause(self, names=[]):
"""
Pauses Components that are currently in a Started state. If
*names* is specified, then it will only pause those Components,
and if not it will pause all the registered Components.
:param names: a list of Components to pause
:type names: list
:returns: a Deferred object that will fire once all Components have been sucessfully paused
:rtype: twisted.internet.defer.Deferred
"""
if not names:
names = self.components.keys()
elif isinstance(names, str):
names = [names]
deferreds = []
for name in names:
if self.components[name]._component_state == "Started":
deferreds.append(self.components[name]._component_pause())
return DeferredList(deferreds)
def resume(self, names=[]):
"""
Resumes Components that are currently in a Paused state. If
*names* is specified, then it will only resume those Components,
and if not it will resume all the registered Components.
: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
:rtype: twisted.internet.defer.Deferred
"""
if not names:
names = self.components.keys()
elif isinstance(names, str):
names = [names]
deferreds = []
for name in names:
if self.components[name]._component_state == "Paused":
deferreds.append(self.components[name]._component_resume())
return DeferredList(deferreds)
def shutdown(self):
"""Shuts down all components. This should be called when the program
exits so that components can do any necessary clean-up."""
# Stop all components first
self.stop()
for component in self.components.keys():
log.debug("Shutting down component %s..", component)
try:
self.components[component].shutdown()
except Exception, e:
log.debug("Unable to call shutdown()")
log.exception(e)
"""
Shutdowns all Components regardless of state. This will call
:meth:`stop` on call the components prior to shutting down. This should
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
:rtype: twisted.internet.defer.Deferred
"""
deferreds = []
for component in self.components.values():
deferreds.append(component._component_shutdown())
return DeferredList(deferreds)
def update(self):
"""
Updates all Components that are in a Started state.
"""
for component in self.components.items():
component.update()
_ComponentRegistry = ComponentRegistry()
def register(name, obj, depend=None):
"""Registers a component with the registry"""
_ComponentRegistry.register(name, obj, depend)
deregister = _ComponentRegistry.deregister
start = _ComponentRegistry.start
stop = _ComponentRegistry.stop
pause = _ComponentRegistry.pause
resume = _ComponentRegistry.resume
update = _ComponentRegistry.update
shutdown = _ComponentRegistry.shutdown
def start(component=None):
"""Starts all components"""
if component == None:
_ComponentRegistry.start()
else:
_ComponentRegistry.start_component(component)
def get(name):
"""
Return a reference to a component.
def stop(component=None):
"""Stops all or specified components"""
if component == None:
_ComponentRegistry.stop()
else:
_ComponentRegistry.stop_component(component)
:param name: the Component name to get
:type name: string
def pause(component=None):
"""Pauses all or specificed components"""
if component == None:
_ComponentRegistry.pause()
else:
_ComponentRegistry.pause_component(component)
:returns: the Component object
:rtype: object
def resume(component=None):
"""Resumes all or specificed components"""
if component == None:
_ComponentRegistry.resume()
else:
_ComponentRegistry.resume_component(component)
:raises KeyError: if the Component does not exist
def update():
"""Updates all components"""
_ComponentRegistry.update()
def shutdown():
"""Shutdowns all components"""
_ComponentRegistry.shutdown()
def get(component):
"""Return a reference to the component"""
return _ComponentRegistry.get(component)
"""
return _ComponentRegistry.components[name]

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
@ -93,13 +93,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 +119,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
@ -156,6 +156,9 @@ class Config(object):
self.load()
def __contains__(self, item):
return item in self.__config
def __setitem__(self, key, value):
"""
See
@ -345,21 +348,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]
@ -368,8 +371,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)
@ -393,26 +396,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()
if self._save_timer and self._save_timer.active():
self._save_timer.cancel()
return
except Exception, e:
log.warning("Unable to open config file: %s", filename)
except IOError, 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

View File

@ -66,9 +66,17 @@ class AlertManager(component.Component):
# handlers is a dictionary of lists {"alert_type": [handler1,h2,..]}
self.handlers = {}
self.delayed_calls = []
def update(self):
self.delayed_calls = [dc for dc in self.delayed_calls if dc.active()]
self.handle_alerts()
def stop(self):
for dc in self.delayed_calls:
dc.cancel()
self.delayed_calls = []
def register_handler(self, alert_type, handler):
"""
Registers a function that will be called when 'alert_type' is pop'd
@ -117,7 +125,7 @@ class AlertManager(component.Component):
if alert_type in self.handlers:
for handler in self.handlers[alert_type]:
if not wait:
reactor.callLater(0, handler, alert)
self.delayed_calls.append(reactor.callLater(0, handler, alert))
else:
handler(alert)

View File

@ -124,6 +124,7 @@ class AuthManager(component.Component):
if line.startswith("#"):
# This is a comment line
continue
line = line.strip()
try:
lsplit = line.split(":")
except Exception, e:

View File

@ -75,7 +75,11 @@ class AutoAdd(component.Component):
for filename in os.listdir(self.config["autoadd_location"]):
if filename.split(".")[-1] == "torrent":
filepath = os.path.join(self.config["autoadd_location"], filename)
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:

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
@ -42,6 +42,7 @@ import shutil
import threading
import pkg_resources
import warnings
import tempfile
from twisted.internet import reactor, defer
@ -238,7 +239,13 @@ class Core(component.Component):
log.info("Attempting to add url %s", url)
def on_get_file(filename):
# We got the file, so add it to the session
data = open(filename, "rb").read()
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):
@ -247,7 +254,7 @@ class Core(component.Component):
log.error("Reason: %s", failure.getErrorMessage())
return failure
d = download_file(url, url.split("/")[-1], headers=headers)
d = download_file(url, tempfile.mkstemp()[1], headers=headers)
d.addCallback(on_get_file)
d.addErrback(on_get_file_error)
return d
@ -288,28 +295,6 @@ class Core(component.Component):
log.debug("Removing torrent %s from the core.", torrent_id)
return self.torrentmanager.remove(torrent_id, remove_data)
@export
def get_stats(self):
"""
Deprecated: please use get_session_status()
"""
warnings.warn("Use get_session_status() instead of get_stats()", DeprecationWarning)
stats = self.get_session_status(["payload_download_rate", "payload_upload_rate",
"dht_nodes", "has_incoming_connections", "download_rate", "upload_rate"])
stats.update({
#dynamic stats:
"num_connections":self.session.num_connections(),
"free_space":deluge.common.free_space(self.config["download_location"]),
#max config values:
"max_download":self.config["max_download_speed"],
"max_upload":self.config["max_upload_speed"],
"max_num_connections":self.config["max_connections_global"],
})
return stats
@export
def get_session_status(self, keys):
"""
@ -407,9 +392,9 @@ class Core(component.Component):
self.torrentmanager[torrent_id].resume()
@export
def get_torrent_status(self, torrent_id, keys):
def get_torrent_status(self, torrent_id, keys, diff=False):
# Build the status dictionary
status = self.torrentmanager[torrent_id].get_status(keys)
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()))
@ -418,7 +403,7 @@ class Core(component.Component):
return status
@export
def get_torrents_status(self, filter_dict, keys):
def get_torrents_status(self, filter_dict, keys, diff=False):
"""
returns all torrents , optionally filtered by filter_dict.
"""
@ -427,7 +412,7 @@ class Core(component.Component):
# 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)
status_dict[torrent_id] = self.get_torrent_status(torrent_id, keys, diff)
return status_dict
@ -490,24 +475,6 @@ class Core(component.Component):
"""Returns the current number of connections"""
return self.session.num_connections()
@export
def get_dht_nodes(self):
"""Returns the number of dht nodes"""
warnings.warn("Use get_session_status().", DeprecationWarning)
return self.session.status().dht_nodes
@export
def get_download_rate(self):
"""Returns the payload download rate"""
warnings.warn("Use get_session_status().", DeprecationWarning)
return self.session.status().payload_download_rate
@export
def get_upload_rate(self):
"""Returns the payload upload rate"""
warnings.warn("Use get_session_status().", DeprecationWarning)
return self.session.status().payload_upload_rate
@export
def get_available_plugins(self):
"""Returns a list of plugins available in the core"""
@ -605,12 +572,6 @@ 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
def get_health(self):
"""Returns True if we have established incoming connections"""
warnings.warn("Use get_session_status().", DeprecationWarning)
return self.session.status().has_incoming_connections
@export
def get_path_size(self, path):
"""Returns the size of the file or folder 'path' and -1 if the path is
@ -622,7 +583,7 @@ class Core(component.Component):
webseeds, private, created_by, trackers, add_to_session):
log.debug("creating torrent..")
threading.Thread(target=_create_torrent_thread,
threading.Thread(target=self._create_torrent_thread,
args=(
path,
tracker,
@ -655,14 +616,21 @@ class Core(component.Component):
self.add_torrent_file(os.path.split(target)[1], open(target, "rb").read(), options)
@export
def upload_plugin(self, filename, plugin_data):
def upload_plugin(self, filename, filedump):
"""This method is used to upload new plugins to the daemon. It is used
when connecting to the daemon remotely and installing a new plugin on
the client side. 'plugin_data' is a xmlrpc.Binary object of the file data,
ie, plugin_file.read()"""
try:
filedump = base64.decodestring(filedump)
except Exception, e:
log.error("There was an error decoding the filedump string!")
log.exception(e)
return
f = open(os.path.join(deluge.configmanager.get_config_dir(), "plugins", filename), "wb")
f.write(plugin_data.data)
f.write(filedump)
f.close()
component.get("CorePluginManager").scan_for_plugins()
@ -780,7 +748,8 @@ class Core(component.Component):
"""
from twisted.web.client import getPage
d = getPage("http://deluge-torrent.org/test_port.php?port=%s" % self.get_listen_port())
d = getPage("http://deluge-torrent.org/test_port.php?port=%s" %
self.get_listen_port(), timeout=30)
def on_get_page(result):
return bool(int(result))
@ -790,11 +759,12 @@ class Core(component.Component):
return d
@export
def get_free_space(self, path):
def get_free_space(self, path=None):
"""
Returns the number of free bytes at path
:param path: the path to check free space at
:param path: the path to check free space at, if None, use the default
download location
:type path: string
:returns: the number of free bytes at path
@ -803,7 +773,12 @@ class Core(component.Component):
:raises InvalidPathError: if the path is invalid
"""
return deluge.common.free_space(path)
if not path:
path = self.config["download_location"]
try:
return deluge.common.free_space(path)
except InvalidPathError:
return 0
@export
def get_libtorrent_version(self):

View File

@ -105,6 +105,8 @@ class Daemon(object):
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
# Twisted catches signals to terminate, so just have it call the shutdown
# method.

View File

@ -84,7 +84,7 @@ def tracker_error_filter(torrent_ids, values):
# If this is a tracker_host, then we need to filter on it
if values[0] != "Error":
for torrent_id in torrent_ids:
if values[0] in tm[torrent_id].get_status(["tracker_host"])["tracker_host"]:
if values[0] == tm[torrent_id].get_status(["tracker_host"])["tracker_host"]:
filtered_torrent_ids.append(torrent_id)
return filtered_torrent_ids
@ -196,6 +196,8 @@ class FilterManager(component.Component):
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"]["Error"] = len(tracker_error_filter(torrent_ids, ("Error",)))

View File

@ -97,7 +97,7 @@ class OldStateUpgrader:
torrent_info = lt.torrent_info(lt.bdecode(_file.read()))
_file.close()
except (IOError, RuntimeError), e:
log.warning("Unable to open %s: %s", filepath, e)
log.warning("Unable to open %s: %s", torrent_path, e)
# Copy the torrent file to the new location
import shutil

View File

@ -96,8 +96,7 @@ class PluginManager(deluge.pluginmanagerbase.PluginManagerBase,
try:
status[field] = self.status_fields[field](torrent_id)
except KeyError:
log.warning("Status field %s is not registered with the\
PluginManager.", field)
pass
return status
def register_status_field(self, field, function):

View File

@ -58,6 +58,7 @@ DEFAULT_PREFS = {
"listen_ports": [6881, 6891],
"listen_interface": "",
"copy_torrent_file": False,
"del_copy_torrent_file": False,
"torrentfiles_location": deluge.common.get_default_download_dir(),
"plugins_location": os.path.join(deluge.configmanager.get_config_dir(), "plugins"),
"prioritize_first_last_pieces": False,
@ -151,7 +152,6 @@ class PreferencesManager(component.Component):
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",
@ -232,6 +232,11 @@ class PreferencesManager(component.Component):
self.new_release_timer.stop()
# Config set functions
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):
component.get("EventManager").emit(ConfigValueChangedEvent(key, value))
@ -273,8 +278,7 @@ class PreferencesManager(component.Component):
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:
@ -283,13 +287,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")
@ -386,51 +388,39 @@ 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)
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):
log.debug("Sending anonymous stats..")
@ -490,8 +480,7 @@ class PreferencesManager(component.Component):
def _on_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):
log.debug("%s: %s", key, value)
@ -513,10 +502,8 @@ class PreferencesManager(component.Component):
def _on_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):
log.debug("%s: %s", key, value)
self.settings.cache_expiry = value
self.session.set_settings(self.settings)
self.session_set_setting("cache_expiry", value)

View File

@ -47,7 +47,11 @@ from twisted.internet import ssl, reactor, defer
from OpenSSL import crypto, SSL
from types import FunctionType
import deluge.rencode as rencode
try:
import rencode
except ImportError:
import deluge.rencode as rencode
from deluge.log import LOG as log
import deluge.component as component
@ -86,6 +90,32 @@ def export(auth_level=AUTH_LEVEL_DEFAULT):
else:
return wrap
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] + "("
if call[2]:
s += ", ".join([str(x) for x in call[2]])
if call[3]:
if call[2]:
s += ", "
s += ", ".join([key + "=" + str(value) for key, value in call[3].items()])
s += ")"
except UnicodeEncodeError:
return "UnicodeEncodeError, call: %s" % call
else:
return s
class DelugeError(Exception):
pass
@ -113,8 +143,8 @@ class DelugeRPCProtocol(Protocol):
"""
This method is called whenever data 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 a thread
with :meth:`dispatch`.
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.
@ -131,7 +161,7 @@ class DelugeRPCProtocol(Protocol):
try:
request = rencode.loads(dobj.decompress(data))
except Exception, e:
log.debug("Received possible invalid message (%r): %s", data, 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
@ -151,24 +181,7 @@ class DelugeRPCProtocol(Protocol):
if len(call) != 4:
log.debug("Received invalid rpc request: number of items in request is %s", len(call))
continue
# Format the RPCRequest message for debug printing
try:
s = call[1] + "("
if call[2]:
s += ", ".join([str(x) for x in call[2]])
if call[3]:
if call[2]:
s += ", "
s += ", ".join([key + "=" + str(value) for key, value in call[3].items()])
s += ")"
except UnicodeEncodeError:
pass
#log.debug("RPCRequest had some non-ascii text..")
else:
pass
#log.debug("RPCRequest: %s", s)
#log.debug("RPCRequest: %s", format_request(call))
reactor.callLater(0, self.dispatch, *call)
def sendData(self, data):
@ -177,6 +190,7 @@ 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)))
@ -244,7 +258,7 @@ class DelugeRPCProtocol(Protocol):
try:
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()
@ -273,11 +287,14 @@ class DelugeRPCProtocol(Protocol):
if method in self.factory.methods and self.transport.sessionno in self.factory.authorized_sessions:
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))
# 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()
@ -324,6 +341,8 @@ 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
@ -399,6 +418,44 @@ class RPCServer(component.Component):
"""
return self.factory.methods.keys()
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
"""
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 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.

View File

@ -36,6 +36,7 @@
import os
import time
from urllib import unquote
from urlparse import urlparse
from deluge._libtorrent import lt
@ -72,7 +73,7 @@ class TorrentOptions(dict):
self["file_priorities"] = []
self["mapped_files"] = {}
class Torrent:
class Torrent(object):
"""Torrent holds information about torrents added to the libtorrent session.
"""
def __init__(self, handle, options, state=None, filename=None, magnet=None):
@ -80,6 +81,16 @@ class Torrent:
# Get the core config
self.config = ConfigManager("core.conf")
self.rpcserver = component.get("RPCServer")
# This dict holds previous status dicts returned for this torrent
# We use this to return dicts that only contain changes from the previous
# {session_id: status_dict, ...}
self.prev_status = {}
from twisted.internet.task import LoopingCall
self.prev_status_cleanup_loop = LoopingCall(self.cleanup_prev_status)
self.prev_status_cleanup_loop.start(10)
# Set the libtorrent handle
self.handle = handle
# Set the torrent_id for this torrent
@ -113,9 +124,6 @@ class Torrent:
except RuntimeError:
self.torrent_info = None
# Files dictionary
self.files = self.get_files()
# Default total_uploaded to 0, this may be changed by the state
self.total_uploaded = 0
@ -254,7 +262,7 @@ class Torrent:
self.options["move_completed_path"] = move_completed_path
def set_file_priorities(self, file_priorities):
if len(file_priorities) != len(self.files):
if len(file_priorities) != len(self.get_files()):
log.debug("file_priorities len != num_files")
self.options["file_priorities"] = self.handle.file_priorities()
return
@ -288,12 +296,9 @@ class Torrent:
if trackers == None:
trackers = []
for value in self.handle.trackers():
if lt.version_minor < 15:
tracker = {}
tracker["url"] = value.url
tracker["tier"] = value.tier
else:
tracker = value
tracker = {}
tracker["url"] = value.url
tracker["tier"] = value.tier
trackers.append(tracker)
self.trackers = trackers
self.tracker_host = None
@ -302,14 +307,11 @@ class Torrent:
log.debug("Setting trackers for %s: %s", self.torrent_id, trackers)
tracker_list = []
if lt.version_minor < 15:
for tracker in trackers:
new_entry = lt.announce_entry(tracker["url"])
new_entry.tier = tracker["tier"]
tracker_list.append(new_entry)
self.handle.replace_trackers(tracker_list)
else:
self.handle.replace_trackers(trackers)
for tracker in trackers:
new_entry = lt.announce_entry(tracker["url"])
new_entry.tier = tracker["tier"]
tracker_list.append(new_entry)
self.handle.replace_trackers(tracker_list)
# Print out the trackers
#for t in self.handle.trackers():
@ -337,6 +339,10 @@ class Torrent:
LTSTATE = deluge.common.LT_TORRENT_STATE
ltstate = int(self.handle.status().state)
# Set self.state to the ltstate right away just incase we don't hit some
# of the logic below
self.state = str(ltstate)
log.debug("set_state_based_on_ltstate: %s", deluge.common.LT_TORRENT_STATE[ltstate])
log.debug("session.is_paused: %s", component.get("Core").session.is_paused())
@ -387,12 +393,11 @@ class Torrent:
else:
status = self.status
if self.is_finished and (self.options["stop_at_ratio"] or self.config["stop_seed_at_ratio"]):
if self.is_finished and self.options["stop_at_ratio"]:
# We're a seed, so calculate the time to the 'stop_share_ratio'
if not status.upload_payload_rate:
return 0
stop_ratio = self.config["stop_seed_ratio"] if self.config["stop_seed_at_ratio"] else self.options["stop_ratio"]
stop_ratio = self.options["stop_ratio"]
return ((status.all_time_download * stop_ratio) - status.all_time_upload) / status.upload_payload_rate
left = status.total_wanted - status.total_done
@ -414,9 +419,7 @@ class Torrent:
else:
status = self.status
if status.all_time_download > 0:
downloaded = status.all_time_download
elif status.total_done > 0:
if status.total_done > 0:
# We use 'total_done' if the downloaded value is 0
downloaded = status.total_done
else:
@ -491,7 +494,7 @@ class Torrent:
file_progress = self.handle.file_progress()
ret = []
for i,f in enumerate(self.files):
for i,f in enumerate(self.get_files()):
try:
ret.append(float(file_progress[i]) / float(f["size"]))
except ZeroDivisionError:
@ -536,8 +539,21 @@ class Torrent:
return host
return ""
def get_status(self, keys):
"""Returns the status of the torrent based on the keys provided"""
def get_status(self, keys, diff=False):
"""
Returns the status of the torrent based on the keys provided
: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 dictionary of the status keys and their values
:rtype: dict
"""
# Create the full dictionary
self.status = self.handle.status()
if self.handle.has_metadata():
@ -559,7 +575,6 @@ class Torrent:
"distributed_copies": distributed_copies,
"download_payload_rate": self.status.download_payload_rate,
"file_priorities": self.options["file_priorities"],
"files": self.files,
"hash": self.torrent_id,
"is_auto_managed": self.options["auto_managed"],
"is_finished": self.is_finished,
@ -608,12 +623,29 @@ class Torrent:
def ti_name():
if self.handle.has_metadata():
name = self.torrent_info.file_at(0).path.split("/", 1)[0]
if not name:
name = self.torrent_info.name()
try:
return name.decode("utf8", "ignore")
except UnicodeDecodeError:
return name
elif self.magnet:
try:
keys = dict([k.split('=') for k in self.magnet.split('?')[-1].split('&')])
name = keys.get('dn')
if not name:
return self.torrent_id
name = unquote(name).replace('+', ' ')
try:
return name.decode("utf8", "ignore")
except UnicodeDecodeError:
return name
except:
pass
return self.torrent_id
def ti_priv():
if self.handle.has_metadata():
return self.torrent_info.priv()
@ -639,6 +671,7 @@ class Torrent:
"comment": ti_comment,
"eta": self.get_eta,
"file_progress": self.get_file_progress,
"files": self.get_files,
"is_seed": self.handle.is_seed,
"name": ti_name,
"num_files": ti_num_files,
@ -665,6 +698,24 @@ class Torrent:
status_dict[key] = full_status[key]
elif key in fns:
status_dict[key] = fns[key]()
session_id = self.rpcserver.get_session_id()
if diff:
if session_id in self.prev_status:
# We have a previous status dict, so lets make a diff
status_diff = {}
for key, value in status_dict.items():
if key in self.prev_status[session_id]:
if value != self.prev_status[session_id][key]:
status_diff[key] = value
else:
status_diff[key] = value
self.prev_status[session_id] = status_dict
return status_diff
self.prev_status[session_id] = status_dict
return status_dict
return status_dict
@ -709,13 +760,8 @@ class Torrent:
if self.handle.is_finished():
# If the torrent has already reached it's 'stop_seed_ratio' then do not do anything
if self.config["stop_seed_at_ratio"] or self.options["stop_at_ratio"]:
if self.options["stop_at_ratio"]:
ratio = self.options["stop_ratio"]
else:
ratio = self.config["stop_seed_ratio"]
if self.get_ratio() >= ratio:
if self.options["stop_at_ratio"]:
if self.get_ratio() >= self.options["stop_ratio"]:
#XXX: This should just be returned in the RPC Response, no event
#self.signals.emit_event("torrent_resume_at_stop_ratio")
return
@ -742,6 +788,14 @@ class Torrent:
def move_storage(self, dest):
"""Move a torrent's storage location"""
if not os.path.exists(dest):
try:
# Try to make the destination path if it doesn't exist
os.makedirs(dest)
except IOError, e:
log.exception(e)
log.error("Could not move storage for torrent %s since %s does not exist and could not create the directory.", self.torrent_id, dest)
return False
try:
self.handle.move_storage(dest.encode("utf8"))
except:
@ -762,9 +816,10 @@ class Torrent:
self.torrent_id)
log.debug("Writing torrent file: %s", path)
try:
ti = self.handle.get_torrent_info()
md = lt.bdecode(ti.metadata())
log.debug("md: %s", md)
self.torrent_info = self.handle.get_torrent_info()
# Regenerate the file priorities
self.set_file_priorities([])
md = lt.bdecode(self.torrent_info.metadata())
torrent_file = {}
torrent_file["info"] = md
open(path, "wb").write(lt.bencode(torrent_file))
@ -816,7 +871,7 @@ class Torrent:
"""Renames files in the torrent. 'filenames' should be a list of
(index, filename) pairs."""
for index, filename in filenames:
self.handle.rename_file(index, filename)
self.handle.rename_file(index, filename.encode("utf-8"))
def rename_folder(self, folder, new_folder):
"""Renames a folder within a torrent. This basically does a file rename
@ -834,5 +889,16 @@ class Torrent:
if f["path"].startswith(folder):
# Keep a list of filerenames we're waiting on
wait_on_folder[2].append(f["index"])
self.handle.rename_file(f["index"], f["path"].replace(folder, new_folder, 1))
self.handle.rename_file(f["index"], f["path"].replace(folder, new_folder, 1).encode("utf-8"))
self.waiting_on_folder_rename.append(wait_on_folder)
def cleanup_prev_status(self):
"""
This method gets called to check the validity of the keys in the prev_status
dict. If the key is no longer valid, the dict will be deleted.
"""
for key in self.prev_status.keys():
if not self.rpcserver.is_session_valid(key):
del self.prev_status[key]

View File

@ -56,6 +56,7 @@ from deluge.configmanager import ConfigManager, get_config_dir
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.log import LOG as log
@ -132,6 +133,10 @@ class TorrentManager(component.Component):
# Get the core config
self.config = ConfigManager("core.conf")
# Make sure the state folder has been created
if not os.path.exists(os.path.join(get_config_dir(), "state")):
os.makedirs(os.path.join(get_config_dir(), "state"))
# Create the torrents dict { torrent_id: Torrent }
self.torrents = {}
@ -142,7 +147,7 @@ class TorrentManager(component.Component):
# 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
self.resume_data = {}
@ -187,6 +192,8 @@ 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)
def start(self):
# Get the pluginmanager reference
@ -200,34 +207,39 @@ class TorrentManager(component.Component):
# Save the state every 5 minutes
self.save_state_timer = LoopingCall(self.save_state)
self.save_state_timer.start(200)
self.save_state_timer.start(200, False)
self.save_resume_data_timer = LoopingCall(self.save_resume_data)
self.save_resume_data_timer.start(190)
def stop(self):
# Stop timers
self.save_state_timer.stop()
self.save_resume_data_timer.stop()
if self.save_state_timer.running:
self.save_state_timer.stop()
if self.save_resume_data_timer.running:
self.save_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
# 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 = []
for key in self.torrents.keys():
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:
@ -246,12 +258,13 @@ class TorrentManager(component.Component):
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"):
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.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
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():
@ -294,7 +307,7 @@ class TorrentManager(component.Component):
def legacy_delete_resume_data(self, torrent_id):
"""Deletes the .fastresume file"""
path = os.path.join(self.config["state_location"],
path = os.path.join(get_config_dir(), "state",
torrent_id + ".fastresume")
log.debug("Deleting fastresume file: %s", path)
try:
@ -343,24 +356,23 @@ class TorrentManager(component.Component):
options["move_completed_path"] = state.move_completed_path
options["add_paused"] = state.paused
if not state.magnet:
add_torrent_params["ti"] =\
self.get_torrent_info_from_file(
os.path.join(get_config_dir(),
"state", state.torrent_id + ".torrent"))
if not add_torrent_params["ti"]:
log.error("Unable to add torrent!")
return
else:
ti = self.get_torrent_info_from_file(
os.path.join(get_config_dir(),
"state", state.torrent_id + ".torrent"))
if ti:
add_torrent_params["ti"] = ti
elif state.magnet:
magnet = state.magnet
else:
log.error("Unable to add torrent!")
return
# Handle legacy case with storing resume data in individual files
# for each torrent
if resume_data is None:
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
else:
# We have a torrent_info object so we're not loading from state.
@ -377,7 +389,7 @@ class TorrentManager(component.Component):
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, name)
torrent_info.rename_file(index, utf8_encoded(name))
add_torrent_params["ti"] = torrent_info
add_torrent_params["resume_data"] = ""
@ -391,14 +403,8 @@ class TorrentManager(component.Component):
else:
storage_mode = lt.storage_mode_t(1)
try:
# Try to encode this as utf8 if needed
options["download_location"] = options["download_location"].encode("utf8")
except UnicodeDecodeError:
pass
# Fill in the rest of the add_torrent_params dictionary
add_torrent_params["save_path"] = options["download_location"]
add_torrent_params["save_path"] = utf8_encoded(options["download_location"])
add_torrent_params["storage_mode"] = storage_mode
add_torrent_params["paused"] = True
add_torrent_params["auto_managed"] = False
@ -469,6 +475,7 @@ class TorrentManager(component.Component):
# Emit the torrent_added signal
component.get("EventManager").emit(TorrentAddedEvent(torrent.torrent_id))
log.info("Torrent %s added by user: %s", torrent.get_status(["name"])["name"], component.get("RPCServer").get_session_user())
return torrent.torrent_id
def load_torrent(self, torrent_id):
@ -508,6 +515,8 @@ class TorrentManager(component.Component):
if torrent_id not in self.torrents:
raise InvalidTorrentError("torrent_id not in session")
torrent_name = self.torrents[torrent_id].get_status(["name"])["name"]
# Emit the signal to the clients
component.get("EventManager").emit(PreTorrentRemovedEvent(torrent_id))
@ -517,7 +526,7 @@ class TorrentManager(component.Component):
except (RuntimeError, KeyError), e:
log.warning("Error removing torrent: %s", e)
return False
# Remove fastresume data if it is exists
resume_data = self.load_resume_data_file()
resume_data.pop(torrent_id, None)
@ -526,6 +535,24 @@ class TorrentManager(component.Component):
# Remove the .torrent file in the state
self.torrents[torrent_id].delete_torrentfile()
# Remove the torrent file from the user specified directory
filename = self.torrents[torrent_id].filename
if self.config["copy_torrent_file"] \
and self.config["del_copy_torrent_file"] \
and filename:
try:
users_torrent_file = os.path.join(
self.config["torrentfiles_location"],
filename)
log.info("Delete user's torrent file: %s",
users_torrent_file)
os.remove(users_torrent_file)
except Exception, e:
log.warning("Unable to remove copy torrent file: %s", e)
# Stop the looping call
self.torrents[torrent_id].prev_status_cleanup_loop.stop()
# Remove the torrent from deluge's session
try:
del self.torrents[torrent_id]
@ -537,7 +564,7 @@ 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):
@ -618,7 +645,7 @@ class TorrentManager(component.Component):
# Pickle the TorrentManagerState object
try:
log.debug("Saving torrent state file.")
state_file = open(os.path.join(get_config_dir(),
state_file = open(os.path.join(get_config_dir(),
"state", "torrents.state.new"), "wb")
cPickle.dump(state, state_file)
state_file.flush()
@ -645,13 +672,13 @@ class TorrentManager(component.Component):
Saves resume data for list of torrent_ids or for all torrents if
torrent_ids is None
"""
if torrent_ids is None:
torrent_ids = self.torrents.keys()
for torrent_id in torrent_ids:
self.torrents[torrent_id].save_resume_data()
self.num_resume_data = len(torrent_ids)
def load_resume_data_file(self):
@ -664,35 +691,35 @@ class TorrentManager(component.Component):
fastresume_file.close()
except (EOFError, IOError, Exception), e:
log.warning("Unable to load fastresume file: %s", e)
# If the libtorrent bdecode doesn't happen properly, it will return None
# so we need to make sure we return a {}
if resume_data is None:
return {}
return resume_data
def save_resume_data_file(self, resume_data=None):
"""
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
"""
# 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 = {}
@ -775,20 +802,19 @@ class TorrentManager(component.Component):
total_download = torrent.get_status(["total_payload_download"])["total_payload_download"]
# Move completed download to completed folder if needed
if not torrent.is_finished:
if not torrent.is_finished and total_download:
move_path = None
if torrent.options["move_completed"] and total_download:
if torrent.options["move_completed"]:
move_path = torrent.options["move_completed_path"]
if torrent.options["download_location"] != move_path and \
torrent.options["download_location"] == self.config["download_location"]:
if torrent.options["download_location"] != move_path:
torrent.move_storage(move_path)
torrent.is_finished = True
component.get("EventManager").emit(TorrentFinishedEvent(torrent_id))
torrent.update_state()
# 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
@ -882,6 +908,7 @@ class TorrentManager(component.Component):
except:
return
torrent.set_save_path(alert.handle.save_path())
torrent.set_move_completed(False)
def on_alert_torrent_resumed(self, alert):
log.debug("on_alert_torrent_resumed")
@ -914,9 +941,9 @@ class TorrentManager(component.Component):
def on_alert_save_resume_data(self, alert):
log.debug("on_alert_save_resume_data")
torrent_id = str(alert.handle.info_hash())
try:
torrent = self.torrents[torrent_id]
except:
@ -925,9 +952,9 @@ class TorrentManager(component.Component):
# 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()
def on_alert_save_resume_data_failed(self, alert):
@ -936,12 +963,12 @@ class TorrentManager(component.Component):
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()
def on_alert_file_renamed(self, alert):
log.debug("on_alert_file_renamed")
@ -951,7 +978,6 @@ class TorrentManager(component.Component):
except:
return
torrent_id = str(alert.handle.info_hash())
torrent.files[alert.index]["path"] = alert.name
# We need to see if this file index is in a waiting_on_folder list
folder_rename = False
@ -988,3 +1014,9 @@ class TorrentManager(component.Component):
except:
return
torrent.update_state()
def on_alert_file_completed(self, alert):
log.debug("file_completed_alert: %s", alert.message())
torrent_id = str(alert.handle.info_hash())
component.get("EventManager").emit(
TorrentFileCompletedEvent(torrent_id, alert.index))

Binary file not shown.

After

Width:  |  Height:  |  Size: 723 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 906 B

View File

@ -3,7 +3,7 @@ Version=1.0
Name=Deluge BitTorrent Client
GenericName=Bittorrent Client
Comment=Transfer files using the Bittorrent protocol
Exec=deluge
Exec=deluge-gtk
Icon=deluge
Terminal=false
Type=Application

View File

@ -1,7 +1,7 @@
#
# gtkui.py
# decorators.py
#
# Copyright (C) 2008 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2010 John Garland <johnnybg+deluge@gmail.com>
#
# Deluge is free software.
#
@ -33,16 +33,19 @@
#
#
import gtk
from functools import wraps
from deluge.log import LOG as log
from deluge.ui.client import client
from deluge.plugins.pluginbase import GtkPluginBase
import deluge.component as component
import deluge.common
def proxy(proxy_func):
"""
Factory class which returns a decorator that passes
the decorated function to a proxy function
class GtkUI(GtkPluginBase):
def enable(self):
pass
def disable(self):
pass
:param proxy_func: the proxy function
:type proxy_func: function
"""
def decorator(func):
@wraps(func)
def wrapper(*args, **kwargs):
return proxy_func(func, *args, **kwargs)
return wrapper
return decorator

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
@ -41,6 +41,17 @@ and subsequently emitted to the clients.
"""
known_events = {}
class DelugeEventMetaClass(type):
"""
This metaclass simply keeps a list of all events classes created.
"""
def __init__(cls, name, bases, dct):
super(DelugeEventMetaClass, cls).__init__(name, bases, dct)
if name != "DelugeEvent":
known_events[name] = cls
class DelugeEvent(object):
"""
The base class for all events.
@ -49,6 +60,8 @@ class DelugeEvent(object):
:prop args: a list of the attribute values
"""
__metaclass__ = DelugeEventMetaClass
def _get_name(self):
return self.__class__.__name__
@ -151,6 +164,22 @@ class TorrentResumedEvent(DelugeEvent):
"""
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 NewVersionAvailableEvent(DelugeEvent):
"""
Emitted when a more recent version of Deluge is available.

View File

@ -36,12 +36,16 @@ 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 os.path
import zlib
class HTTPDownloader(client.HTTPDownloader):
"""
Factory class for downloading files and keeping track of progress.
"""
def __init__(self, url, filename, part_callback=None, headers=None):
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
@ -53,10 +57,14 @@ class HTTPDownloader(client.HTTPDownloader):
:param headers: any optional headers to send
:type headers: dictionary
"""
self.__part_callback = part_callback
self.part_callback = part_callback
self.current_length = 0
self.decoder = None
self.value = filename
client.HTTPDownloader.__init__(self, url, filename, headers=headers)
self.force_filename = force_filename
self.allow_compression = allow_compression
agent = "Deluge/%s (http://deluge-torrent.org)" % get_version()
client.HTTPDownloader.__init__(self, url, filename, headers=headers, agent=agent)
def gotStatus(self, version, status, message):
self.code = int(status)
@ -68,7 +76,25 @@ class HTTPDownloader(client.HTTPDownloader):
self.total_length = int(headers["content-length"][0])
else:
self.total_length = 0
elif self.code in (http.TEMPORARY_REDIRECT, http.MOVED_PERMANENTLY):
if self.allow_compression and "content-encoding" in headers and \
headers["content-encoding"][0] in ("gzip", "x-gzip", "deflate"):
# Adding 32 to the wbits enables gzip & zlib decoding (with automatic header detection)
# Adding 16 just enables gzip decoding (no zlib)
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
elif self.code in (http.MOVED_PERMANENTLY, http.FOUND, http.SEE_OTHER, http.TEMPORARY_REDIRECT):
location = headers["location"][0]
error = PageRedirect(self.code, location=location)
self.noPage(Failure(error))
@ -78,12 +104,55 @@ class HTTPDownloader(client.HTTPDownloader):
def pagePart(self, data):
if self.code == http.OK:
self.current_length += len(data)
if self.__part_callback:
self.__part_callback(data, self.current_length, self.total_length)
if self.decoder:
data = self.decoder.decompress(data)
if self.part_callback:
self.part_callback(data, self.current_length, self.total_length)
return client.HTTPDownloader.pagePart(self, data)
def download_file(url, filename, callback=None, headers=None):
def pageEnd(self):
if self.decoder:
data = self.decoder.flush()
self.current_length -= len(data)
self.decoder = None
self.pagePart(data)
return client.HTTPDownloader.pageEnd(self)
def sanitise_filename(filename):
"""
Sanitises a filename to use as a download destination file.
Logs any filenames that could be considered malicious.
:param filename: the filename to sanitise
:type filename: string
:returns: the sanitised filename
:rtype: string
:raises IOError: when the filename exists
"""
# Remove any quotes
filename = filename.strip("'\"")
if os.path.basename(filename) != filename:
# Dodgy server, log it
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):
"""
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.
@ -97,6 +166,11 @@ def download_file(url, filename, callback=None, headers=None):
:type callback: function
:param headers: any optional headers to send
:type headers: dictionary
:param force_filename: force us to use the filename specified rather than
one the server may suggest
:type force_filename: boolean
:param allow_compression: allows gzip & deflate decoding
:type allow_compression: boolean
:returns: the filename of the downloaded file
:rtype: Deferred
@ -111,8 +185,13 @@ def download_file(url, filename, callback=None, headers=None):
for key, value in headers.items():
headers[str(key)] = str(value)
if allow_compression:
if not headers:
headers = {}
headers["accept-encoding"] = "deflate, gzip, x-gzip"
scheme, host, port, path = client._parse(url)
factory = HTTPDownloader(url, filename, callback, headers)
factory = HTTPDownloader(url, filename, callback, headers, force_filename, allow_compression)
if scheme == "https":
from twisted.internet import ssl
reactor.connectSSL(host, port, factory, ssl.ClientContextFactory())

View File

@ -1,139 +1,290 @@
deluge/plugins/label/label/data/label_pref.glade
deluge/plugins/label/label/data/label_options.glade
deluge/plugins/blocklist/blocklist/data/blocklist_pref.glade
deluge/plugins/stats/stats/data/config.glade
deluge/plugins/stats/stats/data/tabs.glade
deluge/ui/gtkui/glade/add_torrent_dialog.glade
deluge/ui/gtkui/glade/filtertree_menu.glade
deluge/ui/gtkui/glade/torrent_menu.glade
deluge/ui/gtkui/glade/remove_torrent_dialog.glade
deluge/ui/gtkui/glade/preferences_dialog.glade
deluge/ui/gtkui/glade/edit_trackers.glade
deluge/ui/gtkui/glade/queuedtorrents.glade
deluge/ui/gtkui/glade/move_storage_dialog.glade
deluge/ui/gtkui/glade/connection_manager.glade
deluge/ui/gtkui/glade/create_torrent_dialog.glade
deluge/ui/gtkui/glade/dgtkpopups.glade
deluge/ui/gtkui/glade/tray_menu.glade
deluge/ui/gtkui/glade/main_window.glade
deluge/bencode.py
docs/source/conf.py
deluge/core/autoadd.py
deluge/core/preferencesmanager.py
deluge/core/filtermanager.py
deluge/core/torrentmanager.py
deluge/core/daemon.py
deluge/core/torrent.py
deluge/core/pluginmanager.py
deluge/core/oldstateupgrader.py
deluge/core/__init__.py
deluge/core/core.py
deluge/core/alertmanager.py
deluge/core/rpcserver.py
deluge/config.py
deluge/countries.py
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/plugins/label/label/webui.py
deluge/plugins/label/label/test.py
deluge/plugins/label/label/gtkui/label_config.py
deluge/plugins/label/label/gtkui/sidebar_menu.py
deluge/plugins/label/label/gtkui/submenu.py
deluge/plugins/label/label/gtkui/__init__.py
deluge/plugins/label/label/__init__.py
deluge/plugins/label/label/core.py
deluge/plugins/label/setup.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/blocklist/setup.py
deluge/plugins/blocklist/blocklist/webui.py
deluge/plugins/blocklist/blocklist/gtkui.py
deluge/plugins/blocklist/blocklist/text.py
deluge/plugins/blocklist/blocklist/peerguardian.py
deluge/plugins/blocklist/blocklist/__init__.py
deluge/plugins/blocklist/blocklist/core.py
deluge/plugins/__init__.py
deluge/plugins/webuipluginbase.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/test.py
deluge/plugins/stats/stats/graph.py
deluge/plugins/stats/stats/test_total.py
deluge/plugins/stats/stats/__init__.py
deluge/plugins/stats/stats/core.py
deluge/configmanager.py
deluge/ui/tracker_icons.py
deluge/ui/client.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/coreconfig.py
deluge/ui/console/colors.py
deluge/ui/console/commands/resume.py
deluge/ui/console/commands/config.py
deluge/ui/console/commands/halt.py
deluge/ui/console/commands/debug.py
deluge/ui/console/commands/__init__.py
deluge/ui/console/commands/quit.py
deluge/ui/console/commands/connect.py
deluge/ui/console/commands/pause.py
deluge/ui/console/commands/add.py
deluge/ui/console/commands/rm.py
deluge/ui/console/commands/info.py
deluge/ui/console/commands/help.py
deluge/ui/console/main.py
deluge/ui/console/__init__.py
deluge/ui/gtkui/listview.py
deluge/ui/gtkui/options_tab.py
deluge/ui/gtkui/statusbar.py
deluge/ui/gtkui/status_tab.py
deluge/ui/gtkui/addtorrentdialog.py
deluge/ui/gtkui/sidebar.py
deluge/ui/gtkui/gtkui.py
deluge/ui/gtkui/aboutdialog.py
deluge/ui/gtkui/systemtray.py
deluge/ui/gtkui/files_tab.py
deluge/ui/gtkui/menubar.py
deluge/ui/gtkui/peers_tab.py
deluge/ui/gtkui/notification.py
deluge/ui/gtkui/toolbar.py
deluge/ui/gtkui/ipcinterface.py
deluge/ui/gtkui/filtertreeview.py
deluge/ui/gtkui/queuedtorrents.py
deluge/ui/gtkui/pluginmanager.py
deluge/ui/gtkui/mainwindow.py
deluge/ui/gtkui/removetorrentdialog.py
deluge/ui/gtkui/common.py
deluge/ui/gtkui/torrentdetails.py
deluge/ui/gtkui/__init__.py
deluge/ui/gtkui/edittrackersdialog.py
deluge/ui/gtkui/preferences.py
deluge/ui/gtkui/torrentview.py
deluge/ui/gtkui/new_release_dialog.py
deluge/ui/gtkui/connectionmanager.py
deluge/ui/gtkui/createtorrentdialog.py
deluge/ui/gtkui/details_tab.py
deluge/ui/common.py
deluge/ui/session.py
deluge/ui/tracker_icons.py
deluge/ui/__init__.py
deluge/ui/web/auth.py
deluge/ui/web/common.py
deluge/ui/web/gen_gettext.py
deluge/ui/web/__init__.py
deluge/ui/web/json_api.py
deluge/ui/web/pluginmanager.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/common.py
deluge/component.py
deluge/main.py
deluge/error.py
deluge/__init__.py
deluge/tests/test_signalreceiver.py
deluge/tests/test_filters.py
deluge/tests/test_plugin_metadata.py
deluge/tests/test_tracker_icons.py
deluge/tests/test_stats.py
deluge/tests/test_client.py
deluge/log.py
deluge/scripts/deluge_remote.py
deluge/scripts/wiki_docgen.py
deluge/scripts/create_plugin.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

View File

@ -135,11 +135,11 @@ def start_daemon():
help="Port daemon will listen on", action="store", type="int")
parser.add_option("-i", "--interface", dest="interface",
help="Interface daemon will listen for bittorrent connections on, \
this should be an IP address",
this should be an IP address", metavar="IFACE",
action="store", type="str")
parser.add_option("-u", "--ui-interface", dest="ui_interface",
help="Interface daemon will listen for UI connections on, this should be\
an IP address", action="store", type="str")
an IP address", metavar="IFACE", action="store", type="str")
parser.add_option("-d", "--do-not-daemonize", dest="donot",
help="Do not daemonize", action="store_true", default=False)
parser.add_option("-c", "--config", dest="config",
@ -197,6 +197,11 @@ this should be an IP address",
write_pidfile()
# Setup the logger
try:
# Try to make the logfile's directory if it doesn't exist
os.makedirs(os.path.abspath(os.path.dirname(options.logfile)))
except:
pass
deluge.log.setupLogger(level=options.loglevel, filename=options.logfile)
from deluge.log import LOG as log

View File

@ -100,7 +100,7 @@ def make_meta_file(path, url, piece_length, progress=dummy,
if created_by:
data['created by'] = created_by.encode("utf8")
if trackers:
if trackers and (len(trackers[0]) > 1 or len(trackers) > 1):
data['announce-list'] = trackers
data["encoding"] = "UTF-8"
@ -175,11 +175,12 @@ def makeinfo(path, piece_length, progress, name = None,
piece_count += 1
done = 0
sh = sha()
progress(piece_count, num_pieces)
progress(piece_count, num_pieces)
h.close()
if done > 0:
pieces.append(sh.digest())
progress(piece_count, num_pieces)
if name is not None:
assert isinstance(name, unicode)
name = to_utf8(name)

View File

@ -87,7 +87,7 @@ class PluginManagerBase:
def disable_plugins(self):
# Disable all plugins that are enabled
for key in self.plugins.keys():
self.plugins[key].disable()
self.disable_plugin(key)
def __getitem__(self, key):
return self.plugins[key]
@ -131,15 +131,16 @@ class PluginManagerBase:
egg.activate()
for name in egg.get_entry_map(self.entry_name):
entry_point = egg.get_entry_info(self.entry_name, name)
cls = entry_point.load()
try:
cls = entry_point.load()
instance = cls(plugin_name.replace("-", "_"))
except Exception, e:
log.error("Unable to instantiate plugin!")
log.exception(e)
continue
instance.enable()
if self.get_state() == component.COMPONENT_STATE.index("Started"):
component.start(instance.plugin.get_component_name())
if self._component_state == "Started":
component.start([instance.plugin._component_name])
plugin_name = plugin_name.replace("-", " ")
self.plugins[plugin_name] = instance
if plugin_name not in self.config["enabled_plugins"]:
@ -152,6 +153,7 @@ class PluginManagerBase:
"""Disables a plugin"""
try:
self.plugins[name].disable()
component.deregister(self.plugins[name].plugin._component_name)
del self.plugins[name]
self.config["enabled_plugins"].remove(name)
except KeyError:

View File

@ -1,8 +1,12 @@
#
# feeder/__init__.py
# __init__.py
#
# Copyright (C) 2009 GazpachoKing <chase.sterling@gmail.com>
#
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
#
# Copyright (C) 2009 Damien Churchill <damoxc@gmail.com>
#
# Deluge is free software.
#
@ -18,9 +22,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
@ -32,7 +36,6 @@
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.
#
#
from deluge.plugins.init import PluginInitBase

View File

@ -1,7 +1,12 @@
#
# common.py
#
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2009 GazpachoKing <chase.sterling@gmail.com>
#
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2009 Damien Churchill <damoxc@gmail.com>
#
# Deluge is free software.
#
@ -31,10 +36,7 @@
# 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 pkg_resources
import os.path
def get_resource(filename):
return pkg_resources.resource_filename("example", os.path.join("data", filename))
import pkg_resources, os
return pkg_resources.resource_filename("autoadd", os.path.join("data", filename))

View File

@ -0,0 +1,332 @@
#
# core.py
#
# Copyright (C) 2009 GazpachoKing <chase.sterling@gmail.com>
#
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2009 Damien Churchill <damoxc@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.
#
from deluge._libtorrent import lt
import os
from deluge.log import LOG as log
from deluge.plugins.pluginbase import CorePluginBase
import deluge.component as component
import deluge.configmanager
from deluge.core.rpcserver import export
from twisted.internet.task import LoopingCall, deferLater
from twisted.internet import reactor
from deluge.event import DelugeEvent
DEFAULT_PREFS = {
"watchdirs":{},
"next_id":1
}
OPTIONS_AVAILABLE = { #option: builtin
"enabled":False,
"path":False,
"append_extension":False,
"abspath":False,
"download_location":True,
"max_download_speed":True,
"max_upload_speed":True,
"max_connections":True,
"max_upload_slots":True,
"prioritize_first_last":True,
"auto_managed":True,
"stop_at_ratio":True,
"stop_ratio":True,
"remove_at_ratio":True,
"move_completed":True,
"move_completed_path":True,
"label":False,
"add_paused":True,
"queue_to_top":False
}
MAX_NUM_ATTEMPTS = 10
class AutoaddOptionsChangedEvent(DelugeEvent):
"""Emitted when the options for the plugin are changed."""
def __init__(self):
pass
def CheckInput(cond, message):
if not cond:
raise Exception(message)
class Core(CorePluginBase):
def enable(self):
#reduce typing, assigning some values to self...
self.config = deluge.configmanager.ConfigManager("autoadd.conf", DEFAULT_PREFS)
self.watchdirs = self.config["watchdirs"]
self.core_cfg = deluge.configmanager.ConfigManager("core.conf")
# Dict of Filename:Attempts
self.invalid_torrents = {}
# Loopingcall timers for each enabled watchdir
self.update_timers = {}
# If core autoadd folder is enabled, move it to the plugin
if self.core_cfg.config.get('autoadd_enable'):
# Disable core autoadd
self.core_cfg['autoadd_enable'] = False
self.core_cfg.save()
# Check if core autoadd folder is already added in plugin
for watchdir in self.watchdirs:
if os.path.abspath(self.core_cfg['autoadd_location']) == watchdir['abspath']:
watchdir['enabled'] = True
break
else:
# didn't find core watchdir, add it
self.add({'path':self.core_cfg['autoadd_location'], 'enabled':True})
deferLater(reactor, 5, self.enable_looping)
def enable_looping(self):
#Enable all looping calls for enabled watchdirs here
for watchdir_id, watchdir in self.watchdirs.iteritems():
if watchdir['enabled']:
self.enable_watchdir(watchdir_id)
def disable(self):
#disable all running looping calls
for loopingcall in self.update_timers.itervalues():
loopingcall.stop()
self.config.save()
def update(self):
pass
@export()
def set_options(self, watchdir_id, options):
"""Update the options for a watch folder."""
watchdir_id = str(watchdir_id)
options = self._make_unicode(options)
CheckInput(watchdir_id in self.watchdirs , _("Watch folder does not exist."))
if options.has_key('path'):
options['abspath'] = os.path.abspath(options['path'])
CheckInput(os.path.isdir(options['abspath']), _("Path does not exist."))
for w_id, w in self.watchdirs.iteritems():
if options['abspath'] == w['abspath'] and watchdir_id != w_id:
raise Exception("Path is already being watched.")
for key in options.keys():
if not key in OPTIONS_AVAILABLE:
if not key in [key2+'_toggle' for key2 in OPTIONS_AVAILABLE.iterkeys()]:
raise Exception("autoadd: Invalid options key:%s" % key)
#disable the watch loop if it was active
if watchdir_id in self.update_timers:
self.disable_watchdir(watchdir_id)
self.watchdirs[watchdir_id].update(options)
#re-enable watch loop if appropriate
if self.watchdirs[watchdir_id]['enabled']:
self.enable_watchdir(watchdir_id)
self.config.save()
component.get("EventManager").emit(AutoaddOptionsChangedEvent())
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 update_watchdir(self, watchdir_id):
"""Check the watch folder for new torrents to add."""
watchdir_id = str(watchdir_id)
watchdir = self.watchdirs[watchdir_id]
if not watchdir['enabled']:
# We shouldn't be updating because this watchdir is not enabled
self.disable_watchdir(watchdir_id)
return
if not os.path.isdir(watchdir["abspath"]):
log.warning("Invalid AutoAdd folder: %s", watchdir["abspath"])
self.disable_watchdir(watchdir_id)
return
# Generate options dict for watchdir
opts = {}
if 'stop_at_ratio_toggle' in watchdir:
watchdir['stop_ratio_toggle'] = watchdir['stop_at_ratio_toggle']
# We default to True wher reading _toggle values, so a config
# without them is valid, and applies all its settings.
for option, value in watchdir.iteritems():
if OPTIONS_AVAILABLE.get(option):
if watchdir.get(option+'_toggle', True):
opts[option] = value
for filename in os.listdir(watchdir["abspath"]):
if filename.split(".")[-1] == "torrent":
try:
filepath = os.path.join(watchdir["abspath"], 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.invalid_torrents[filename] += 1
if self.invalid_torrents[filename] >= MAX_NUM_ATTEMPTS:
os.rename(filepath, filepath + ".invalid")
del self.invalid_torrents[filename]
else:
self.invalid_torrents[filename] = 1
continue
# The torrent looks good, so lets add it to the session.
torrent_id = component.get("TorrentManager").add(filedump=filedump, filename=filename, options=opts)
# If the torrent added successfully, set the extra options.
if torrent_id:
if 'Label' in component.get("CorePluginManager").get_enabled_plugins():
if watchdir.get('label_toggle', True) and watchdir.get('label'):
label = component.get("CorePlugin.Label")
if not watchdir['label'] in label.get_labels():
label.add(watchdir['label'])
label.set_torrent(torrent_id, watchdir['label'])
if watchdir.get('queue_to_top_toggle', True) and 'queue_to_top' in watchdir:
if watchdir['queue_to_top']:
component.get("TorrentManager").queue_top(torrent_id)
else:
component.get("TorrentManager").queue_bottom(torrent_id)
# Rename or delete the torrent once added to deluge.
if watchdir.get('append_extension_toggle'):
if not watchdir.get('append_extension'):
watchdir['append_extension'] = ".added"
os.rename(filepath, filepath + watchdir['append_extension'])
else:
os.remove(filepath)
def on_update_watchdir_error(self, failure, watchdir_id):
"""Disables any watch folders with unhandled exceptions."""
self.disable_watchdir(watchdir_id)
log.error("Disabling '%s', error during update: %s" % (self.watchdirs[watchdir_id]["path"], failure))
@export
def enable_watchdir(self, watchdir_id):
watchdir_id = str(watchdir_id)
# Enable the looping call
if watchdir_id not in self.update_timers or not self.update_timers[watchdir_id].running:
self.update_timers[watchdir_id] = LoopingCall(self.update_watchdir, watchdir_id)
self.update_timers[watchdir_id].start(5).addErrback(self.on_update_watchdir_error, watchdir_id)
# Update the config
if not self.watchdirs[watchdir_id]['enabled']:
self.watchdirs[watchdir_id]['enabled'] = True
self.config.save()
component.get("EventManager").emit(AutoaddOptionsChangedEvent())
@export
def disable_watchdir(self, watchdir_id):
watchdir_id = str(watchdir_id)
# Disable the looping call
if watchdir_id in self.update_timers:
if self.update_timers[watchdir_id].running:
self.update_timers[watchdir_id].stop()
del self.update_timers[watchdir_id]
# Update the config
if self.watchdirs[watchdir_id]['enabled']:
self.watchdirs[watchdir_id]['enabled'] = False
self.config.save()
component.get("EventManager").emit(AutoaddOptionsChangedEvent())
@export
def set_config(self, config):
"""Sets the config dictionary."""
config = self._make_unicode(config)
for key in config.keys():
self.config[key] = config[key]
self.config.save()
component.get("EventManager").emit(AutoaddOptionsChangedEvent())
@export
def get_config(self):
"""Returns the config dictionary."""
return self.config.config
@export()
def get_watchdirs(self):
return self.watchdirs.keys()
def _make_unicode(self, options):
opts = {}
for key in options:
if isinstance(options[key], str):
options[key] = unicode(options[key], "utf8")
opts[key] = options[key]
return opts
@export()
def add(self, options={}):
"""Add a watch folder."""
options = self._make_unicode(options)
abswatchdir = os.path.abspath(options['path'])
CheckInput(os.path.isdir(abswatchdir) , _("Path does not exist."))
CheckInput(os.access(abswatchdir, os.R_OK|os.W_OK), "You must have read and write access to watch folder.")
if abswatchdir in [wd['abspath'] for wd in self.watchdirs.itervalues()]:
raise Exception("Path is already being watched.")
options.setdefault('enabled', False)
options['abspath'] = abswatchdir
watchdir_id = self.config['next_id']
self.watchdirs[str(watchdir_id)] = options
if options.get('enabled'):
self.enable_watchdir(watchdir_id)
self.config['next_id'] = watchdir_id + 1
self.config.save()
component.get("EventManager").emit(AutoaddOptionsChangedEvent())
return watchdir_id
@export
def remove(self, watchdir_id):
"""Remove a watch folder."""
watchdir_id = str(watchdir_id)
CheckInput(watchdir_id in self.watchdirs, "Unknown Watchdir: %s" % self.watchdirs)
if self.watchdirs[watchdir_id]['enabled']:
self.disable_watchdir(watchdir_id)
del self.watchdirs[watchdir_id]
self.config.save()
component.get("EventManager").emit(AutoaddOptionsChangedEvent())

View File

@ -1,9 +1,9 @@
/*
Script: example.js
The client-side javascript code for the Example plugin.
Script: autoadd.js
The client-side javascript code for the AutoAdd plugin.
Copyright:
(C) Damien Churchill 2009 <damoxc@gmail.com>
(C) GazpachoKing 2009 <damoxc@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
@ -31,21 +31,20 @@ Copyright:
statement from all source files in the program, then also delete it here.
*/
ExamplePlugin = Ext.extend(Deluge.Plugin, {
AutoAddPlugin = Ext.extend(Deluge.Plugin, {
constructor: function(config) {
config = Ext.apply({
name: "Example"
name: "AutoAdd"
}, config);
ExamplePlugin.superclass.constructor.call(this, config);
AutoAddPlugin.superclass.constructor.call(this, config);
},
onDisable: function() {
Deluge.Preferences.removePage(this.prefsPage);
},
onEnable: function() {
this.prefsPage = new ExamplePreferencesPanel();
this.prefsPage = Deluge.Preferences.addPage(this.prefsPage);
}
});
new ExamplePlugin();
new AutoAddPlugin();

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,116 @@
<?xml version="1.0"?>
<glade-interface>
<!-- interface-requires gtk+ 2.16 -->
<!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkWindow" id="prefs_window">
<child>
<widget class="GtkHBox" id="hbox9">
<property name="visible">True</property>
<child>
<placeholder/>
</child>
<child>
<widget class="GtkAlignment" id="prefs_box_1">
<property name="visible">True</property>
<child>
<widget class="GtkVBox" id="prefs_box">
<property name="width_request">340</property>
<property name="height_request">390</property>
<property name="visible">True</property>
<property name="border_width">3</property>
<property name="orientation">vertical</property>
<signal name="parent_set" handler="on_parent_set"/>
<child>
<widget class="GtkFrame" id="frame1">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<widget class="GtkVBox" id="watchdirs_vbox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="homogeneous">True</property>
<child>
<placeholder/>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Watch Folders:&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkHButtonBox" id="hbuttonbox1">
<property name="visible">True</property>
<child>
<widget class="GtkButton" id="add_button">
<property name="label" translatable="no">gtk-add</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="on_add_button_clicked"/>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="remove_button">
<property name="label" translatable="no">gtk-remove</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="on_remove_button_clicked"/>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="edit_button">
<property name="label" translatable="yes">gtk-edit</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="on_edit_button_clicked"/>
</widget>
<packing>
<property name="position">2</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>

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