Compare commits
203 Commits
develop
...
deluge-1.0
Author | SHA1 | Date | |
---|---|---|---|
d1e6935555 | |||
b72ae5d5cc | |||
a2add60684 | |||
bacb57a795 | |||
45eecc5c25 | |||
8a092a2f79 | |||
12a6be4e20 | |||
bf7b9ec09f | |||
10181dc7ee | |||
30cb3673f1 | |||
5ce2bbcbcc | |||
feaee5f344 | |||
97fb9f8aee | |||
dd86ac9bcc | |||
1fbf983ff6 | |||
e4c72c7dce | |||
0c9a3751e4 | |||
0e9c61d4be | |||
b5fdadc2aa | |||
7d10b60811 | |||
87e77565fc | |||
ce191efc54 | |||
3360c9c754 | |||
63c314843e | |||
be2b266ba8 | |||
1458db6b03 | |||
16ba61dbf5 | |||
46352b6f13 | |||
82d15c856a | |||
5315620ca2 | |||
40d6716e74 | |||
efec531c75 | |||
cc7e6d1ff2 | |||
e2b9d5d936 | |||
5f8fef7996 | |||
03a37062d4 | |||
0534b24609 | |||
130d7c08a0 | |||
ea6a6ec9bc | |||
d0da82de21 | |||
8cc74af9c3 | |||
f75c0cf096 | |||
244ba86b8a | |||
054cc120de | |||
fbdb1479ad | |||
ec8c45e940 | |||
1b29b6bfc9 | |||
158bfbcb6e | |||
a37d739b0b | |||
353795f02a | |||
798b27cf34 | |||
acd64e6381 | |||
70c588dba6 | |||
8d10642ec7 | |||
76eac8b51c | |||
a168265753 | |||
eafb404b7b | |||
fa42b06e34 | |||
56b806ce78 | |||
c2427ccb7d | |||
090de9bfa8 | |||
cd2084b421 | |||
4b5dc6bc28 | |||
9486b24907 | |||
7ee5547066 | |||
c432b82e69 | |||
26d58d4057 | |||
1cf863a022 | |||
8660209d28 | |||
bbd862e086 | |||
f7f00de52c | |||
baaafefb89 | |||
262279b27f | |||
3c33018079 | |||
fb23f229fb | |||
2e3a9ce28c | |||
a0f90acfc8 | |||
34d34b785c | |||
90053270d5 | |||
a1df9626e5 | |||
84e58626a9 | |||
761586b2a8 | |||
57f1409a55 | |||
14bfebdb98 | |||
95e40aa64b | |||
b246457b91 | |||
0c39331295 | |||
66c986c305 | |||
ccfead4e6c | |||
88e5c07564 | |||
40633277d8 | |||
d60c595599 | |||
fc6edca315 | |||
bd8dcbce91 | |||
7adf503bb6 | |||
67c0069c7a | |||
4094601f6e | |||
3178582312 | |||
2f6d98693d | |||
1e4f53b716 | |||
4731d4814f | |||
584226db96 | |||
135a0ca7e9 | |||
892e642502 | |||
6f7e814e76 | |||
39e8fd772b | |||
2a5e346313 | |||
4fb8fe54c9 | |||
acf59dd287 | |||
f2d80343c7 | |||
f15971bdeb | |||
6afe33d584 | |||
53853f043e | |||
bc0612d951 | |||
edb60072f5 | |||
b1dbca37c3 | |||
7bde1e549a | |||
9e04988422 | |||
cccd1b8436 | |||
5f20e2139d | |||
ab9842e4c1 | |||
240c60aa74 | |||
d8bdaff0cc | |||
4a4ffdab63 | |||
d83a748401 | |||
dac94c5038 | |||
ed5e080b6d | |||
cbab9cd823 | |||
971308416b | |||
8564f45e59 | |||
6948c81d01 | |||
7665f5394a | |||
7b31434287 | |||
bba9c1a54f | |||
73b3ff8a0f | |||
67b85a9f89 | |||
165b97751d | |||
26fc7cf13f | |||
c0cced9747 | |||
cd391ca749 | |||
8ecc336152 | |||
9280a9609e | |||
a118d3e7d5 | |||
61b9e4ae0e | |||
1a9376b7ea | |||
2edaeae60e | |||
01ed7d6012 | |||
3152dd1a9a | |||
560604ade9 | |||
766a055d65 | |||
073f8ff544 | |||
43982adc3a | |||
922e34f025 | |||
bf69584b99 | |||
470deeb8ed | |||
d880015eae | |||
f6b6a44d4c | |||
4332627a33 | |||
6182d5f14b | |||
40ab319f64 | |||
a2e0eae18a | |||
f5b398aaea | |||
9402ab1781 | |||
e10a02b4e2 | |||
26eb9e9658 | |||
4d1ff54c03 | |||
c861110047 | |||
1170675310 | |||
7e56c5568c | |||
8eb7eb7dae | |||
f23520664a | |||
ce638455fd | |||
21050caaa6 | |||
325746bfa0 | |||
f853ac209b | |||
da309c66c3 | |||
897ef1135d | |||
ab89338dac | |||
537c596e21 | |||
d03d1f1483 | |||
af25aee9e2 | |||
ad6f16f69d | |||
78eabc66a8 | |||
feb54cd785 | |||
c873360ca6 | |||
10ad76b2f4 | |||
63ede39505 | |||
f26f9c6331 | |||
2102c0b910 | |||
d71b4a132e | |||
e3a55b8923 | |||
a5178a875c | |||
9d416efbd2 | |||
e481be0ccd | |||
4abb436e34 | |||
753f624805 | |||
063564655e | |||
54a3e04e26 | |||
bbee37f54f | |||
ca7ad6daf3 | |||
f4ccc4bd79 | |||
fc717fbc0e | |||
0e6f48d1de |
173
ChangeLog
173
ChangeLog
@ -1,10 +1,173 @@
|
||||
Deluge 0.9.03 - "1.0.0_RC3" (In-Development)
|
||||
Deluge 1.0.4 (31 October 2008)
|
||||
Core:
|
||||
* Fix #560 force an int value for global max connections
|
||||
* Fix #545 use proper values in ratio calculation
|
||||
* Fix UPnP again..
|
||||
|
||||
GtkUI:
|
||||
* Fix #565 wait for the deluged process to start to prevent defunct processes
|
||||
|
||||
OS X:
|
||||
* Fix issues with gettext
|
||||
|
||||
Windows:
|
||||
* Fix starting on non-English versions of Windows
|
||||
|
||||
Deluge 1.0.3 (18 October 2008)
|
||||
Core:
|
||||
* Fix upnp - it should work on more routers now too
|
||||
* Fix issue where Deluge would send improper stats to the tracker after a
|
||||
pause/resume.
|
||||
* Fix issue where fastresume files would be rejected when using FAT32. This
|
||||
would cause the torrent to be rechecked on every startup.
|
||||
* Fix ip filtering
|
||||
|
||||
GtkUI:
|
||||
* Re-add the "Max Connections Per Second" option with a default setting of 20
|
||||
|
||||
WebUI:
|
||||
* Fix White template for Opera
|
||||
|
||||
Misc:
|
||||
* Deluge will now use a system libtorrent library if available.
|
||||
* The build system will no longer build libtorrent if a system library is
|
||||
detected.
|
||||
|
||||
Deluge 1.0.2 (10 October 2008)
|
||||
Core:
|
||||
* Fix issue where torrents will not be properly added to the session
|
||||
|
||||
Deluge 1.0.1 (10 October 2008)
|
||||
Core:
|
||||
* Change the default max global upload slots to 4 instead of -1 since libtorrent
|
||||
will automatically open more slots to meet the upload speed limit.
|
||||
* Fix display of tracker error messages
|
||||
* Fix add_torrent_url() to download the torrent file in a thread to prevent
|
||||
the main thread from blocking and causing the daemon to freeze.
|
||||
* Removed the 'Maximum Connections Per Second' setting and replaced it with a
|
||||
default setting of 20. This should alleviate speed issues some are experiencing.
|
||||
* Changed max half-open connections default limit to 8 on XP/2000 and 4 on Vista
|
||||
* Prevent being able to set file priorities for compactly allocated torrents as
|
||||
it is not intended to work.
|
||||
* Fix freezing on start-up issues on systems that do not have a properly
|
||||
configured localhost entry.
|
||||
* Change max connections default setting to 200
|
||||
* Fix issue with invalid bencoding from some trackers
|
||||
* Plenty of libtorrent updates that should improve core stability
|
||||
|
||||
GtkUI:
|
||||
* Improve performance of files tab by only updating when values change
|
||||
|
||||
Misc:
|
||||
* Fix #187 set a 5 second timer to save the config file after a config value
|
||||
has been changed.
|
||||
* Fix #503 change the boost lib detection logic to first look for -mt and
|
||||
if not available, fall back to regular boost lib (non-multithreaded)
|
||||
|
||||
WebUI:
|
||||
* Add enable "Auto Add" checkbox
|
||||
|
||||
Deluge 1.0.0 - "Sharks Are Bulletproof" (21 September 2008)
|
||||
Core:
|
||||
* Include GeoIP database for country look-ups
|
||||
* Fix upgrading from 0.5.x state where torrents would have no trackers
|
||||
|
||||
Deluge 0.9.09 - "1.0.0_RC9" (15 September 2008)
|
||||
Core:
|
||||
* Bug fixes in libtorrent including a crash when the tracker doesn't
|
||||
have 'announce' in it's url.
|
||||
* Fix fastresume issue causing loss of data by deleting the fastresume file
|
||||
before writing a new one
|
||||
* Fix #475 the use of unicode paths when adding torrents
|
||||
|
||||
GtkUI:
|
||||
* Fix add torrent dialog closing preventing another dialog from being shown
|
||||
* Fix various issues when not using English
|
||||
* Fix setting file priorities on folders
|
||||
|
||||
Deluge 0.9.08 - "1.0.0_RC8" (27 August 2008)
|
||||
Core:
|
||||
* Attempt to automatically upgrade a 0.5.x state file to new format
|
||||
* Tracker errors now change the tracker status
|
||||
|
||||
Plugins:
|
||||
* Fix bug in Blocklist that prevented downloading a new file every X days
|
||||
|
||||
GtkUI:
|
||||
* Sort filenames alphabetically in add torrent dialog
|
||||
* Fix setting file priorities on folders
|
||||
* Fix #453 allow showing of text in the toolbar buttons
|
||||
|
||||
Deluge 0.9.07 - "1.0.0_RC7" (18 August 2008)
|
||||
Core:
|
||||
* Fix loading torrents from state when fastresume file is missing
|
||||
* Fix UPnP
|
||||
* Fix to prevent Deluge from segfaulting when trying to autoadd an incomplete torrent file
|
||||
* Fix #407 possible negative ETA
|
||||
|
||||
GtkUI:
|
||||
* Add 'edit' to edit trackers dialog
|
||||
* Improve performance of initial torrent list load
|
||||
* Fix hiding the bottom pane when disabling all the tabs
|
||||
* Fix not showing new torrents if you don't use the All label first
|
||||
* Fix size units to be more accurate
|
||||
* Fix torrentview sorting to be persistent
|
||||
* Fix not displaying file list when state changes
|
||||
* Expand root folder in files tab by default
|
||||
|
||||
Null:
|
||||
* Fix #415 crash when using 'config-set' with no parameters
|
||||
|
||||
Windows:
|
||||
* Fix Vista slowness issue
|
||||
* Fix properly shutting Deluge down when system shuts down
|
||||
* Fix opening folders/files
|
||||
|
||||
Deluge 0.9.06 - "1.0.0_RC6" (13 August 2008)
|
||||
Core:
|
||||
* Fix CPU spikes
|
||||
|
||||
GtkUI:
|
||||
* Fix move storage dialog when connected to a remote daemon
|
||||
|
||||
Deluge 0.9.05 - "1.0.0_RC5" (04 August 2008)
|
||||
Core:
|
||||
* Fix deluged running with ssh X forwarding by removing the Gnome lib import
|
||||
* Save resume data periodically to help prevent data loss
|
||||
* Fix queue order shuffling on restart
|
||||
|
||||
GtkUI:
|
||||
* Handle shutting down more cleanly
|
||||
* Add translators to credits
|
||||
|
||||
Plugins:
|
||||
* Improve the Blocklist plugin preferences page.
|
||||
|
||||
Windows:
|
||||
* Fix drag n' drop support
|
||||
|
||||
Deluge 0.9.04 - "1.0.0_RC4" (29 July 2008)
|
||||
Core:
|
||||
* Fix building with gcc 4.3
|
||||
* Fix do not create torrentfiles folder unless 'copy_torrent_file' is True
|
||||
|
||||
GtkUI:
|
||||
* Add drag n' drop support for adding .torrent files
|
||||
* Double-clicking on host in ConnectionManager now will connect to that host
|
||||
* Fix selecting torrents when right-clicking on them in torrentview and filestab
|
||||
* Fix new release check
|
||||
* Display 'total_wanted' instead of 'total_size' in Size column
|
||||
* Fix displaying of torrents when language is not English
|
||||
* Fix the view options to be persistent between sessions
|
||||
* Fix signalreceiver when switching between daemons
|
||||
|
||||
Deluge 0.9.03 - "1.0.0_RC3" (21 July 2008)
|
||||
Core:
|
||||
* File progress fixes from libtorrent
|
||||
* Fix building on FreeBSD
|
||||
* Fix #350 stop seeds when stop ratio is reached
|
||||
* Fix #358 properly emit torrent_removed signal when remove_at_ratio happens
|
||||
|
||||
|
||||
UI:
|
||||
* Default to gtkui when running 'deluge' instead of defaulting to last used.
|
||||
|
||||
@ -14,13 +177,13 @@ Deluge 0.9.03 - "1.0.0_RC3" (In-Development)
|
||||
|
||||
Windows:
|
||||
* Fix torrent file association and adding files from command line
|
||||
|
||||
|
||||
Plugins:
|
||||
* Blocklist plugin has been rewritten
|
||||
|
||||
|
||||
Misc:
|
||||
* Some changes for python 2.6 compatibility
|
||||
|
||||
|
||||
Deluge 0.9.02 - "1.0.0_RC2" (15 July 2008)
|
||||
Core:
|
||||
* Fix displaying of file progress
|
||||
|
621
LICENSE
Normal file
621
LICENSE
Normal file
@ -0,0 +1,621 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
83
README
Normal file
83
README
Normal file
@ -0,0 +1,83 @@
|
||||
==========================
|
||||
Deluge BitTorrent Client
|
||||
==========================
|
||||
|
||||
Authors:
|
||||
Andrew Resch
|
||||
Marcos Pinto
|
||||
Martijn Voncken
|
||||
Sadrul Habib Chowdhury
|
||||
|
||||
Homepage: http://deluge-torrent.org
|
||||
|
||||
==========================
|
||||
Contact/Support:
|
||||
==========================
|
||||
|
||||
We have two options available for support:
|
||||
|
||||
Our Forum, at http://forum.deluge-torrent.org
|
||||
or
|
||||
Our IRC Channel, at #deluge on Freenode
|
||||
|
||||
==========================
|
||||
Installation Instructions:
|
||||
==========================
|
||||
|
||||
First, make sure you have the proper build dependencies installed. On a normal
|
||||
Debian or Ubuntu system:
|
||||
|
||||
sudo apt-get install g++ make python-all-dev python-all python-dbus \
|
||||
python-gtk2 python-notify librsvg2-common python-xdg python-support \
|
||||
subversion libboost-dev libboost-python-dev libboost-iostreams-dev \
|
||||
libboost-thread-dev libboost-date-time-dev libboost-filesystem-dev \
|
||||
libboost-serialization-dev libssl-dev zlib1g-dev python-setuptools
|
||||
|
||||
The names of the packages may vary depending on your OS / distro.
|
||||
|
||||
Once you have the needed libraries installed, build and install by running:
|
||||
|
||||
$ python setup.py build
|
||||
$ sudo python setup.py install
|
||||
|
||||
|
||||
==========================
|
||||
FAQ
|
||||
==========================
|
||||
|
||||
How to start the various user-interfaces
|
||||
|
||||
Gtk:
|
||||
deluge --ui gtk
|
||||
Console:
|
||||
deluge --ui null
|
||||
Web:
|
||||
deluge --ui web
|
||||
Go to http://localhost:8112/ default-password = "deluge"
|
||||
|
||||
I started "deluge" but i don't see the gtk-ui
|
||||
|
||||
The deluge command remembers the last interface it started. Be explicit and type one of the full "deluge -u <interface>" commands listed above.
|
||||
|
||||
Why is deluge still listed in my system tray even after I close it ?
|
||||
|
||||
You closed the gtk user-interface but you did not close the daemon. Choose "Quit & Shutdown Daemon" to close both Daemon and gtk-ui.
|
||||
|
||||
How do I start the daemon ?
|
||||
|
||||
deluged
|
||||
|
||||
How do I start the daemon with logging to console ?
|
||||
|
||||
deluged -d
|
||||
|
||||
I can't connect to the daemon from another machine
|
||||
|
||||
* Configure the daemon to allow remote connections
|
||||
* Restart the daemon.
|
||||
|
||||
Note: do not do this on a public ip , use the webui for unsecure networks.
|
||||
|
||||
I upgraded from 0.5 and plugin x is missing
|
||||
|
||||
1.0 is a rewrite, all old 0.5 plugins have to be rewritten.
|
23
TODO
23
TODO
@ -1,23 +0,0 @@
|
||||
For 0.6 release:
|
||||
* Translations
|
||||
* Add progress bars for downloading and importing lists instead of hanging (blocklist)
|
||||
|
||||
After 0.6 release:
|
||||
* Address issue where torrents will redownload if the storage is moved outside
|
||||
of deluge.
|
||||
* Implement add by hash
|
||||
* Figure out easy way for user-made plugins to add i18n support.
|
||||
* Restart daemon function
|
||||
* Docstrings!
|
||||
* Add wizard
|
||||
* Advanced (pieces) progress bar
|
||||
* Add method for plugins to add labels
|
||||
* Add context menus for labels.. ie. setting options for all torrents in label
|
||||
* Implement caching in core
|
||||
* Use the batch torrent status info as a cache for other torrent status requests
|
||||
* Add number of torrents to labels
|
||||
* Proxy stuff
|
||||
* Webseed
|
||||
* Enable/disable webui from within gtkui
|
||||
* Notifications
|
||||
* create a clamav plugin to scan files
|
6
debian/changelog
vendored
6
debian/changelog
vendored
@ -1,5 +1,5 @@
|
||||
deluge-torrent (0.9.02-1) unstable; urgency=low
|
||||
deluge-torrent (1.0.4-1) unstable; urgency=low
|
||||
|
||||
* RC2 release
|
||||
* 1.0.4
|
||||
|
||||
-- Andrew Resch (andar) <andrewresch@gmail.com> Tue, 17 Jul 2008 16:31:14 -0800
|
||||
-- Andrew Resch (andar) <andrewresch@gmail.com> Fri, 31 Oct 2008 02:10:00 -0000
|
||||
|
120
debian/copyright
vendored
120
debian/copyright
vendored
@ -1,20 +1,19 @@
|
||||
This package was debianized by Adam Cécile (Le_Vert) <gandalf@le-vert.net> on
|
||||
Wed, 15 Nov 2006 22:03:13 +0100.
|
||||
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 Author: Zach Tibbitts <zach@collegegeek.org>
|
||||
Alon Zakai <kripkensteiner@gmail.com>
|
||||
Marcos Pinto
|
||||
|
||||
Copyright: (C) 2006, Zach Tibbitts <zach@collegegeek.org>
|
||||
(C) 2006, Alon Zakai <kripkensteiner@gmail.com>
|
||||
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 2 of the License, or
|
||||
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,
|
||||
@ -39,65 +38,62 @@ License:
|
||||
On Debian systems, the complete text of the GNU General
|
||||
Public License can be found in `/usr/share/common-licenses/GPL'.
|
||||
|
||||
libtorrent/* are (C) 2006, A. Zakai ('Kripken') <kripkensteiner@gmail.com>
|
||||
and distributed unders term of GNU General Public License.
|
||||
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:
|
||||
|
||||
This code is baded on libtorrent which is (C) 2003 Arvid Norberg and
|
||||
distributed under terms of the license below :
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
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.
|
||||
|
||||
* 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.
|
||||
|
||||
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 :
|
||||
|
||||
"libtorrent/include/libtorrent/asio*" are (C) 2003-2006 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.
|
||||
|
||||
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 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.
|
||||
|
||||
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.
|
||||
|
||||
"po/*" are (C) 2006 Rosetta Contributors and Canonical Ltd 2006 and distributed
|
||||
"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-2007, Adam Cécile (Le_Vert)
|
||||
<gandalf@le-vert.net> and is licensed under the GPL, see above.
|
||||
The Debian packaging is (C) 2006-2008, Marcos Pinto (markybob)
|
||||
<markybob@gmail.com> and is licensed under GPL3, see above.
|
||||
|
@ -7,7 +7,7 @@
|
||||
#
|
||||
# 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 2 of the License, or (at your option)
|
||||
# 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,
|
||||
@ -35,6 +35,7 @@
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import platform
|
||||
|
||||
import pkg_resources
|
||||
import xdg, xdg.BaseDirectory
|
||||
@ -42,22 +43,18 @@ import xdg, xdg.BaseDirectory
|
||||
LT_TORRENT_STATE = {
|
||||
"Queued": 0,
|
||||
"Checking": 1,
|
||||
"Connecting": 2,
|
||||
"Downloading Metadata": 3,
|
||||
"Downloading": 4,
|
||||
"Finished": 5,
|
||||
"Seeding": 6,
|
||||
"Allocating": 7,
|
||||
"Paused": 8,
|
||||
"Downloading Metadata": 2,
|
||||
"Downloading": 3,
|
||||
"Finished": 4,
|
||||
"Seeding": 5,
|
||||
"Allocating": 6,
|
||||
0: "Queued",
|
||||
1: "Checking",
|
||||
2: "Connecting",
|
||||
3: "Downloading Metadata",
|
||||
4: "Downloading",
|
||||
5: "Finished",
|
||||
6: "Seeding",
|
||||
7: "Allocating",
|
||||
8: "Paused"
|
||||
2: "Downloading Metadata",
|
||||
3: "Downloading",
|
||||
4: "Finished",
|
||||
5: "Seeding",
|
||||
6: "Allocating",
|
||||
}
|
||||
|
||||
TORRENT_STATE = [
|
||||
@ -121,11 +118,13 @@ def get_default_download_dir():
|
||||
def windows_check():
|
||||
"""Checks if the current platform is Windows. Returns True if it is Windows
|
||||
and False if not."""
|
||||
import platform
|
||||
if platform.system() in ('Windows', 'Microsoft'):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
return platform.system() in ('Windows', 'Microsoft')
|
||||
|
||||
def vista_check():
|
||||
return platform.release() == "Vista"
|
||||
|
||||
def osx_check():
|
||||
return platform.system() == "Darwin"
|
||||
|
||||
def get_pixmap(fname):
|
||||
"""Returns a pixmap file included with deluge"""
|
||||
@ -145,7 +144,7 @@ def get_logo(size):
|
||||
def open_file(path):
|
||||
"""Opens a file or folder."""
|
||||
if windows_check():
|
||||
os.startfile("'%s'" % path)
|
||||
os.startfile("%s" % path)
|
||||
else:
|
||||
subprocess.Popen(["xdg-open", "%s" % path])
|
||||
|
||||
@ -220,6 +219,7 @@ def build_menu_radio_list(value_list, callback, pref_value=None,
|
||||
|
||||
if show_notset:
|
||||
menuitem = gtk.RadioMenuItem(group, notset_label)
|
||||
menuitem.set_name(notset_label)
|
||||
if pref_value < notset_lessthan and pref_value != None:
|
||||
menuitem.set_active(True)
|
||||
if show_activated and pref_value == 1:
|
||||
@ -232,6 +232,7 @@ def build_menu_radio_list(value_list, callback, pref_value=None,
|
||||
menuitem = gtk.SeparatorMenuItem()
|
||||
menu.append(menuitem)
|
||||
menuitem = gtk.MenuItem(_("Other..."))
|
||||
menuitem.set_name(_("Other..."))
|
||||
menuitem.connect("activate", callback)
|
||||
menu.append(menuitem)
|
||||
|
||||
@ -266,13 +267,13 @@ def show_other_dialog(string, default=None):
|
||||
def fsize(fsize_b):
|
||||
"""Returns formatted string describing filesize
|
||||
fsize_b should be in bytes
|
||||
Returned value will be in either KB, MB, or GB
|
||||
"""
|
||||
Returned value will be in either KiB, MiB, or GiB
|
||||
"""
|
||||
fsize_kb = fsize_b / 1024.0
|
||||
if fsize_kb < 1000:
|
||||
if fsize_kb < 1024:
|
||||
return "%.1f KiB" % fsize_kb
|
||||
fsize_mb = fsize_kb / 1024.0
|
||||
if fsize_mb < 1000:
|
||||
if fsize_mb < 1024:
|
||||
return "%.1f MiB" % fsize_mb
|
||||
fsize_gb = fsize_mb / 1024.0
|
||||
return "%.1f GiB" % fsize_gb
|
||||
|
@ -7,7 +7,7 @@
|
||||
#
|
||||
# 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 2 of the License, or (at your option)
|
||||
# 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,
|
||||
|
@ -7,7 +7,7 @@
|
||||
#
|
||||
# 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 2 of the License, or (at your option)
|
||||
# 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,
|
||||
@ -65,6 +65,10 @@ class Config:
|
||||
# Save
|
||||
self.save()
|
||||
|
||||
# This will get set with a gobject.timeout_add whenever a config option
|
||||
# is set.
|
||||
self.save_timer = None
|
||||
|
||||
def __del__(self):
|
||||
self.save()
|
||||
|
||||
@ -99,6 +103,7 @@ class Config:
|
||||
pkl_file.close()
|
||||
if filedump == self.config:
|
||||
# The config has not changed so lets just return
|
||||
self.save_timer = None
|
||||
return
|
||||
except (EOFError, IOError):
|
||||
log.warning("IOError: Unable to open file: '%s'", filename)
|
||||
@ -110,6 +115,8 @@ class Config:
|
||||
except IOError:
|
||||
log.warning("IOError: Unable to save file '%s'", filename)
|
||||
|
||||
self.save_timer = None
|
||||
|
||||
def set(self, key, value):
|
||||
"""Set the 'key' with 'value'."""
|
||||
# Sets the "key" with "value" in the config dict
|
||||
@ -128,6 +135,11 @@ class Config:
|
||||
except:
|
||||
pass
|
||||
|
||||
# We set the save_timer for 5 seconds if not already set
|
||||
log.debug("save_timer: %s", self.save_timer)
|
||||
if not self.save_timer:
|
||||
self.save_timer = gobject.timeout_add(5000, self.save)
|
||||
|
||||
def get(self, key):
|
||||
"""Get the value of 'key'. If it is an invalid key then get() will
|
||||
return None."""
|
||||
|
@ -7,7 +7,7 @@
|
||||
#
|
||||
# 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 2 of the License, or (at your option)
|
||||
# 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,
|
||||
|
@ -7,7 +7,7 @@
|
||||
#
|
||||
# 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 2 of the License, or (at your option)
|
||||
# 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,
|
||||
@ -36,7 +36,10 @@
|
||||
import gobject
|
||||
|
||||
import deluge.component as component
|
||||
import deluge.libtorrent as lt
|
||||
try:
|
||||
import libtorrent as lt
|
||||
except ImportError:
|
||||
import deluge.libtorrent as lt
|
||||
from deluge.log import LOG as log
|
||||
|
||||
class AlertManager(component.Component):
|
||||
@ -92,9 +95,13 @@ class AlertManager(component.Component):
|
||||
while alert is not None:
|
||||
# Loop through all alerts in the queue
|
||||
# Do some magic to get the alert type as a string
|
||||
alert_type = str(type(alert)).split("'")[1].split(".")[2]
|
||||
alert_type = str(type(alert)).split("'")[1].split(".")[-1]
|
||||
# Display the alert message
|
||||
log.debug("%s: %s", alert_type, alert.message())
|
||||
try:
|
||||
log.debug("%s: %s", alert_type, alert.message())
|
||||
except RuntimeError:
|
||||
log.debug("%s", alert_type)
|
||||
|
||||
# Call any handlers for this alert type
|
||||
if alert_type in self.handlers.keys():
|
||||
for handler in self.handlers[alert_type]:
|
||||
|
@ -7,7 +7,7 @@
|
||||
#
|
||||
# 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 2 of the License, or (at your option)
|
||||
# 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,
|
||||
@ -33,7 +33,10 @@
|
||||
|
||||
import os
|
||||
|
||||
import deluge.libtorrent as lt
|
||||
try:
|
||||
import libtorrent as lt
|
||||
except ImportError:
|
||||
import deluge.libtorrent as lt
|
||||
import deluge.component as component
|
||||
from deluge.configmanager import ConfigManager
|
||||
from deluge.log import LOG as log
|
||||
@ -42,7 +45,7 @@ MAX_NUM_ATTEMPTS = 10
|
||||
|
||||
class AutoAdd(component.Component):
|
||||
def __init__(self):
|
||||
component.Component.__init__(self, "AutoAdd", depend=["TorrentManager"], interval=3000)
|
||||
component.Component.__init__(self, "AutoAdd", depend=["TorrentManager"], interval=5000)
|
||||
# Get the core config
|
||||
self.config = ConfigManager("core.conf")
|
||||
|
||||
@ -100,6 +103,8 @@ class AutoAdd(component.Component):
|
||||
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)
|
||||
|
@ -2,19 +2,19 @@
|
||||
# core.py
|
||||
#
|
||||
# Copyright (C) 2007, 2008 Andrew Resch ('andar') <andrewresch@gmail.com>
|
||||
#
|
||||
#
|
||||
# Deluge is free software.
|
||||
#
|
||||
#
|
||||
# You may redistribute it and/or modify it under the terms of the
|
||||
# GNU General Public License, as published by the Free Software
|
||||
# Foundation; either version 2 of the License, or (at your option)
|
||||
# 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.,
|
||||
@ -46,7 +46,11 @@ import gobject
|
||||
import threading
|
||||
import socket
|
||||
|
||||
import deluge.libtorrent as lt
|
||||
try:
|
||||
import libtorrent as lt
|
||||
except ImportError:
|
||||
import deluge.libtorrent as lt
|
||||
|
||||
import deluge.configmanager
|
||||
import deluge.common
|
||||
import deluge.component as component
|
||||
@ -56,7 +60,7 @@ from deluge.core.alertmanager import AlertManager
|
||||
from deluge.core.signalmanager import SignalManager
|
||||
from deluge.core.autoadd import AutoAdd
|
||||
from deluge.log import LOG as log
|
||||
|
||||
|
||||
DEFAULT_PREFS = {
|
||||
"config_location": deluge.configmanager.get_config_dir(),
|
||||
"send_info": False,
|
||||
@ -67,7 +71,7 @@ DEFAULT_PREFS = {
|
||||
"download_location": deluge.common.get_default_download_dir(),
|
||||
"listen_ports": [6881, 6891],
|
||||
"copy_torrent_file": False,
|
||||
"torrentfiles_location": os.path.join(deluge.common.get_default_download_dir(), "torrentfiles"),
|
||||
"torrentfiles_location": deluge.common.get_default_download_dir(),
|
||||
"plugins_location": os.path.join(deluge.configmanager.get_config_dir(), "plugins"),
|
||||
"state_location": os.path.join(deluge.configmanager.get_config_dir(), "state"),
|
||||
"prioritize_first_last_pieces": False,
|
||||
@ -81,12 +85,13 @@ DEFAULT_PREFS = {
|
||||
"enc_out_policy": 1,
|
||||
"enc_level": 2,
|
||||
"enc_prefer_rc4": True,
|
||||
"max_connections_global": -1,
|
||||
"max_connections_global": 200,
|
||||
"max_upload_speed": -1.0,
|
||||
"max_download_speed": -1.0,
|
||||
"max_upload_slots_global": -1,
|
||||
"max_half_open_connections": -1,
|
||||
"max_connections_per_second": -1,
|
||||
"max_upload_slots_global": 4,
|
||||
"max_half_open_connections": (lambda: deluge.common.windows_check() and
|
||||
(lambda: deluge.common.vista_check() and 4 or 8)() or -1)(),
|
||||
"max_connections_per_second": 20,
|
||||
"ignore_limits_on_local_network": True,
|
||||
"max_connections_per_torrent": -1,
|
||||
"max_upload_slots_per_torrent": -1,
|
||||
@ -112,27 +117,27 @@ DEFAULT_PREFS = {
|
||||
"move_completed_path": deluge.common.get_default_download_dir(),
|
||||
"new_release_check": True,
|
||||
}
|
||||
|
||||
|
||||
class Core(
|
||||
ThreadingMixIn,
|
||||
ThreadingMixIn,
|
||||
SimpleXMLRPCServer.SimpleXMLRPCServer,
|
||||
component.Component):
|
||||
def __init__(self, port):
|
||||
log.debug("Core init..")
|
||||
component.Component.__init__(self, "Core")
|
||||
self.client_address = None
|
||||
|
||||
|
||||
# Get config
|
||||
self.config = deluge.configmanager.ConfigManager("core.conf", DEFAULT_PREFS)
|
||||
|
||||
if port == None:
|
||||
port = self.config["daemon_port"]
|
||||
|
||||
|
||||
if self.config["allow_remote"]:
|
||||
hostname = ""
|
||||
else:
|
||||
hostname = "localhost"
|
||||
|
||||
hostname = "127.0.0.1"
|
||||
|
||||
# Setup the xmlrpc server
|
||||
try:
|
||||
log.info("Starting XMLRPC server on port %s", port)
|
||||
@ -143,20 +148,20 @@ class Core(
|
||||
sys.exit(0)
|
||||
|
||||
self.register_multicall_functions()
|
||||
|
||||
|
||||
# Register all export_* functions
|
||||
for func in dir(self):
|
||||
if func.startswith("export_"):
|
||||
self.register_function(getattr(self, "%s" % func), func[7:])
|
||||
|
||||
self.register_introspection_functions()
|
||||
|
||||
|
||||
# Initialize gettext
|
||||
if deluge.common.windows_check():
|
||||
if deluge.common.windows_check() or deluge.common.osx_check():
|
||||
locale.setlocale(locale.LC_ALL, '')
|
||||
else:
|
||||
locale.setlocale(locale.LC_MESSAGES, '')
|
||||
locale.bindtextdomain("deluge",
|
||||
locale.bindtextdomain("deluge",
|
||||
pkg_resources.resource_filename(
|
||||
"deluge", "i18n"))
|
||||
locale.textdomain("deluge")
|
||||
@ -169,23 +174,18 @@ class Core(
|
||||
pkg_resources.resource_filename(
|
||||
"deluge", "i18n"))
|
||||
# Setup signals
|
||||
try:
|
||||
import gnome.ui
|
||||
self.gnome_client = gnome.ui.Client()
|
||||
self.gnome_client.connect("die", self._shutdown)
|
||||
except:
|
||||
pass
|
||||
|
||||
signal.signal(signal.SIGINT, self._shutdown)
|
||||
signal.signal(signal.SIGTERM, self._shutdown)
|
||||
if not deluge.common.windows_check():
|
||||
if not deluge.common.windows_check():
|
||||
signal.signal(signal.SIGHUP, self._shutdown)
|
||||
else:
|
||||
from win32api import SetConsoleCtrlHandler
|
||||
from win32con import CTRL_CLOSE_EVENT
|
||||
from win32con import CTRL_SHUTDOWN_EVENT
|
||||
result = 0
|
||||
def win_handler(ctrl_type):
|
||||
if ctrl_type == CTRL_CLOSE_EVENT:
|
||||
log.debug("ctrl_type: %s", ctrl_type)
|
||||
if ctrl_type == CTRL_CLOSE_EVENT or ctrl_type == CTRL_SHUTDOWN_EVENT:
|
||||
self._shutdown()
|
||||
result = 1
|
||||
return result
|
||||
@ -198,7 +198,7 @@ class Core(
|
||||
request, client_address = self.socket.accept()
|
||||
self.client_address = client_address[0]
|
||||
return (request, client_address)
|
||||
|
||||
|
||||
def run(self):
|
||||
"""Starts the core"""
|
||||
|
||||
@ -209,19 +209,30 @@ class Core(
|
||||
while len(version) < 4:
|
||||
version.append(0)
|
||||
fingerprint = lt.fingerprint("DE", *version)
|
||||
|
||||
|
||||
# Start the libtorrent session
|
||||
log.debug("Starting libtorrent session..")
|
||||
self.session = lt.session(fingerprint)
|
||||
|
||||
self.session = lt.session(fingerprint, flags=0)
|
||||
|
||||
# Set the user agent
|
||||
self.settings = lt.session_settings()
|
||||
self.settings.user_agent = "Deluge %s" % deluge.common.get_version()
|
||||
|
||||
# Set lazy bitfield
|
||||
|
||||
# Load the GeoIP DB for country look-ups
|
||||
self.session.load_country_db(
|
||||
pkg_resources.resource_filename("deluge", os.path.join("data", "GeoIP.dat")))
|
||||
|
||||
# Set session settings
|
||||
self.settings.lazy_bitfields = 1
|
||||
self.settings.send_redundant_have = True
|
||||
self.session.set_settings(self.settings)
|
||||
|
||||
|
||||
# Create an ip filter
|
||||
self.ip_filter = lt.ip_filter()
|
||||
# This keeps track of the timer to set the ip filter.. We do this a few
|
||||
# seconds aftering adding a rule so that 'batch' adding of rules isn't slow.
|
||||
self._set_ip_filter_timer = None
|
||||
|
||||
# Load metadata extension
|
||||
self.session.add_extension(lt.create_metadata_plugin)
|
||||
|
||||
@ -230,7 +241,7 @@ class Core(
|
||||
self._on_set_torrentfiles_location)
|
||||
self.config.register_set_function("state_location",
|
||||
self._on_set_state_location)
|
||||
self.config.register_set_function("listen_ports",
|
||||
self.config.register_set_function("listen_ports",
|
||||
self._on_set_listen_ports)
|
||||
self.config.register_set_function("random_port",
|
||||
self._on_set_random_port)
|
||||
@ -285,23 +296,23 @@ class Core(
|
||||
self.config.register_change_callback(self._on_config_value_change)
|
||||
# Start the AlertManager
|
||||
self.alerts = AlertManager(self.session)
|
||||
|
||||
|
||||
# Start the SignalManager
|
||||
self.signals = SignalManager()
|
||||
self.signals = SignalManager()
|
||||
|
||||
# Load plugins
|
||||
self.plugins = PluginManager(self)
|
||||
|
||||
# Start the TorrentManager
|
||||
self.torrents = TorrentManager(self.session, self.alerts)
|
||||
|
||||
|
||||
# Create the AutoAdd component
|
||||
self.autoadd = AutoAdd()
|
||||
self.autoadd = AutoAdd()
|
||||
|
||||
component.start()
|
||||
|
||||
|
||||
self._should_shutdown = False
|
||||
|
||||
|
||||
self.listen_thread = threading.Thread(target=self.handle_thread)
|
||||
self.listen_thread.setDaemon(False)
|
||||
self.listen_thread.start()
|
||||
@ -318,10 +329,10 @@ class Core(
|
||||
while not self._should_shutdown:
|
||||
self.handle_request()
|
||||
self._should_shutdown = False
|
||||
|
||||
|
||||
except Exception, e:
|
||||
log.debug("handle_thread: %s", e)
|
||||
|
||||
|
||||
def _shutdown(self, *data):
|
||||
"""This is called by a thread from shutdown()"""
|
||||
log.info("Shutting down core..")
|
||||
@ -353,7 +364,7 @@ class Core(
|
||||
def export_ping(self):
|
||||
"""A method to see if the core is running"""
|
||||
return True
|
||||
|
||||
|
||||
def export_shutdown(self):
|
||||
"""Shutdown the core"""
|
||||
# Make shutdown an async call
|
||||
@ -365,66 +376,68 @@ class Core(
|
||||
self.signals.register_client(self.client_address, port)
|
||||
if self.config["new_release_check"]:
|
||||
self.check_new_release()
|
||||
|
||||
|
||||
def export_deregister_client(self):
|
||||
"""De-registers a client with the signal manager."""
|
||||
self.signals.deregister_client(self.client_address)
|
||||
|
||||
|
||||
def export_add_torrent_file(self, filename, filedump, options):
|
||||
"""Adds a torrent file to the libtorrent session
|
||||
This requires the torrents filename and a dump of it's content
|
||||
"""
|
||||
gobject.idle_add(self._add_torrent_file, filename, filedump, options)
|
||||
|
||||
|
||||
def _add_torrent_file(self, filename, filedump, options):
|
||||
# Turn the filedump into a torrent_info
|
||||
if not isinstance(filedump, str):
|
||||
filedump = filedump.data
|
||||
|
||||
|
||||
if len(filedump) == 0:
|
||||
log.warning("Torrent file is corrupt!")
|
||||
return
|
||||
|
||||
|
||||
try:
|
||||
torrent_info = lt.torrent_info(lt.bdecode(filedump))
|
||||
except RuntimeError, e:
|
||||
log.warning("Unable to decode torrent file: %s", e)
|
||||
return None
|
||||
|
||||
|
||||
torrent_id = self.torrents.add(filedump=filedump, options=options, filename=filename)
|
||||
|
||||
|
||||
# Run the plugin hooks for 'post_torrent_add'
|
||||
self.plugins.run_post_torrent_add(torrent_id)
|
||||
|
||||
def export_add_torrent_url(self, url, save_path, options):
|
||||
def export_add_torrent_url(self, url, options):
|
||||
log.info("Attempting to add url %s", url)
|
||||
|
||||
|
||||
threading.Thread(target=self.fetch_torrent_url_thread, args=(self.export_add_torrent_file, url, options)).start()
|
||||
|
||||
def fetch_torrent_url_thread(self, callback, url, options):
|
||||
# Get the actual filename of the torrent from the url provided.
|
||||
filename = url.split("/")[-1]
|
||||
|
||||
|
||||
# Get the .torrent file from the url
|
||||
torrent_file = deluge.common.fetch_url(url)
|
||||
if torrent_file is None:
|
||||
return False
|
||||
|
||||
|
||||
# Dump the torrents file contents to a string
|
||||
try:
|
||||
filedump = open(torrent_file, "rb").read()
|
||||
except IOError:
|
||||
log.warning("Unable to open %s for reading.", torrent_file)
|
||||
return False
|
||||
|
||||
|
||||
# Add the torrent to session
|
||||
return self.export_add_torrent_file(
|
||||
filename, filedump, options)
|
||||
|
||||
return callback(filename, filedump, options)
|
||||
|
||||
def export_remove_torrent(self, torrent_ids, remove_torrent, remove_data):
|
||||
log.debug("Removing torrent %s from the core.", torrent_ids)
|
||||
for torrent_id in torrent_ids:
|
||||
if self.torrents.remove(torrent_id, remove_torrent, remove_data):
|
||||
# Run the plugin hooks for 'post_torrent_remove'
|
||||
self.plugins.run_post_torrent_remove(torrent_id)
|
||||
|
||||
|
||||
def export_force_reannounce(self, torrent_ids):
|
||||
log.debug("Forcing reannouncment to: %s", torrent_ids)
|
||||
for torrent_id in torrent_ids:
|
||||
@ -435,24 +448,24 @@ class Core(
|
||||
for torrent_id in torrent_ids:
|
||||
if not self.torrents[torrent_id].pause():
|
||||
log.warning("Error pausing torrent %s", torrent_id)
|
||||
|
||||
|
||||
def export_move_storage(self, torrent_ids, dest):
|
||||
log.debug("Moving storage %s to %s", torrent_ids, dest)
|
||||
for torrent_id in torrent_ids:
|
||||
if not self.torrents[torrent_id].move_storage(dest):
|
||||
log.warning("Error moving torrent %s to %s", torrent_id, dest)
|
||||
|
||||
|
||||
def export_pause_all_torrents(self):
|
||||
"""Pause all torrents in the session"""
|
||||
if not self.torrents.pause_all():
|
||||
log.warning("Error pausing all torrents..")
|
||||
|
||||
|
||||
def export_resume_all_torrents(self):
|
||||
"""Resume all torrents in the session"""
|
||||
if self.torrents.resume_all():
|
||||
# Emit the 'torrent_all_resumed' signal
|
||||
self.torrent_all_resumed()
|
||||
|
||||
|
||||
def export_resume_torrent(self, torrent_ids):
|
||||
log.debug("Resuming: %s", torrent_ids)
|
||||
for torrent_id in torrent_ids:
|
||||
@ -466,13 +479,13 @@ class Core(
|
||||
except KeyError:
|
||||
# The torrent_id is not found in the torrentmanager, so return None
|
||||
return None
|
||||
|
||||
|
||||
# Get the leftover fields and ask the plugin manager to fill them
|
||||
leftover_fields = list(set(keys) - set(status.keys()))
|
||||
if len(leftover_fields) > 0:
|
||||
status.update(self.plugins.get_status(torrent_id, leftover_fields))
|
||||
return status
|
||||
|
||||
|
||||
def export_get_torrents_status(self, torrent_ids, keys):
|
||||
status_dict = {}.fromkeys(torrent_ids)
|
||||
|
||||
@ -487,25 +500,25 @@ class Core(
|
||||
if len(leftover_fields) > 0:
|
||||
status.update(
|
||||
self.plugins.get_status(torrent_id, leftover_fields))
|
||||
|
||||
|
||||
status_dict[torrent_id] = status
|
||||
# Emit the torrent_status signal to the clients
|
||||
return status_dict
|
||||
|
||||
|
||||
def export_get_session_state(self):
|
||||
"""Returns a list of torrent_ids in the session."""
|
||||
# Get the torrent list from the TorrentManager
|
||||
return self.torrents.get_torrent_list()
|
||||
|
||||
|
||||
def export_save_state(self):
|
||||
"""Save the current session state to file."""
|
||||
# Have the TorrentManager save it's state
|
||||
self.torrents.save_state()
|
||||
|
||||
|
||||
def export_get_config(self):
|
||||
"""Get all the preferences as a dictionary"""
|
||||
return self.config.get_config()
|
||||
|
||||
|
||||
def export_get_config_value(self, key):
|
||||
"""Get the config value for key"""
|
||||
try:
|
||||
@ -520,16 +533,18 @@ class Core(
|
||||
config = deluge.common.pythonize(config)
|
||||
# Load all the values into the configuration
|
||||
for key in config.keys():
|
||||
if isinstance(config[key], unicode) or isinstance(config[key], str):
|
||||
config[key] = config[key].encode("utf8")
|
||||
self.config[key] = config[key]
|
||||
|
||||
|
||||
def export_get_listen_port(self):
|
||||
"""Returns the active listen port"""
|
||||
return self.session.listen_port()
|
||||
|
||||
|
||||
def export_get_num_connections(self):
|
||||
"""Returns the current number of connections"""
|
||||
return self.session.num_connections()
|
||||
|
||||
|
||||
def export_get_dht_nodes(self):
|
||||
"""Returns the number of dht nodes"""
|
||||
return self.session.status().dht_nodes
|
||||
@ -541,7 +556,7 @@ class Core(
|
||||
def export_get_upload_rate(self):
|
||||
"""Returns the payload upload rate"""
|
||||
return self.session.status().payload_upload_rate
|
||||
|
||||
|
||||
def export_get_available_plugins(self):
|
||||
"""Returns a list of plugins available in the core"""
|
||||
return self.plugins.get_available_plugins()
|
||||
@ -553,73 +568,74 @@ class Core(
|
||||
def export_enable_plugin(self, plugin):
|
||||
self.plugins.enable_plugin(plugin)
|
||||
return None
|
||||
|
||||
|
||||
def export_disable_plugin(self, plugin):
|
||||
self.plugins.disable_plugin(plugin)
|
||||
return None
|
||||
|
||||
|
||||
def export_force_recheck(self, torrent_ids):
|
||||
"""Forces a data recheck on torrent_ids"""
|
||||
for torrent_id in torrent_ids:
|
||||
self.torrents[torrent_id].force_recheck()
|
||||
|
||||
|
||||
def export_set_torrent_trackers(self, torrent_id, trackers):
|
||||
"""Sets a torrents tracker list. trackers will be [{"url", "tier"}]"""
|
||||
return self.torrents[torrent_id].set_trackers(trackers)
|
||||
|
||||
|
||||
def export_set_torrent_max_connections(self, torrent_id, value):
|
||||
"""Sets a torrents max number of connections"""
|
||||
return self.torrents[torrent_id].set_max_connections(value)
|
||||
|
||||
|
||||
def export_set_torrent_max_upload_slots(self, torrent_id, value):
|
||||
"""Sets a torrents max number of upload slots"""
|
||||
return self.torrents[torrent_id].set_max_upload_slots(value)
|
||||
|
||||
|
||||
def export_set_torrent_max_upload_speed(self, torrent_id, value):
|
||||
"""Sets a torrents max upload speed"""
|
||||
return self.torrents[torrent_id].set_max_upload_speed(value)
|
||||
|
||||
|
||||
def export_set_torrent_max_download_speed(self, torrent_id, value):
|
||||
"""Sets a torrents max download speed"""
|
||||
return self.torrents[torrent_id].set_max_download_speed(value)
|
||||
|
||||
|
||||
def export_set_torrent_file_priorities(self, torrent_id, priorities):
|
||||
"""Sets a torrents file priorities"""
|
||||
return self.torrents[torrent_id].set_file_priorities(priorities)
|
||||
|
||||
|
||||
def export_set_torrent_prioritize_first_last(self, torrent_id, value):
|
||||
"""Sets a higher priority to the first and last pieces"""
|
||||
return self.torrents[torrent_id].set_prioritize_first_last(value)
|
||||
|
||||
|
||||
def export_set_torrent_auto_managed(self, torrent_id, value):
|
||||
"""Sets the auto managed flag for queueing purposes"""
|
||||
return self.torrents[torrent_id].set_auto_managed(value)
|
||||
|
||||
|
||||
def export_set_torrent_stop_at_ratio(self, torrent_id, value):
|
||||
"""Sets the torrent to stop at 'stop_ratio'"""
|
||||
return self.torrents[torrent_id].set_stop_at_ratio(value)
|
||||
|
||||
|
||||
def export_set_torrent_stop_ratio(self, torrent_id, value):
|
||||
"""Sets the ratio when to stop a torrent if 'stop_at_ratio' is set"""
|
||||
return self.torrents[torrent_id].set_stop_ratio(value)
|
||||
|
||||
|
||||
def export_set_torrent_remove_at_ratio(self, torrent_id, value):
|
||||
"""Sets the torrent to be removed at 'stop_ratio'"""
|
||||
return self.torrents[torrent_id].set_remove_at_ratio(value)
|
||||
|
||||
|
||||
def export_block_ip_range(self, range):
|
||||
"""Block an ip range"""
|
||||
try:
|
||||
self.ip_filter.add_rule(range[0], range[1], 1)
|
||||
except AttributeError:
|
||||
self.export_reset_ip_filter()
|
||||
self.ip_filter.add_rule(range[0], range[1], 1)
|
||||
|
||||
self.ip_filter.add_rule(range[0], range[1], 1)
|
||||
|
||||
# Start a 2 second timer (and remove the previous one if it exists)
|
||||
if self._set_ip_filter_timer:
|
||||
gobject.source_remove(self._set_ip_filter_timer)
|
||||
self._set_ip_filter_timer = gobject.timeout_add(2000, self.session.set_ip_filter, self.ip_filter)
|
||||
|
||||
def export_reset_ip_filter(self):
|
||||
"""Clears the ip filter"""
|
||||
self.ip_filter = lt.ip_filter()
|
||||
self.session.set_ip_filter(self.ip_filter)
|
||||
|
||||
|
||||
def export_get_health(self):
|
||||
"""Returns True if we have established incoming connections"""
|
||||
return self.session.status().has_incoming_connections
|
||||
@ -674,7 +690,7 @@ class Core(
|
||||
"""Emitted when a torrent has been removed from the core"""
|
||||
log.debug("torrent_remove signal emitted")
|
||||
self.signals.emit("torrent_removed", torrent_id)
|
||||
|
||||
|
||||
def torrent_paused(self, torrent_id):
|
||||
"""Emitted when a torrent is paused"""
|
||||
log.debug("torrent_paused signal emitted")
|
||||
@ -704,31 +720,31 @@ class Core(
|
||||
"""Emitted when a torrent queue position is changed"""
|
||||
log.debug("torrent_queue_changed signal emitted")
|
||||
self.signals.emit("torrent_queue_changed")
|
||||
|
||||
|
||||
# Config set functions
|
||||
def _on_config_value_change(self, key, value):
|
||||
self.config_value_changed(key, value)
|
||||
|
||||
|
||||
def _on_set_torrentfiles_location(self, key, value):
|
||||
# First try to create the new directory
|
||||
try:
|
||||
os.makedirs(value)
|
||||
except Exception, e:
|
||||
log.debug("Unable to make directory: %s", e)
|
||||
|
||||
if self.config["copy_torrent_file"]:
|
||||
try:
|
||||
os.makedirs(value)
|
||||
except Exception, e:
|
||||
log.debug("Unable to make directory: %s", e)
|
||||
|
||||
def _on_set_state_location(self, key, value):
|
||||
if not os.access(value, os.F_OK):
|
||||
try:
|
||||
os.makedirs(value)
|
||||
except Exception, e:
|
||||
log.debug("Unable to make directory: %s", e)
|
||||
|
||||
|
||||
def _on_set_listen_ports(self, key, value):
|
||||
# Only set the listen ports if random_port is not true
|
||||
if self.config["random_port"] is not True:
|
||||
log.debug("listen port range set to %s-%s", value[0], value[1])
|
||||
self.session.listen_on(value[0], value[1])
|
||||
|
||||
|
||||
def _on_set_random_port(self, key, value):
|
||||
log.debug("random port value set to %s", value)
|
||||
# We need to check if the value has been changed to true and false
|
||||
@ -741,12 +757,12 @@ class Core(
|
||||
listen_ports.append(listen_ports[0]+10)
|
||||
else:
|
||||
listen_ports = self.config["listen_ports"]
|
||||
|
||||
|
||||
# Set the listen ports
|
||||
log.debug("listen port range set to %s-%s", listen_ports[0],
|
||||
log.debug("listen port range set to %s-%s", listen_ports[0],
|
||||
listen_ports[1])
|
||||
self.session.listen_on(listen_ports[0], listen_ports[1])
|
||||
|
||||
|
||||
def _on_set_dht(self, key, value):
|
||||
log.debug("dht value set to %s", value)
|
||||
if value:
|
||||
@ -756,14 +772,14 @@ class Core(
|
||||
self.session.add_dht_router("router.bitcomet.com", 6881)
|
||||
else:
|
||||
self.session.stop_dht()
|
||||
|
||||
|
||||
def _on_set_upnp(self, key, value):
|
||||
log.debug("upnp value set to %s", value)
|
||||
if value:
|
||||
self.session.start_upnp()
|
||||
else:
|
||||
self.session.stop_upnp()
|
||||
|
||||
|
||||
def _on_set_natpmp(self, key, value):
|
||||
log.debug("natpmp value set to %s", value)
|
||||
if value:
|
||||
@ -777,7 +793,7 @@ class Core(
|
||||
self.session.start_lsd()
|
||||
else:
|
||||
self.session.stop_lsd()
|
||||
|
||||
|
||||
def _on_set_utpex(self, key, value):
|
||||
log.debug("utpex value set to %s", value)
|
||||
if value:
|
||||
@ -794,7 +810,7 @@ class Core(
|
||||
self.session.set_pe_settings(pe_settings)
|
||||
set = self.session.get_pe_settings()
|
||||
log.debug("encryption settings:\n\t\t\tout_policy: %s\n\t\t\
|
||||
in_policy: %s\n\t\t\tlevel: %s\n\t\t\tprefer_rc4: %s",
|
||||
in_policy: %s\n\t\t\tlevel: %s\n\t\t\tprefer_rc4: %s",
|
||||
set.out_enc_policy,
|
||||
set.in_enc_policy,
|
||||
set.allowed_enc_level,
|
||||
@ -802,8 +818,12 @@ class Core(
|
||||
|
||||
def _on_set_max_connections_global(self, key, value):
|
||||
log.debug("max_connections_global set to %s..", value)
|
||||
self.session.set_max_connections(value)
|
||||
|
||||
# Add this in to overwrite bad float values in the config, to prevent
|
||||
# future issues with 1.1
|
||||
if type(value) is not int:
|
||||
self.config[key] = int(value)
|
||||
self.session.set_max_connections(int(value))
|
||||
|
||||
def _on_set_max_upload_speed(self, key, value):
|
||||
log.debug("max_upload_speed set to %s..", value)
|
||||
# We need to convert Kb/s to B/s
|
||||
@ -813,22 +833,22 @@ class Core(
|
||||
log.debug("max_download_speed set to %s..", value)
|
||||
# We need to convert Kb/s to B/s
|
||||
self.session.set_download_rate_limit(int(value * 1024))
|
||||
|
||||
|
||||
def _on_set_max_upload_slots_global(self, key, value):
|
||||
log.debug("max_upload_slots_global set to %s..", value)
|
||||
self.session.set_max_uploads(value)
|
||||
|
||||
def _on_set_max_half_open_connections(self, key, value):
|
||||
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)
|
||||
|
||||
|
||||
def _on_ignore_limits_on_local_network(self, key, value):
|
||||
self.settings.ignore_limits_on_local_network = value
|
||||
self.session.set_settings(self.settings)
|
||||
|
||||
|
||||
def _on_set_share_ratio_limit(self, key, value):
|
||||
log.debug("%s set to %s..", key, value)
|
||||
self.settings.share_ratio_limit = value
|
||||
@ -862,7 +882,7 @@ class Core(
|
||||
log.debug("active_limit: %s", self.settings.active_limit)
|
||||
self.settings.active_limit = value
|
||||
self.session.set_settings(self.settings)
|
||||
|
||||
|
||||
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
|
||||
@ -903,12 +923,12 @@ class Core(
|
||||
from urllib2 import urlopen
|
||||
try:
|
||||
self.new_release = urlopen(
|
||||
"http://download.deluge-torrent.org/version-1.0").read().strip()
|
||||
"http://download.deluge-torrent.org/version").read().strip()
|
||||
except Exception, e:
|
||||
log.debug("Unable to get release info from website: %s", e)
|
||||
return
|
||||
self.check_new_release()
|
||||
|
||||
|
||||
def check_new_release(self):
|
||||
if self.new_release:
|
||||
log.debug("new_release: %s", self.new_release)
|
||||
@ -916,7 +936,7 @@ class Core(
|
||||
self.signals.emit("new_version_available", self.new_release)
|
||||
return self.new_release
|
||||
return False
|
||||
|
||||
|
||||
def _on_new_release_check(self, key, value):
|
||||
if value:
|
||||
log.debug("Checking for new release..")
|
||||
|
@ -7,7 +7,7 @@
|
||||
#
|
||||
# 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 2 of the License, or (at your option)
|
||||
# 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,
|
||||
|
135
deluge/core/oldstateupgrader.py
Normal file
135
deluge/core/oldstateupgrader.py
Normal file
@ -0,0 +1,135 @@
|
||||
#
|
||||
# oldstateupgrader.py
|
||||
#
|
||||
# Copyright (C) 2008 Andrew Resch ('andar') <andrewresch@gmail.com>
|
||||
#
|
||||
# Deluge is free software.
|
||||
#
|
||||
# You may redistribute it and/or modify it under the terms of the
|
||||
# GNU General Public License, as published by the Free Software
|
||||
# Foundation; either version 3 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# deluge is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with deluge. If not, write to:
|
||||
# The Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# In addition, as a special exception, the copyright holders give
|
||||
# permission to link the code of portions of this program with the OpenSSL
|
||||
# library.
|
||||
# You must obey the GNU General Public License in all respects for all of
|
||||
# the code used other than OpenSSL. If you modify file(s) with this
|
||||
# exception, you may extend this exception to your version of the file(s),
|
||||
# but you are not obligated to do so. If you do not wish to do so, delete
|
||||
# this exception statement from your version. If you delete this exception
|
||||
# statement from all source files in the program, then also delete it here.
|
||||
|
||||
import os
|
||||
import os.path
|
||||
import pickle
|
||||
import cPickle
|
||||
import shutil
|
||||
|
||||
try:
|
||||
import libtorrent as lt
|
||||
except ImportError:
|
||||
import deluge.libtorrent as lt
|
||||
from deluge.configmanager import ConfigManager
|
||||
import deluge.core.torrentmanager
|
||||
from deluge.log import LOG as log
|
||||
|
||||
#start : http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286203
|
||||
def makeFakeClass(module, name):
|
||||
class FakeThing(object):
|
||||
pass
|
||||
FakeThing.__name__ = name
|
||||
FakeThing.__module__ = '(fake)' + module
|
||||
return FakeThing
|
||||
|
||||
class PickleUpgrader(pickle.Unpickler):
|
||||
def find_class(self, module, cname):
|
||||
# Pickle tries to load a couple things like copy_reg and
|
||||
# __builtin__.object even though a pickle file doesn't
|
||||
# explicitly reference them (afaict): allow them to be loaded
|
||||
# normally.
|
||||
if module in ('copy_reg', '__builtin__'):
|
||||
thing = pickle.Unpickler.find_class(self, module, cname)
|
||||
return thing
|
||||
return makeFakeClass(module, cname)
|
||||
# end: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286203
|
||||
|
||||
class OldStateUpgrader:
|
||||
def __init__(self):
|
||||
self.config = ConfigManager("core.conf")
|
||||
self.state05_location = os.path.join(self.config["config_location"], "persistent.state")
|
||||
self.state10_location = os.path.join(self.config["state_location"], "torrents.state")
|
||||
if os.path.exists(self.state05_location) and not os.path.exists(self.state10_location):
|
||||
# If the 0.5 state file exists and the 1.0 doesn't, then let's upgrade it
|
||||
self.upgrade05()
|
||||
|
||||
def upgrade05(self):
|
||||
try:
|
||||
state = PickleUpgrader(open(self.state05_location, "rb")).load()
|
||||
except Exception, e:
|
||||
log.debug("Unable to open 0.5 state file: %s", e)
|
||||
return
|
||||
|
||||
new_state = deluge.core.torrentmanager.TorrentManagerState()
|
||||
for ti, uid in state.torrents.items():
|
||||
torrent_path = os.path.join(self.config["config_location"], "torrentfiles", ti.filename)
|
||||
try:
|
||||
torrent_info = None
|
||||
log.debug("Attempting to create torrent_info from %s", torrent_path)
|
||||
_file = open(torrent_path, "rb")
|
||||
torrent_info = lt.torrent_info(lt.bdecode(_file.read()))
|
||||
_file.close()
|
||||
except (IOError, RuntimeError), e:
|
||||
log.warning("Unable to open %s: %s", filepath, e)
|
||||
|
||||
# Copy the torrent file to the new location
|
||||
import shutil
|
||||
shutil.copyfile(torrent_path, os.path.join(self.config["state_location"], str(torrent_info.info_hash()) + ".torrent"))
|
||||
|
||||
# Set the file prioritiy property if not already there
|
||||
if not hasattr(ti, "priorities"):
|
||||
ti.priorities = [1] * torrent_info.num_files()
|
||||
|
||||
# Create the new TorrentState object
|
||||
new_torrent = deluge.core.torrentmanager.TorrentState(
|
||||
torrent_id=str(torrent_info.info_hash()),
|
||||
filename=ti.filename,
|
||||
save_path=ti.save_dir,
|
||||
compact=ti.compact,
|
||||
paused=ti.user_paused,
|
||||
total_uploaded=ti.uploaded_memory,
|
||||
max_upload_speed=ti.upload_rate_limit,
|
||||
max_download_speed=ti.download_rate_limit,
|
||||
file_priorities=ti.priorities,
|
||||
queue=state.queue.index(ti)
|
||||
)
|
||||
# Append the object to the state list
|
||||
new_state.torrents.append(new_torrent)
|
||||
|
||||
# Now we need to write out the new state file
|
||||
try:
|
||||
log.debug("Saving torrent state file.")
|
||||
state_file = open(
|
||||
os.path.join(self.config["state_location"], "torrents.state"), "wb")
|
||||
cPickle.dump(new_state, state_file)
|
||||
state_file.close()
|
||||
except IOError, e:
|
||||
log.warning("Unable to save state file: %s", e)
|
||||
return
|
||||
|
||||
# Rename the persistent.state file
|
||||
try:
|
||||
os.rename(self.state05_location, self.state05_location + ".old")
|
||||
except Exception, e:
|
||||
log.debug("Unable to rename old persistent.state file! %s", e)
|
@ -7,7 +7,7 @@
|
||||
#
|
||||
# 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 2 of the License, or (at your option)
|
||||
# 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,
|
||||
|
@ -7,7 +7,7 @@
|
||||
#
|
||||
# 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 2 of the License, or (at your option)
|
||||
# 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,
|
||||
|
@ -2,19 +2,19 @@
|
||||
# torrent.py
|
||||
#
|
||||
# Copyright (C) 2007, 2008 Andrew Resch ('andar') <andrewresch@gmail.com>
|
||||
#
|
||||
#
|
||||
# Deluge is free software.
|
||||
#
|
||||
#
|
||||
# You may redistribute it and/or modify it under the terms of the
|
||||
# GNU General Public License, as published by the Free Software
|
||||
# Foundation; either version 2 of the License, or (at your option)
|
||||
# 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.,
|
||||
@ -35,7 +35,10 @@
|
||||
|
||||
import os
|
||||
|
||||
import deluge.libtorrent as lt
|
||||
try:
|
||||
import libtorrent as lt
|
||||
except ImportError:
|
||||
import deluge.libtorrent as lt
|
||||
import deluge.common
|
||||
import deluge.component as component
|
||||
from deluge.configmanager import ConfigManager
|
||||
@ -61,7 +64,7 @@ class Torrent:
|
||||
|
||||
# We store the filename just in case we need to make a copy of the torrentfile
|
||||
self.filename = filename
|
||||
|
||||
|
||||
# Holds status info so that we don't need to keep getting it from lt
|
||||
self.status = self.handle.status()
|
||||
self.torrent_info = self.handle.get_torrent_info()
|
||||
@ -70,10 +73,10 @@ class Torrent:
|
||||
self.files = self.get_files()
|
||||
# Set the default file priorities to normal
|
||||
self.file_priorities = [1]* len(self.files)
|
||||
|
||||
|
||||
# Default total_uploaded to 0, this may be changed by the state
|
||||
self.total_uploaded = 0
|
||||
|
||||
|
||||
# Set default auto_managed value
|
||||
self.auto_managed = options["auto_managed"]
|
||||
if not handle.is_paused():
|
||||
@ -82,12 +85,12 @@ class Torrent:
|
||||
# We need to keep track if the torrent is finished in the state to prevent
|
||||
# some weird things on state load.
|
||||
self.is_finished = False
|
||||
|
||||
|
||||
# Queueing options
|
||||
self.stop_at_ratio = False
|
||||
self.stop_ratio = 2.00
|
||||
self.remove_at_ratio = False
|
||||
|
||||
|
||||
# Load values from state if we have it
|
||||
if state is not None:
|
||||
# This is for saving the total uploaded between sessions
|
||||
@ -101,7 +104,7 @@ class Torrent:
|
||||
self.set_stop_at_ratio(state.stop_at_ratio)
|
||||
self.set_stop_ratio(state.stop_ratio)
|
||||
self.set_remove_at_ratio(state.remove_at_ratio)
|
||||
else:
|
||||
else:
|
||||
# Tracker list
|
||||
self.trackers = []
|
||||
# Create a list of trackers
|
||||
@ -111,51 +114,52 @@ class Torrent:
|
||||
tracker["tier"] = value.tier
|
||||
self.trackers.append(tracker)
|
||||
|
||||
# Set the allocation mode
|
||||
self.compact = options["compact_allocation"]
|
||||
|
||||
# Various torrent options
|
||||
self.set_max_connections(options["max_connections_per_torrent"])
|
||||
self.set_max_upload_slots(options["max_upload_slots_per_torrent"])
|
||||
self.set_max_upload_speed(options["max_upload_speed_per_torrent"])
|
||||
self.set_max_download_speed(options["max_download_speed_per_torrent"])
|
||||
self.set_prioritize_first_last(options["prioritize_first_last_pieces"])
|
||||
self.handle.resolve_countries(True)
|
||||
self.handle.resolve_countries(True)
|
||||
if options.has_key("file_priorities"):
|
||||
self.set_file_priorities(options["file_priorities"])
|
||||
|
||||
# Set the allocation mode
|
||||
self.compact = options["compact_allocation"]
|
||||
|
||||
# Where the torrent is being saved to
|
||||
self.save_path = options["download_location"]
|
||||
# Status message holds error info about the torrent
|
||||
self.statusmsg = "OK"
|
||||
|
||||
|
||||
# The torrents state
|
||||
self.update_state()
|
||||
|
||||
|
||||
# The tracker status
|
||||
self.tracker_status = ""
|
||||
|
||||
|
||||
log.debug("Torrent object created.")
|
||||
|
||||
|
||||
def set_tracker_status(self, status):
|
||||
"""Sets the tracker status"""
|
||||
self.tracker_status = status
|
||||
|
||||
|
||||
def set_max_connections(self, max_connections):
|
||||
self.max_connections = int(max_connections)
|
||||
self.handle.set_max_connections(self.max_connections)
|
||||
|
||||
|
||||
def set_max_upload_slots(self, max_slots):
|
||||
self.max_upload_slots = int(max_slots)
|
||||
self.handle.set_max_uploads(self.max_upload_slots)
|
||||
|
||||
|
||||
def set_max_upload_speed(self, m_up_speed):
|
||||
self.max_upload_speed = m_up_speed
|
||||
self.handle.set_upload_limit(int(m_up_speed * 1024))
|
||||
|
||||
|
||||
def set_max_download_speed(self, m_down_speed):
|
||||
self.max_download_speed = m_down_speed
|
||||
self.handle.set_download_limit(int(m_down_speed * 1024))
|
||||
|
||||
|
||||
def set_prioritize_first_last(self, prioritize):
|
||||
self.prioritize_first_last = prioritize
|
||||
if self.prioritize_first_last:
|
||||
@ -165,30 +169,37 @@ class Torrent:
|
||||
priorities[0] = 7
|
||||
priorities[-1] = 7
|
||||
self.handle.prioritize_pieces(priorities)
|
||||
|
||||
|
||||
def set_save_path(self, save_path):
|
||||
self.save_path = save_path
|
||||
|
||||
|
||||
def set_auto_managed(self, auto_managed):
|
||||
self.auto_managed = auto_managed
|
||||
self.handle.auto_managed(auto_managed)
|
||||
self.update_state()
|
||||
|
||||
|
||||
def set_stop_ratio(self, stop_ratio):
|
||||
self.stop_ratio = stop_ratio
|
||||
|
||||
|
||||
def set_stop_at_ratio(self, stop_at_ratio):
|
||||
self.stop_at_ratio = stop_at_ratio
|
||||
|
||||
|
||||
def set_remove_at_ratio(self, remove_at_ratio):
|
||||
self.remove_at_ratio = remove_at_ratio
|
||||
|
||||
|
||||
def set_file_priorities(self, file_priorities):
|
||||
log.debug("setting %s's file priorities: %s", self.torrent_id, file_priorities)
|
||||
if len(file_priorities) != len(self.files):
|
||||
log.debug("file_priorities len != num_files")
|
||||
self.options["file_priorities"] = self.handle.file_priorities()
|
||||
return
|
||||
|
||||
|
||||
if self.compact:
|
||||
log.debug("setting file priority with compact allocation does not work!")
|
||||
self.file_priorities = self.handle.file_priorities()
|
||||
return
|
||||
|
||||
log.debug("setting %s's file priorities: %s", self.torrent_id, file_priorities)
|
||||
|
||||
self.handle.prioritize_files(file_priorities)
|
||||
|
||||
if 0 in self.file_priorities:
|
||||
@ -200,7 +211,7 @@ class Torrent:
|
||||
self.is_finished = False
|
||||
self.update_state()
|
||||
break
|
||||
|
||||
|
||||
self.file_priorities = file_priorities
|
||||
|
||||
# Set the first/last priorities if needed
|
||||
@ -210,7 +221,14 @@ class Torrent:
|
||||
"""Sets trackers"""
|
||||
if trackers == None:
|
||||
trackers = []
|
||||
|
||||
for value in self.handle.trackers():
|
||||
tracker = {}
|
||||
tracker["url"] = value.url
|
||||
tracker["tier"] = value.tier
|
||||
trackers.append(tracker)
|
||||
self.trackers = trackers
|
||||
return
|
||||
|
||||
log.debug("Setting trackers for %s: %s", self.torrent_id, trackers)
|
||||
tracker_list = []
|
||||
|
||||
@ -218,9 +236,9 @@ class Torrent:
|
||||
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():
|
||||
log.debug("tier: %s tracker: %s", t.tier, t.url)
|
||||
@ -229,26 +247,25 @@ class Torrent:
|
||||
if len(trackers) > 0:
|
||||
# Force a reannounce if there is at least 1 tracker
|
||||
self.force_reannounce()
|
||||
|
||||
|
||||
def update_state(self):
|
||||
"""Updates the state based on what libtorrent's state for the torrent is"""
|
||||
# Set the initial state based on the lt state
|
||||
LTSTATE = deluge.common.LT_TORRENT_STATE
|
||||
ltstate = int(self.handle.status().state)
|
||||
|
||||
|
||||
log.debug("set_state_based_on_ltstate: %s", ltstate)
|
||||
|
||||
|
||||
if ltstate == LTSTATE["Queued"] or ltstate == LTSTATE["Checking"]:
|
||||
self.state = "Checking"
|
||||
return
|
||||
elif ltstate == LTSTATE["Connecting"] or ltstate == LTSTATE["Downloading"] or\
|
||||
ltstate == LTSTATE["Downloading Metadata"]:
|
||||
elif ltstate == LTSTATE["Downloading"] or ltstate == LTSTATE["Downloading Metadata"]:
|
||||
self.state = "Downloading"
|
||||
elif ltstate == LTSTATE["Finished"] or ltstate == LTSTATE["Seeding"]:
|
||||
self.state = "Seeding"
|
||||
elif ltstate == LTSTATE["Allocating"]:
|
||||
self.state = "Allocating"
|
||||
|
||||
|
||||
if self.handle.is_paused() and len(self.handle.status().error) > 0:
|
||||
# This is an error'd torrent
|
||||
self.state = "Error"
|
||||
@ -258,7 +275,7 @@ class Torrent:
|
||||
self.state = "Queued"
|
||||
elif self.handle.is_paused() and not self.handle.is_auto_managed():
|
||||
self.state = "Paused"
|
||||
|
||||
|
||||
def set_state(self, state):
|
||||
"""Accepts state strings, ie, "Paused", "Seeding", etc."""
|
||||
if state not in TORRENT_STATE:
|
||||
@ -277,17 +294,17 @@ class Torrent:
|
||||
status = self.handle.status()
|
||||
else:
|
||||
status = self.status
|
||||
|
||||
|
||||
left = status.total_wanted - status.total_done
|
||||
|
||||
if left == 0 or status.download_payload_rate == 0:
|
||||
|
||||
if left <= 0 or status.download_payload_rate == 0:
|
||||
return 0
|
||||
|
||||
|
||||
try:
|
||||
eta = left / status.download_payload_rate
|
||||
except ZeroDivisionError:
|
||||
eta = 0
|
||||
|
||||
|
||||
return eta
|
||||
|
||||
def get_ratio(self):
|
||||
@ -296,20 +313,12 @@ class Torrent:
|
||||
status = self.handle.status()
|
||||
else:
|
||||
status = self.status
|
||||
|
||||
up = self.total_uploaded + status.total_payload_upload
|
||||
down = status.total_done
|
||||
|
||||
# Convert 'up' and 'down' to floats for proper calculation
|
||||
up = float(up)
|
||||
down = float(down)
|
||||
|
||||
try:
|
||||
ratio = up / down
|
||||
except ZeroDivisionError:
|
||||
return 0.0
|
||||
|
||||
return ratio
|
||||
# Return -1.0 if the downloaded bytes is 0, this is to represent infinity
|
||||
if status.all_time_download == 0:
|
||||
return -1.0
|
||||
|
||||
return float(status.all_time_upload) / float(status.all_time_download)
|
||||
|
||||
def get_files(self):
|
||||
"""Returns a list of files this torrent contains"""
|
||||
@ -317,7 +326,7 @@ class Torrent:
|
||||
torrent_info = self.handle.get_torrent_info()
|
||||
else:
|
||||
torrent_info = self.torrent_info
|
||||
|
||||
|
||||
ret = []
|
||||
files = torrent_info.files()
|
||||
for index, file in enumerate(files):
|
||||
@ -328,12 +337,12 @@ class Torrent:
|
||||
'offset': file.offset
|
||||
})
|
||||
return ret
|
||||
|
||||
|
||||
def get_peers(self):
|
||||
"""Returns a list of peers and various information about them"""
|
||||
ret = []
|
||||
peers = self.handle.get_peer_info()
|
||||
|
||||
|
||||
for peer in peers:
|
||||
# We do not want to report peers that are half-connected
|
||||
if peer.flags & peer.connecting or peer.flags & peer.handshake:
|
||||
@ -342,7 +351,7 @@ class Torrent:
|
||||
client = str(peer.client).decode("utf-8")
|
||||
except UnicodeDecodeError:
|
||||
client = str(peer.client).decode("latin-1")
|
||||
|
||||
|
||||
# Make country a proper string
|
||||
country = str()
|
||||
for c in peer.country:
|
||||
@ -350,7 +359,7 @@ class Torrent:
|
||||
country += " "
|
||||
else:
|
||||
country += c
|
||||
|
||||
|
||||
ret.append({
|
||||
"ip": "%s:%s" % (peer.ip[0], peer.ip[1]),
|
||||
"up_speed": peer.up_speed,
|
||||
@ -361,11 +370,11 @@ class Torrent:
|
||||
})
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
def get_queue_position(self):
|
||||
"""Returns the torrents queue position"""
|
||||
return self.handle.queue_position()
|
||||
|
||||
|
||||
def get_file_progress(self):
|
||||
"""Returns the file progress as a list of floats.. 0.0 -> 1.0"""
|
||||
file_progress = self.handle.file_progress()
|
||||
@ -377,25 +386,25 @@ class Torrent:
|
||||
ret.append(0.0)
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
def get_status(self, keys):
|
||||
"""Returns the status of the torrent based on the keys provided"""
|
||||
# Create the full dictionary
|
||||
self.status = self.handle.status()
|
||||
self.torrent_info = self.handle.get_torrent_info()
|
||||
|
||||
|
||||
# Adjust progress to be 0-100 value
|
||||
progress = self.status.progress * 100
|
||||
|
||||
|
||||
# Adjust status.distributed_copies to return a non-negative value
|
||||
distributed_copies = self.status.distributed_copies
|
||||
if distributed_copies < 0:
|
||||
distributed_copies = 0.0
|
||||
|
||||
|
||||
full_status = {
|
||||
"distributed_copies": distributed_copies,
|
||||
"total_done": self.status.total_done,
|
||||
"total_uploaded": self.total_uploaded + self.status.total_payload_upload,
|
||||
"total_uploaded": self.status.all_time_upload,
|
||||
"state": self.state,
|
||||
"paused": self.status.paused,
|
||||
"progress": progress,
|
||||
@ -431,28 +440,28 @@ class Torrent:
|
||||
"stop_at_ratio": self.stop_at_ratio,
|
||||
"remove_at_ratio": self.remove_at_ratio
|
||||
}
|
||||
|
||||
fns = {
|
||||
"name": self.torrent_info.name,
|
||||
|
||||
fns = {
|
||||
"name": self.torrent_info.name,
|
||||
"private": self.torrent_info.priv,
|
||||
"total_size": self.torrent_info.total_size,
|
||||
"num_files": self.torrent_info.num_files,
|
||||
"num_pieces": self.torrent_info.num_pieces,
|
||||
"piece_length": self.torrent_info.piece_length,
|
||||
"eta": self.get_eta,
|
||||
"ratio": self.get_ratio,
|
||||
"total_size": self.torrent_info.total_size,
|
||||
"num_files": self.torrent_info.num_files,
|
||||
"num_pieces": self.torrent_info.num_pieces,
|
||||
"piece_length": self.torrent_info.piece_length,
|
||||
"eta": self.get_eta,
|
||||
"ratio": self.get_ratio,
|
||||
"file_progress": self.get_file_progress,
|
||||
"queue": self.handle.queue_position,
|
||||
"is_seed": self.handle.is_seed,
|
||||
"peers": self.get_peers,
|
||||
}
|
||||
}
|
||||
|
||||
self.status = None
|
||||
self.torrent_info = None
|
||||
|
||||
|
||||
# Create the desired status dictionary and return it
|
||||
status_dict = {}
|
||||
|
||||
|
||||
if len(keys) == 0:
|
||||
status_dict = full_status
|
||||
for key in fns:
|
||||
@ -461,11 +470,11 @@ class Torrent:
|
||||
for key in keys:
|
||||
if key in full_status:
|
||||
status_dict[key] = full_status[key]
|
||||
elif key in fns:
|
||||
elif key in fns:
|
||||
status_dict[key] = fns[key]()
|
||||
|
||||
return status_dict
|
||||
|
||||
|
||||
def apply_options(self):
|
||||
"""Applies the per-torrent options that are set."""
|
||||
self.handle.set_max_connections(self.max_connections)
|
||||
@ -474,7 +483,7 @@ class Torrent:
|
||||
self.handle.set_download_limit(int(self.max_download_speed * 1024))
|
||||
self.handle.prioritize_files(self.file_priorities)
|
||||
self.handle.resolve_countries(True)
|
||||
|
||||
|
||||
def pause(self):
|
||||
"""Pause this torrent"""
|
||||
# Turn off auto-management so the torrent will not be unpaused by lt queueing
|
||||
@ -492,19 +501,19 @@ class Torrent:
|
||||
except Exception, e:
|
||||
log.debug("Unable to pause torrent: %s", e)
|
||||
return False
|
||||
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def resume(self):
|
||||
"""Resumes this torrent"""
|
||||
|
||||
|
||||
if self.handle.is_paused() and self.handle.is_auto_managed():
|
||||
log.debug("Torrent is being auto-managed, cannot resume!")
|
||||
return
|
||||
else:
|
||||
# Reset the status message just in case of resuming an Error'd torrent
|
||||
self.set_status_message("OK")
|
||||
|
||||
|
||||
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.stop_at_ratio:
|
||||
@ -512,7 +521,7 @@ class Torrent:
|
||||
ratio = self.stop_ratio
|
||||
else:
|
||||
ratio = self.config["stop_seed_ratio"]
|
||||
|
||||
|
||||
if self.get_ratio() >= ratio:
|
||||
self.signals.emit("torrent_resume_at_stop_ratio")
|
||||
return
|
||||
@ -520,18 +529,18 @@ class Torrent:
|
||||
if self.auto_managed:
|
||||
# This torrent is to be auto-managed by lt queueing
|
||||
self.handle.auto_managed(True)
|
||||
|
||||
|
||||
try:
|
||||
self.handle.resume()
|
||||
except:
|
||||
pass
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def move_storage(self, dest):
|
||||
"""Move a torrent's storage location"""
|
||||
try:
|
||||
self.handle.move_storage(dest)
|
||||
self.handle.move_storage(dest.encode("utf8"))
|
||||
except:
|
||||
return False
|
||||
|
||||
@ -545,11 +554,12 @@ class Torrent:
|
||||
self.torrent_id)
|
||||
log.debug("Saving fastresume file: %s", path)
|
||||
try:
|
||||
self.delete_fastresume()
|
||||
fastresume = open(path, "wb")
|
||||
fastresume.write(resume_data)
|
||||
fastresume.close()
|
||||
except IOError:
|
||||
log.warning("Error trying to save fastresume file")
|
||||
log.warning("Error trying to save fastresume file")
|
||||
|
||||
def delete_fastresume(self):
|
||||
"""Deletes the .fastresume file"""
|
||||
@ -572,7 +582,7 @@ class Torrent:
|
||||
os.remove(path)
|
||||
except Exception, e:
|
||||
log.warning("Unable to delete the torrent file: %s", e)
|
||||
|
||||
|
||||
def force_reannounce(self):
|
||||
"""Force a tracker reannounce"""
|
||||
try:
|
||||
@ -580,9 +590,9 @@ class Torrent:
|
||||
except Exception, e:
|
||||
log.debug("Unable to force reannounce: %s", e)
|
||||
return False
|
||||
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def scrape_tracker(self):
|
||||
"""Scrape the tracker"""
|
||||
try:
|
||||
@ -590,9 +600,9 @@ class Torrent:
|
||||
except Exception, e:
|
||||
log.debug("Unable to scrape tracker: %s", e)
|
||||
return False
|
||||
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def force_recheck(self):
|
||||
"""Forces a recheck of the torrents pieces"""
|
||||
try:
|
||||
|
@ -7,7 +7,7 @@
|
||||
#
|
||||
# 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 2 of the License, or (at your option)
|
||||
# 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,
|
||||
@ -40,12 +40,16 @@ import time
|
||||
|
||||
import gobject
|
||||
|
||||
import deluge.libtorrent as lt
|
||||
try:
|
||||
import libtorrent as lt
|
||||
except ImportError:
|
||||
import deluge.libtorrent as lt
|
||||
|
||||
import deluge.common
|
||||
import deluge.component as component
|
||||
from deluge.configmanager import ConfigManager
|
||||
from deluge.core.torrent import Torrent
|
||||
import deluge.core.oldstateupgrader
|
||||
|
||||
from deluge.log import LOG as log
|
||||
|
||||
@ -53,23 +57,23 @@ class TorrentState:
|
||||
def __init__(self,
|
||||
torrent_id=None,
|
||||
filename=None,
|
||||
total_uploaded=None,
|
||||
total_uploaded=0,
|
||||
trackers=None,
|
||||
compact=None,
|
||||
paused=None,
|
||||
compact=False,
|
||||
paused=False,
|
||||
save_path=None,
|
||||
max_connections=None,
|
||||
max_upload_slots=None,
|
||||
max_upload_speed=None,
|
||||
max_download_speed=None,
|
||||
prioritize_first_last=None,
|
||||
max_connections=-1,
|
||||
max_upload_slots=-1,
|
||||
max_upload_speed=-1.0,
|
||||
max_download_speed=-1.0,
|
||||
prioritize_first_last=False,
|
||||
file_priorities=None,
|
||||
queue=None,
|
||||
auto_managed=None,
|
||||
auto_managed=True,
|
||||
is_finished=False,
|
||||
stop_ratio=2.00,
|
||||
stop_at_ratio=False,
|
||||
remove_at_ratio=True
|
||||
remove_at_ratio=False
|
||||
):
|
||||
self.torrent_id = torrent_id
|
||||
self.filename = filename
|
||||
@ -144,6 +148,8 @@ class TorrentManager(component.Component):
|
||||
self.alerts.register_handler("tracker_alert", self.on_alert_tracker)
|
||||
self.alerts.register_handler("tracker_warning_alert",
|
||||
self.on_alert_tracker_warning)
|
||||
self.alerts.register_handler("tracker_error_alert",
|
||||
self.on_alert_tracker_error)
|
||||
self.alerts.register_handler("storage_moved_alert",
|
||||
self.on_alert_storage_moved)
|
||||
self.alerts.register_handler("torrent_resumed_alert",
|
||||
@ -156,12 +162,16 @@ class TorrentManager(component.Component):
|
||||
self.plugins = component.get("PluginManager")
|
||||
|
||||
self.signals = component.get("SignalManager")
|
||||
|
||||
|
||||
# Run the old state upgrader before loading state
|
||||
deluge.core.oldstateupgrader.OldStateUpgrader()
|
||||
|
||||
# Try to load the state from file
|
||||
self.load_state()
|
||||
|
||||
# Save the state every 5 minutes
|
||||
self.save_state_timer = gobject.timeout_add(300000, self.save_state)
|
||||
self.save_resume_data_timer = gobject.timeout_add(290000, self.save_resume_data)
|
||||
|
||||
def stop(self):
|
||||
# Save state on shutdown
|
||||
@ -216,7 +226,7 @@ class TorrentManager(component.Component):
|
||||
|
||||
def get_resume_data_from_file(self, torrent_id):
|
||||
"""Returns an entry with the resume data or None"""
|
||||
fastresume = None
|
||||
fastresume = ""
|
||||
try:
|
||||
_file = open(
|
||||
os.path.join(
|
||||
@ -309,7 +319,7 @@ class TorrentManager(component.Component):
|
||||
storage_mode = lt.storage_mode_t(1)
|
||||
|
||||
# Fill in the rest of the add_torrent_params dictionary
|
||||
add_torrent_params["save_path"] = str(options["download_location"])
|
||||
add_torrent_params["save_path"] = options["download_location"].encode("utf8")
|
||||
|
||||
add_torrent_params["storage_mode"] = storage_mode
|
||||
add_torrent_params["paused"] = True
|
||||
@ -492,9 +502,10 @@ class TorrentManager(component.Component):
|
||||
for torrent_state in state.torrents:
|
||||
for t in ordered_state:
|
||||
if torrent_state.queue < t.queue:
|
||||
ordered_state.insert(0, torrent_state)
|
||||
ordered_state.insert(ordered_state.index(t), torrent_state)
|
||||
break
|
||||
ordered_state.append(torrent_state)
|
||||
if torrent_state not in ordered_state:
|
||||
ordered_state.append(torrent_state)
|
||||
|
||||
for torrent_state in ordered_state:
|
||||
try:
|
||||
@ -552,6 +563,11 @@ class TorrentManager(component.Component):
|
||||
# We return True so that the timer thread will continue
|
||||
return True
|
||||
|
||||
def save_resume_data(self):
|
||||
"""Saves resume data for all the torrents"""
|
||||
for torrent in self.torrents.values():
|
||||
torrent.write_fastresume()
|
||||
|
||||
def queue_top(self, torrent_id):
|
||||
"""Queue torrent to top"""
|
||||
if self.torrents[torrent_id].get_queue_position() == 0:
|
||||
@ -698,6 +714,15 @@ class TorrentManager(component.Component):
|
||||
self.torrents[torrent_id].set_tracker_status(tracker_status)
|
||||
except KeyError:
|
||||
log.debug("torrent_id doesn't exist.")
|
||||
|
||||
def on_alert_tracker_error(self, alert):
|
||||
log.debug("on_alert_tracker_error")
|
||||
torrent = self.torrents[str(alert.handle.info_hash())]
|
||||
tracker_status = "%s: %s" % (_("Error"), alert.msg)
|
||||
try:
|
||||
torrent.set_tracker_status(tracker_status)
|
||||
except KeyError:
|
||||
log.debug("torrent_id doesn't exist.")
|
||||
|
||||
def on_alert_storage_moved(self, alert):
|
||||
log.debug("on_alert_storage_moved")
|
||||
|
BIN
deluge/data/GeoIP.dat
Normal file
BIN
deluge/data/GeoIP.dat
Normal file
Binary file not shown.
BIN
deluge/data/pixmaps/deluge.ico
Normal file
BIN
deluge/data/pixmaps/deluge.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
@ -7,7 +7,7 @@
|
||||
#
|
||||
# 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 2 of the License, or (at your option)
|
||||
# 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,
|
||||
|
@ -1,172 +1,152 @@
|
||||
deluge/scripts/wiki_docgen.py
|
||||
deluge/scripts/state_upgrade.py
|
||||
deluge/core/daemon.py
|
||||
deluge/core/signalmanager.py
|
||||
deluge/core/torrent.py
|
||||
deluge/core/core.py
|
||||
deluge/core/__init__.py
|
||||
deluge/core/torrentmanager.py
|
||||
deluge/core/pluginmanager.py
|
||||
deluge/core/autoadd.py
|
||||
deluge/core/signalmanager.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/main.py
|
||||
deluge/component.py
|
||||
deluge/pluginmanagerbase.py
|
||||
deluge/error.py
|
||||
deluge/configmanager.py
|
||||
deluge/log.py
|
||||
deluge/config.py
|
||||
deluge/__init__.py
|
||||
deluge/ui/ui.py
|
||||
deluge/ui/webui/scripts/extract_template_strings.py
|
||||
deluge/ui/webui/scripts/template_strings.py
|
||||
deluge/ui/webui/tests/multicall_notepad.py
|
||||
deluge/ui/webui/tests/test_all.py
|
||||
deluge/ui/webui/json_api.py
|
||||
deluge/ui/webui/pages.py
|
||||
deluge/ui/webui/torrent_add.py
|
||||
deluge/ui/webui/config_tabs_deluge.py
|
||||
deluge/ui/webui/webserver_common.py
|
||||
deluge/ui/webui/config_tabs_webui.py
|
||||
deluge/ui/webui/torrent_move.py
|
||||
deluge/ui/webui/config_forms.py
|
||||
deluge/ui/webui/webui.py
|
||||
deluge/ui/webui/page_decorators.py
|
||||
deluge/ui/webui/components.py
|
||||
deluge/ui/webui/deluge_webserver.py
|
||||
deluge/ui/webui/apache.py
|
||||
deluge/ui/webui/debugerror.py
|
||||
deluge/ui/webui/torrent_options.py
|
||||
deluge/ui/webui/lib/newforms_portable/widgets.py
|
||||
deluge/ui/webui/lib/newforms_portable/django/core/exceptions.py
|
||||
deluge/ui/webui/lib/newforms_portable/django/core/__init__.py
|
||||
deluge/ui/webui/lib/newforms_portable/django/utils/safestring.py
|
||||
deluge/ui/webui/lib/newforms_portable/django/utils/translation.py
|
||||
deluge/ui/webui/lib/newforms_portable/django/utils/functional.py
|
||||
deluge/ui/webui/lib/newforms_portable/django/utils/encoding.py
|
||||
deluge/ui/webui/lib/newforms_portable/django/utils/http.py
|
||||
deluge/ui/webui/lib/newforms_portable/django/utils/__init__.py
|
||||
deluge/ui/webui/lib/newforms_portable/django/utils/datastructures.py
|
||||
deluge/ui/webui/lib/newforms_portable/django/__init__.py
|
||||
deluge/ui/webui/lib/newforms_portable/util.py
|
||||
deluge/ui/webui/lib/newforms_portable/forms.py
|
||||
deluge/ui/webui/lib/newforms_portable/models.py
|
||||
deluge/ui/webui/lib/newforms_portable/fields.py
|
||||
deluge/ui/webui/lib/newforms_portable/__init__.py
|
||||
deluge/ui/webui/lib/webpy022/request.py
|
||||
deluge/ui/webui/lib/webpy022/webapi.py
|
||||
deluge/ui/webui/lib/webpy022/wsgi.py
|
||||
deluge/ui/webui/lib/webpy022/debugerror.py
|
||||
deluge/ui/webui/lib/webpy022/cheetah.py
|
||||
deluge/ui/webui/lib/webpy022/net.py
|
||||
deluge/ui/webui/lib/webpy022/http.py
|
||||
deluge/ui/webui/lib/webpy022/__init__.py
|
||||
deluge/ui/webui/lib/webpy022/wsgiserver/__init__.py
|
||||
deluge/ui/webui/lib/webpy022/httpserver.py
|
||||
deluge/ui/webui/lib/webpy022/form.py
|
||||
deluge/ui/webui/lib/webpy022/db.py
|
||||
deluge/ui/webui/lib/web.py
|
||||
deluge/ui/webui/lib/__init__.py
|
||||
deluge/ui/webui/lib/json.py
|
||||
deluge/ui/webui/lib/static_handler.py
|
||||
deluge/ui/webui/lib/pythonize.py
|
||||
deluge/ui/webui/lib/newforms_plus.py
|
||||
deluge/ui/webui/render.py
|
||||
deluge/ui/webui/web.py
|
||||
deluge/ui/webui/__init__.py
|
||||
deluge/ui/webui/register_menu.py
|
||||
deluge/ui/null/deluge_shell.py
|
||||
deluge/ui/null/__init__.py
|
||||
deluge/ui/signalreceiver.py
|
||||
deluge/ui/client.py
|
||||
deluge/ui/__init__.py
|
||||
deluge/ui/gtkui/connectionmanager.py
|
||||
deluge/ui/gtkui/ipcinterface.py
|
||||
deluge/ui/gtkui/options_tab.py
|
||||
deluge/ui/gtkui/addtorrenturl.py
|
||||
deluge/ui/gtkui/preferences.py
|
||||
deluge/ui/gtkui/addtorrentdialog.py
|
||||
deluge/ui/gtkui/torrentdetails.py
|
||||
deluge/ui/gtkui/peers_tab.py
|
||||
deluge/ui/gtkui/mainwindow.py
|
||||
deluge/ui/gtkui/coreconfig.py
|
||||
deluge/ui/gtkui/menubar.py
|
||||
deluge/ui/gtkui/statistics_tab.py
|
||||
deluge/ui/gtkui/gtkui.py
|
||||
deluge/ui/gtkui/sidebar.py
|
||||
deluge/ui/gtkui/systemtray.py
|
||||
deluge/ui/gtkui/toolbar.py
|
||||
deluge/ui/gtkui/torrentview.py
|
||||
deluge/ui/gtkui/files_tab.py
|
||||
deluge/ui/gtkui/signals.py
|
||||
deluge/ui/gtkui/queuedtorrents.py
|
||||
deluge/ui/gtkui/__init__.py
|
||||
deluge/ui/gtkui/removetorrentdialog.py
|
||||
deluge/ui/gtkui/details_tab.py
|
||||
deluge/ui/gtkui/pluginmanager.py
|
||||
deluge/ui/gtkui/dbusinterface.py
|
||||
deluge/ui/gtkui/listview.py
|
||||
deluge/ui/gtkui/aboutdialog.py
|
||||
deluge/ui/gtkui/statusbar.py
|
||||
deluge/ui/gtkui/edittrackersdialog.py
|
||||
deluge/common.py
|
||||
deluge/plugins/testp/testp/ui.py
|
||||
deluge/plugins/testp/testp/gtkui.py
|
||||
deluge/plugins/testp/testp/core.py
|
||||
deluge/plugins/testp/testp/__init__.py
|
||||
deluge/plugins/testp/setup.py
|
||||
deluge/plugins/testp/build/lib/testp/ui.py
|
||||
deluge/plugins/testp/build/lib/testp/gtkui.py
|
||||
deluge/plugins/testp/build/lib/testp/core.py
|
||||
deluge/plugins/testp/build/lib/testp/__init__.py
|
||||
deluge/plugins/init.py
|
||||
deluge/plugins/label/label/ui.py
|
||||
deluge/plugins/label/label/gtk_sidebar.py
|
||||
deluge/plugins/label/label/test.py
|
||||
deluge/plugins/label/label/webui.py
|
||||
deluge/pluginmanagerbase.py
|
||||
deluge/SimpleXMLRPCServer.py
|
||||
deluge/plugins/label/label/webui_config.py
|
||||
deluge/plugins/label/label/webui.py
|
||||
deluge/plugins/label/label/gtk_sidebar.py
|
||||
deluge/plugins/label/label/gtkui.py
|
||||
deluge/plugins/label/label/test.py
|
||||
deluge/plugins/label/label/ui.py
|
||||
deluge/plugins/label/label/webui_pages.py
|
||||
deluge/plugins/label/label/core.py
|
||||
deluge/plugins/label/label/__init__.py
|
||||
deluge/plugins/label/label/core.py
|
||||
deluge/plugins/label/setup.py
|
||||
deluge/plugins/label/build/lib/label/ui.py
|
||||
deluge/plugins/label/build/lib/label/gtk_sidebar.py
|
||||
deluge/plugins/label/build/lib/label/test.py
|
||||
deluge/plugins/label/build/lib/label/webui.py
|
||||
deluge/plugins/label/build/lib/label/webui_config.py
|
||||
deluge/plugins/label/build/lib/label/gtkui.py
|
||||
deluge/plugins/label/build/lib/label/sidebar.py
|
||||
deluge/plugins/label/build/lib/label/webui_pages.py
|
||||
deluge/plugins/label/build/lib/label/core.py
|
||||
deluge/plugins/label/build/lib/label/__init__.py
|
||||
deluge/plugins/__init__.py
|
||||
deluge/plugins/corepluginbase.py
|
||||
deluge/plugins/init.py
|
||||
deluge/plugins/blocklist/setup.py
|
||||
deluge/plugins/blocklist/blocklist/ui.py
|
||||
deluge/plugins/blocklist/blocklist/peerguardian.py
|
||||
deluge/plugins/blocklist/blocklist/webui.py
|
||||
deluge/plugins/blocklist/blocklist/gtkui.py
|
||||
deluge/plugins/blocklist/blocklist/core.py
|
||||
deluge/plugins/blocklist/blocklist/ui.py
|
||||
deluge/plugins/blocklist/blocklist/text.py
|
||||
deluge/plugins/blocklist/blocklist/peerguardian.py
|
||||
deluge/plugins/blocklist/blocklist/__init__.py
|
||||
deluge/plugins/blocklist/build/lib/blocklist/ui.py
|
||||
deluge/plugins/blocklist/build/lib/blocklist/peerguardian.py
|
||||
deluge/plugins/blocklist/build/lib/blocklist/webui.py
|
||||
deluge/plugins/blocklist/build/lib/blocklist/gtkui.py
|
||||
deluge/plugins/blocklist/build/lib/blocklist/core.py
|
||||
deluge/plugins/blocklist/build/lib/blocklist/text.py
|
||||
deluge/plugins/blocklist/build/lib/blocklist/__init__.py
|
||||
deluge/ui/gtkui/glade/connection_manager.glade
|
||||
deluge/ui/gtkui/glade/preferences_dialog.glade
|
||||
deluge/ui/gtkui/glade/queuedtorrents.glade
|
||||
deluge/ui/gtkui/glade/dgtkpopups.glade
|
||||
deluge/ui/gtkui/glade/remove_torrent_dialog.glade
|
||||
deluge/ui/gtkui/glade/edit_trackers.glade
|
||||
deluge/plugins/blocklist/blocklist/core.py
|
||||
deluge/plugins/__init__.py
|
||||
deluge/configmanager.py
|
||||
deluge/ui/client.py
|
||||
deluge/ui/ui.py
|
||||
deluge/ui/gtkui/listview.py
|
||||
deluge/ui/gtkui/options_tab.py
|
||||
deluge/ui/gtkui/statusbar.py
|
||||
deluge/ui/gtkui/statistics_tab.py
|
||||
deluge/ui/gtkui/addtorrentdialog.py
|
||||
deluge/ui/gtkui/coreconfig.py
|
||||
deluge/ui/gtkui/sidebar.py
|
||||
deluge/ui/gtkui/gtkui.py
|
||||
deluge/ui/gtkui/aboutdialog.py
|
||||
deluge/ui/gtkui/systemtray.py
|
||||
deluge/ui/gtkui/dbusinterface.py
|
||||
deluge/ui/gtkui/files_tab.py
|
||||
deluge/ui/gtkui/menubar.py
|
||||
deluge/ui/gtkui/peers_tab.py
|
||||
deluge/ui/gtkui/toolbar.py
|
||||
deluge/ui/gtkui/ipcinterface.py
|
||||
deluge/ui/gtkui/queuedtorrents.py
|
||||
deluge/ui/gtkui/pluginmanager.py
|
||||
deluge/ui/gtkui/mainwindow.py
|
||||
deluge/ui/gtkui/removetorrentdialog.py
|
||||
deluge/ui/gtkui/signals.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/details_tab.py
|
||||
deluge/ui/signalreceiver.py
|
||||
deluge/ui/__init__.py
|
||||
deluge/ui/webui/components.py
|
||||
deluge/ui/webui/render.py
|
||||
deluge/ui/webui/page_decorators.py
|
||||
deluge/ui/webui/webui.py
|
||||
deluge/ui/webui/debugerror.py
|
||||
deluge/ui/webui/webserver_common.py
|
||||
deluge/ui/webui/config_forms.py
|
||||
deluge/ui/webui/deluge_webserver.py
|
||||
deluge/ui/webui/json_api.py
|
||||
deluge/ui/webui/register_menu.py
|
||||
deluge/ui/webui/config_tabs_deluge.py
|
||||
deluge/ui/webui/lib/webpy022/request.py
|
||||
deluge/ui/webui/lib/webpy022/wsgiserver/__init__.py
|
||||
deluge/ui/webui/lib/webpy022/db.py
|
||||
deluge/ui/webui/lib/webpy022/template.py
|
||||
deluge/ui/webui/lib/webpy022/cheetah.py
|
||||
deluge/ui/webui/lib/webpy022/debugerror.py
|
||||
deluge/ui/webui/lib/webpy022/http.py
|
||||
deluge/ui/webui/lib/webpy022/httpserver.py
|
||||
deluge/ui/webui/lib/webpy022/utils.py
|
||||
deluge/ui/webui/lib/webpy022/__init__.py
|
||||
deluge/ui/webui/lib/webpy022/net.py
|
||||
deluge/ui/webui/lib/webpy022/wsgi.py
|
||||
deluge/ui/webui/lib/webpy022/webapi.py
|
||||
deluge/ui/webui/lib/webpy022/form.py
|
||||
deluge/ui/webui/lib/json.py
|
||||
deluge/ui/webui/lib/newforms_plus.py
|
||||
deluge/ui/webui/lib/pythonize.py
|
||||
deluge/ui/webui/lib/static_handler.py
|
||||
deluge/ui/webui/lib/__init__.py
|
||||
deluge/ui/webui/lib/web.py
|
||||
deluge/ui/webui/lib/newforms_portable/django/core/__init__.py
|
||||
deluge/ui/webui/lib/newforms_portable/django/core/exceptions.py
|
||||
deluge/ui/webui/lib/newforms_portable/django/utils/html.py
|
||||
deluge/ui/webui/lib/newforms_portable/django/utils/http.py
|
||||
deluge/ui/webui/lib/newforms_portable/django/utils/encoding.py
|
||||
deluge/ui/webui/lib/newforms_portable/django/utils/translation.py
|
||||
deluge/ui/webui/lib/newforms_portable/django/utils/safestring.py
|
||||
deluge/ui/webui/lib/newforms_portable/django/utils/__init__.py
|
||||
deluge/ui/webui/lib/newforms_portable/django/utils/datastructures.py
|
||||
deluge/ui/webui/lib/newforms_portable/django/utils/functional.py
|
||||
deluge/ui/webui/lib/newforms_portable/django/__init__.py
|
||||
deluge/ui/webui/lib/newforms_portable/forms.py
|
||||
deluge/ui/webui/lib/newforms_portable/models.py
|
||||
deluge/ui/webui/lib/newforms_portable/widgets.py
|
||||
deluge/ui/webui/lib/newforms_portable/fields.py
|
||||
deluge/ui/webui/lib/newforms_portable/__init__.py
|
||||
deluge/ui/webui/lib/newforms_portable/util.py
|
||||
deluge/ui/webui/utils.py
|
||||
deluge/ui/webui/pages.py
|
||||
deluge/ui/webui/__init__.py
|
||||
deluge/ui/webui/tests/multicall_notepad.py
|
||||
deluge/ui/webui/tests/test_all.py
|
||||
deluge/ui/webui/apache.py
|
||||
deluge/ui/webui/web.py
|
||||
deluge/ui/webui/torrent_move.py
|
||||
deluge/ui/webui/config_tabs_webui.py
|
||||
deluge/ui/webui/torrent_options.py
|
||||
deluge/ui/webui/torrent_add.py
|
||||
deluge/ui/webui/scripts/template_strings.py
|
||||
deluge/ui/webui/scripts/extract_template_strings.py
|
||||
deluge/ui/null/deluge_shell.py
|
||||
deluge/ui/null/__init__.py
|
||||
deluge/common.py
|
||||
deluge/component.py
|
||||
deluge/main.py
|
||||
deluge/error.py
|
||||
deluge/__init__.py
|
||||
deluge/log.py
|
||||
deluge/xmlrpclib.py
|
||||
deluge/scripts/wiki_docgen.py
|
||||
deluge/scripts/state_upgrade.py
|
||||
deluge/plugins/blocklist/blocklist/data/blocklist_pref.glade
|
||||
deluge/ui/gtkui/glade/add_torrent_dialog.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/dgtkpopups.glade
|
||||
deluge/ui/gtkui/glade/tray_menu.glade
|
||||
deluge/ui/gtkui/glade/file_tab_menu.glade
|
||||
deluge/ui/gtkui/glade/main_window.glade
|
||||
deluge/plugins/blocklist/blocklist/data/blocklist_pref.glade
|
||||
deluge/plugins/blocklist/build/lib/blocklist/data/blocklist_pref.glade
|
||||
|
2758
deluge/i18n/ar.po
Normal file
2758
deluge/i18n/ar.po
Normal file
File diff suppressed because it is too large
Load Diff
2816
deluge/i18n/ast.po
Normal file
2816
deluge/i18n/ast.po
Normal file
File diff suppressed because it is too large
Load Diff
2330
deluge/i18n/bg.po
Normal file
2330
deluge/i18n/bg.po
Normal file
File diff suppressed because it is too large
Load Diff
2745
deluge/i18n/bs.po
Normal file
2745
deluge/i18n/bs.po
Normal file
File diff suppressed because it is too large
Load Diff
2776
deluge/i18n/ca.po
Normal file
2776
deluge/i18n/ca.po
Normal file
File diff suppressed because it is too large
Load Diff
2761
deluge/i18n/cs.po
Normal file
2761
deluge/i18n/cs.po
Normal file
File diff suppressed because it is too large
Load Diff
2751
deluge/i18n/cy.po
Normal file
2751
deluge/i18n/cy.po
Normal file
File diff suppressed because it is too large
Load Diff
2769
deluge/i18n/da.po
Normal file
2769
deluge/i18n/da.po
Normal file
File diff suppressed because it is too large
Load Diff
2378
deluge/i18n/de.po
Normal file
2378
deluge/i18n/de.po
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
2769
deluge/i18n/el.po
Normal file
2769
deluge/i18n/el.po
Normal file
File diff suppressed because it is too large
Load Diff
2359
deluge/i18n/en_AU.po
Normal file
2359
deluge/i18n/en_AU.po
Normal file
File diff suppressed because it is too large
Load Diff
2761
deluge/i18n/en_CA.po
Normal file
2761
deluge/i18n/en_CA.po
Normal file
File diff suppressed because it is too large
Load Diff
2761
deluge/i18n/en_GB.po
Normal file
2761
deluge/i18n/en_GB.po
Normal file
File diff suppressed because it is too large
Load Diff
2747
deluge/i18n/eo.po
Normal file
2747
deluge/i18n/eo.po
Normal file
File diff suppressed because it is too large
Load Diff
2376
deluge/i18n/es.po
Normal file
2376
deluge/i18n/es.po
Normal file
File diff suppressed because it is too large
Load Diff
2767
deluge/i18n/et.po
Normal file
2767
deluge/i18n/et.po
Normal file
File diff suppressed because it is too large
Load Diff
2745
deluge/i18n/eu.po
Normal file
2745
deluge/i18n/eu.po
Normal file
File diff suppressed because it is too large
Load Diff
2751
deluge/i18n/fa.po
Normal file
2751
deluge/i18n/fa.po
Normal file
File diff suppressed because it is too large
Load Diff
2783
deluge/i18n/fi.po
Normal file
2783
deluge/i18n/fi.po
Normal file
File diff suppressed because it is too large
Load Diff
2390
deluge/i18n/fr.po
Normal file
2390
deluge/i18n/fr.po
Normal file
File diff suppressed because it is too large
Load Diff
2745
deluge/i18n/fy.po
Normal file
2745
deluge/i18n/fy.po
Normal file
File diff suppressed because it is too large
Load Diff
2759
deluge/i18n/gl.po
Normal file
2759
deluge/i18n/gl.po
Normal file
File diff suppressed because it is too large
Load Diff
2347
deluge/i18n/he.po
Normal file
2347
deluge/i18n/he.po
Normal file
File diff suppressed because it is too large
Load Diff
2745
deluge/i18n/hi.po
Normal file
2745
deluge/i18n/hi.po
Normal file
File diff suppressed because it is too large
Load Diff
2762
deluge/i18n/hr.po
Normal file
2762
deluge/i18n/hr.po
Normal file
File diff suppressed because it is too large
Load Diff
2362
deluge/i18n/hu.po
Normal file
2362
deluge/i18n/hu.po
Normal file
File diff suppressed because it is too large
Load Diff
2745
deluge/i18n/id.po
Normal file
2745
deluge/i18n/id.po
Normal file
File diff suppressed because it is too large
Load Diff
2745
deluge/i18n/is.po
Normal file
2745
deluge/i18n/is.po
Normal file
File diff suppressed because it is too large
Load Diff
2376
deluge/i18n/it.po
Normal file
2376
deluge/i18n/it.po
Normal file
File diff suppressed because it is too large
Load Diff
2745
deluge/i18n/iu.po
Normal file
2745
deluge/i18n/iu.po
Normal file
File diff suppressed because it is too large
Load Diff
2756
deluge/i18n/ja.po
Normal file
2756
deluge/i18n/ja.po
Normal file
File diff suppressed because it is too large
Load Diff
2769
deluge/i18n/ka.po
Normal file
2769
deluge/i18n/ka.po
Normal file
File diff suppressed because it is too large
Load Diff
2745
deluge/i18n/kn.po
Normal file
2745
deluge/i18n/kn.po
Normal file
File diff suppressed because it is too large
Load Diff
3571
deluge/i18n/ko.po
Normal file
3571
deluge/i18n/ko.po
Normal file
File diff suppressed because it is too large
Load Diff
2745
deluge/i18n/ku.po
Normal file
2745
deluge/i18n/ku.po
Normal file
File diff suppressed because it is too large
Load Diff
2745
deluge/i18n/la.po
Normal file
2745
deluge/i18n/la.po
Normal file
File diff suppressed because it is too large
Load Diff
2364
deluge/i18n/lt.po
Normal file
2364
deluge/i18n/lt.po
Normal file
File diff suppressed because it is too large
Load Diff
2766
deluge/i18n/lv.po
Normal file
2766
deluge/i18n/lv.po
Normal file
File diff suppressed because it is too large
Load Diff
2757
deluge/i18n/mk.po
Normal file
2757
deluge/i18n/mk.po
Normal file
File diff suppressed because it is too large
Load Diff
2764
deluge/i18n/ms.po
Normal file
2764
deluge/i18n/ms.po
Normal file
File diff suppressed because it is too large
Load Diff
2811
deluge/i18n/nb.po
Normal file
2811
deluge/i18n/nb.po
Normal file
File diff suppressed because it is too large
Load Diff
2745
deluge/i18n/nds.po
Normal file
2745
deluge/i18n/nds.po
Normal file
File diff suppressed because it is too large
Load Diff
2374
deluge/i18n/nl.po
Normal file
2374
deluge/i18n/nl.po
Normal file
File diff suppressed because it is too large
Load Diff
2372
deluge/i18n/pl.po
Normal file
2372
deluge/i18n/pl.po
Normal file
File diff suppressed because it is too large
Load Diff
2745
deluge/i18n/pms.po
Normal file
2745
deluge/i18n/pms.po
Normal file
File diff suppressed because it is too large
Load Diff
2367
deluge/i18n/pt.po
Normal file
2367
deluge/i18n/pt.po
Normal file
File diff suppressed because it is too large
Load Diff
2373
deluge/i18n/pt_BR.po
Normal file
2373
deluge/i18n/pt_BR.po
Normal file
File diff suppressed because it is too large
Load Diff
2764
deluge/i18n/ro.po
Normal file
2764
deluge/i18n/ro.po
Normal file
File diff suppressed because it is too large
Load Diff
2375
deluge/i18n/ru.po
Normal file
2375
deluge/i18n/ru.po
Normal file
File diff suppressed because it is too large
Load Diff
2745
deluge/i18n/si.po
Normal file
2745
deluge/i18n/si.po
Normal file
File diff suppressed because it is too large
Load Diff
3115
deluge/i18n/sk.po
Normal file
3115
deluge/i18n/sk.po
Normal file
File diff suppressed because it is too large
Load Diff
2759
deluge/i18n/sl.po
Normal file
2759
deluge/i18n/sl.po
Normal file
File diff suppressed because it is too large
Load Diff
2758
deluge/i18n/sr.po
Normal file
2758
deluge/i18n/sr.po
Normal file
File diff suppressed because it is too large
Load Diff
2364
deluge/i18n/sv.po
Normal file
2364
deluge/i18n/sv.po
Normal file
File diff suppressed because it is too large
Load Diff
2745
deluge/i18n/ta.po
Normal file
2745
deluge/i18n/ta.po
Normal file
File diff suppressed because it is too large
Load Diff
2745
deluge/i18n/th.po
Normal file
2745
deluge/i18n/th.po
Normal file
File diff suppressed because it is too large
Load Diff
2745
deluge/i18n/tl.po
Normal file
2745
deluge/i18n/tl.po
Normal file
File diff suppressed because it is too large
Load Diff
2745
deluge/i18n/tlh.po
Normal file
2745
deluge/i18n/tlh.po
Normal file
File diff suppressed because it is too large
Load Diff
2356
deluge/i18n/tr.po
Normal file
2356
deluge/i18n/tr.po
Normal file
File diff suppressed because it is too large
Load Diff
2765
deluge/i18n/uk.po
Normal file
2765
deluge/i18n/uk.po
Normal file
File diff suppressed because it is too large
Load Diff
2753
deluge/i18n/vi.po
Normal file
2753
deluge/i18n/vi.po
Normal file
File diff suppressed because it is too large
Load Diff
2335
deluge/i18n/zh_CN.po
Normal file
2335
deluge/i18n/zh_CN.po
Normal file
File diff suppressed because it is too large
Load Diff
3217
deluge/i18n/zh_TW.po
Normal file
3217
deluge/i18n/zh_TW.po
Normal file
File diff suppressed because it is too large
Load Diff
@ -7,7 +7,7 @@
|
||||
#
|
||||
# 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 2 of the License, or (at your option)
|
||||
# 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,
|
||||
|
@ -7,7 +7,7 @@
|
||||
#
|
||||
# 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 2 of the License, or (at your option)
|
||||
# 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,
|
||||
@ -61,10 +61,19 @@ def start_ui():
|
||||
|
||||
if options.config:
|
||||
if not os.path.exists(options.config):
|
||||
os.makedirs(options.config)
|
||||
# Try to create the config folder if it doesn't exist
|
||||
try:
|
||||
os.makedirs(options.config)
|
||||
except Exception, e:
|
||||
pass
|
||||
else:
|
||||
if not os.path.exists(deluge.common.get_default_config_dir()):
|
||||
os.makedirs(deluge.common.get_default_config_dir())
|
||||
|
||||
# Always log to a file in Windows
|
||||
if deluge.common.windows_check() and not options.logfile:
|
||||
options.logfile = "deluge.log"
|
||||
|
||||
if options.logfile:
|
||||
if options.config:
|
||||
logfile = os.path.join(options.config, options.logfile)
|
||||
@ -108,6 +117,17 @@ def start_daemon():
|
||||
# Get the options and args from the OptionParser
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
if options.config:
|
||||
if not os.path.exists(options.config):
|
||||
# Try to create the config folder if it doesn't exist
|
||||
try:
|
||||
os.makedirs(options.config)
|
||||
except Exception, e:
|
||||
pass
|
||||
else:
|
||||
if not os.path.exists(deluge.common.get_default_config_dir()):
|
||||
os.makedirs(deluge.common.get_default_config_dir())
|
||||
|
||||
# If the donot daemonize is set, then we just skip the forking
|
||||
if not options.donot and not deluge.common.windows_check():
|
||||
if os.fork() == 0:
|
||||
@ -122,14 +142,29 @@ def start_daemon():
|
||||
config_dir = deluge.common.get_default_config_dir()
|
||||
logfile = os.path.join(config_dir, "deluged.log")
|
||||
|
||||
sys.stdout = open(logfile, "w")
|
||||
sys.stdout = open(logfile, "wb")
|
||||
sys.stderr = sys.stdout
|
||||
sys.stdin = None
|
||||
else:
|
||||
os._exit(0)
|
||||
else:
|
||||
os._exit(0)
|
||||
|
||||
|
||||
# Windows check, we log to the config folder by default
|
||||
if not options.donot and deluge.common.windows_check():
|
||||
if options.logfile:
|
||||
logfile = options.logfile
|
||||
else:
|
||||
if options.config:
|
||||
logfile = os.path.join(options.config, "deluged.log")
|
||||
else:
|
||||
config_dir = deluge.common.get_default_config_dir()
|
||||
logfile = os.path.join(config_dir, "deluged.log")
|
||||
|
||||
sys.stdout = open(logfile, "wb")
|
||||
sys.stderr = sys.stdout
|
||||
sys.stdin = None
|
||||
|
||||
from deluge.core.daemon import Daemon
|
||||
Daemon(options, args)
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
#
|
||||
# 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 2 of the License, or (at your option)
|
||||
# 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,
|
||||
|
@ -3,13 +3,13 @@
|
||||
#
|
||||
# Copyright (C) 2007 Andrew Resch ('andar') <andrewresch@gmail.com>
|
||||
# Copyright (C) 2008 Mark Stahler ('kramed') <markstahler@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 2 of the License, or (at your option)
|
||||
# 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,
|
||||
|
@ -7,7 +7,7 @@
|
||||
#
|
||||
# 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 2 of the License, or (at your option)
|
||||
# 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,
|
||||
@ -52,7 +52,11 @@ DEFAULT_PREFS = {
|
||||
"check_after_days": 2,
|
||||
"listtype": "gzmule",
|
||||
"timeout": 180,
|
||||
"try_times": 3
|
||||
"try_times": 3,
|
||||
"file_type": "",
|
||||
"file_url": "",
|
||||
"file_date": "",
|
||||
"file_size": 0,
|
||||
}
|
||||
|
||||
FORMATS = {
|
||||
@ -93,14 +97,14 @@ class Core(CorePluginBase):
|
||||
pass
|
||||
|
||||
## Exported RPC methods ###
|
||||
def export_download(self):
|
||||
def export_download(self, _import=False):
|
||||
"""Download the blocklist specified in the config as url"""
|
||||
self.download_blocklist()
|
||||
self.download_blocklist(_import)
|
||||
|
||||
def export_import(self, download=False):
|
||||
def export_import(self, download=False, force=False):
|
||||
"""Import the blocklist from the blocklist.cache, if load is True, then
|
||||
it will download the blocklist file if needed."""
|
||||
threading.Thread(target=self.import_blocklist, kwargs={"download": download}).start()
|
||||
threading.Thread(target=self.import_blocklist, kwargs={"download": download, "force": force}).start()
|
||||
|
||||
def export_get_config(self):
|
||||
"""Returns the config dictionary"""
|
||||
@ -123,6 +127,10 @@ class Core(CorePluginBase):
|
||||
|
||||
status["num_blocked"] = self.num_blocked
|
||||
status["file_progress"] = self.file_progress
|
||||
status["file_type"] = self.config["file_type"]
|
||||
status["file_url"] = self.config["file_url"]
|
||||
status["file_size"] = self.config["file_size"]
|
||||
status["file_date"] = self.config["file_date"]
|
||||
|
||||
return status
|
||||
|
||||
@ -134,13 +142,13 @@ class Core(CorePluginBase):
|
||||
if load:
|
||||
self.export_import()
|
||||
|
||||
def import_blocklist(self, download=False):
|
||||
def import_blocklist(self, download=False, force=False):
|
||||
"""Imports the downloaded blocklist into the session"""
|
||||
if self.is_downloading:
|
||||
return
|
||||
|
||||
if download:
|
||||
if self.need_new_blocklist():
|
||||
if force or self.need_new_blocklist():
|
||||
self.download_blocklist(True)
|
||||
return
|
||||
|
||||
@ -191,7 +199,10 @@ class Core(CorePluginBase):
|
||||
return False
|
||||
|
||||
def on_retrieve_data(count, block_size, total_blocks):
|
||||
self.file_progress = float(count * block_size) / total_blocks
|
||||
fp = float(count * block_size) / total_blocks
|
||||
if fp > 1.0:
|
||||
fp = 1.0
|
||||
self.file_progress = fp
|
||||
|
||||
import socket
|
||||
socket.setdefaulttimeout(self.config["timeout"])
|
||||
@ -208,6 +219,13 @@ class Core(CorePluginBase):
|
||||
continue
|
||||
else:
|
||||
log.debug("Blocklist successfully downloaded..")
|
||||
# Set information about the file
|
||||
self.config["file_type"] = self.config["listtype"]
|
||||
self.config["file_url"] = self.config["url"]
|
||||
list_stats = os.stat(deluge.configmanager.get_config_dir("blocklist.cache"))
|
||||
self.config["file_date"] = datetime.datetime.fromtimestamp(list_stats.st_mtime).ctime()
|
||||
self.config["file_size"] = list_size = list_stats.st_size
|
||||
|
||||
gobject.idle_add(_call_callback, callback, load)
|
||||
return
|
||||
|
||||
@ -227,7 +245,7 @@ class Core(CorePluginBase):
|
||||
if list_size == 0:
|
||||
return True
|
||||
|
||||
if current_time >= (list_time + datetime.timedelta(self.config["check_after_days"] * 24 * 60 * 60)):
|
||||
if current_time >= (list_time + datetime.timedelta(days=self.config["check_after_days"])):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
|
||||
<!--Generated with glade3 3.4.5 on Fri Jul 18 11:06:25 2008 -->
|
||||
<!--Generated with glade3 3.4.5 on Tue Jul 29 00:52:51 2008 -->
|
||||
<glade-interface>
|
||||
<widget class="GtkWindow" id="window1">
|
||||
<child>
|
||||
@ -75,8 +75,6 @@
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
@ -97,7 +95,6 @@
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
@ -117,47 +114,19 @@
|
||||
<child>
|
||||
<widget class="GtkTable" id="table1">
|
||||
<property name="visible">True</property>
|
||||
<property name="n_rows">3</property>
|
||||
<property name="n_rows">1</property>
|
||||
<property name="n_columns">3</property>
|
||||
<property name="column_spacing">5</property>
|
||||
<property name="row_spacing">5</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label4">
|
||||
<widget class="GtkLabel" id="label8">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">Check for new list every:</property>
|
||||
<property name="label" translatable="yes">Days</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label5">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">Timeout to download new list:</property>
|
||||
<property name="use_markup">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label6">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">Max attempts to download list:</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
@ -176,59 +145,12 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkSpinButton" id="spin_timeout">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="adjustment">180 0 9999 1 10 10</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkSpinButton" id="spin_attempts">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="adjustment">3 1 100 1 10 10</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label8">
|
||||
<widget class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">Days</property>
|
||||
<property name="label" translatable="yes">Check for new list every:</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label9">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">Seconds</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
@ -270,7 +192,6 @@
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
@ -283,92 +204,46 @@
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment3">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="xscale">0</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox3">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<widget class="GtkHButtonBox" id="hbuttonbox1">
|
||||
<widget class="GtkButton" id="button_check_download">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">GTK_BUTTONBOX_SPREAD</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip" translatable="yes">Download the blocklist file if necessary and import the file.</property>
|
||||
<property name="response_id">0</property>
|
||||
<signal name="clicked" handler="on_button_check_download_clicked"/>
|
||||
<child>
|
||||
<widget class="GtkButton" id="button_download">
|
||||
<widget class="GtkHBox" id="hbox3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="response_id">0</property>
|
||||
<signal name="clicked" handler="on_button_download_clicked"/>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox3">
|
||||
<widget class="GtkImage" id="image_download">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image_download">
|
||||
<property name="visible">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label12">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Download List</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<property name="stock">gtk-missing-image</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label12">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Check Download and Import</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkButton" id="button_import">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="response_id">0</property>
|
||||
<signal name="clicked" handler="on_button_import_clicked"/>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox4">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image_import">
|
||||
<property name="visible">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label7">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Import List</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
@ -376,6 +251,48 @@
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkButton" id="button_force_download">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip" translatable="yes">Download a new blocklist file and import it.</property>
|
||||
<property name="response_id">0</property>
|
||||
<signal name="clicked" handler="on_button_force_download_clicked"/>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox4">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image_import">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-missing-image</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label7">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Force Download and Import</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
@ -393,11 +310,154 @@
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame4">
|
||||
<property name="visible">True</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="shadow_type">GTK_SHADOW_NONE</property>
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment4">
|
||||
<property name="visible">True</property>
|
||||
<property name="top_padding">5</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox4">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<widget class="GtkProgressBar" id="progressbar">
|
||||
<property name="visible">True</property>
|
||||
<property name="text" translatable="yes"></property>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkTable" id="table_info">
|
||||
<property name="visible">True</property>
|
||||
<property name="n_rows">4</property>
|
||||
<property name="n_columns">2</property>
|
||||
<property name="column_spacing">5</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label_url">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label_type">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label_modified">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label_filesize">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label17">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">URL:</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label16">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">Type:</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label15">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">Date:</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label14">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">File Size:</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label13">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Info</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="type">label_item</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -7,7 +7,7 @@
|
||||
#
|
||||
# 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 2 of the License, or (at your option)
|
||||
# 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,
|
||||
@ -36,6 +36,7 @@ import gtk
|
||||
from deluge.log import LOG as log
|
||||
from deluge.ui.client import aclient as client
|
||||
import deluge.component as component
|
||||
import deluge.common
|
||||
|
||||
import ui
|
||||
from core import FORMATS
|
||||
@ -75,13 +76,46 @@ class GtkUI(ui.UI):
|
||||
def update(self):
|
||||
def _on_get_status(status):
|
||||
if status["state"] == "Downloading":
|
||||
self.table_info.hide()
|
||||
self.glade.get_widget("button_check_download").set_sensitive(False)
|
||||
self.glade.get_widget("button_force_download").set_sensitive(False)
|
||||
|
||||
self.status_item.set_text(
|
||||
"Downloading %.2f%%" % (status["file_progress"] * 100))
|
||||
self.progress_bar.set_text("Downloading %.2f%%" % (status["file_progress"] * 100))
|
||||
self.progress_bar.set_fraction(status["file_progress"])
|
||||
self.progress_bar.show()
|
||||
|
||||
elif status["state"] == "Importing":
|
||||
self.table_info.hide()
|
||||
self.glade.get_widget("button_check_download").set_sensitive(False)
|
||||
self.glade.get_widget("button_force_download").set_sensitive(False)
|
||||
|
||||
self.status_item.set_text(
|
||||
"Importing " + str(status["num_blocked"]))
|
||||
self.progress_bar.set_text("Importing %s" % (status["num_blocked"]))
|
||||
self.progress_bar.pulse()
|
||||
self.progress_bar.show()
|
||||
|
||||
elif status["state"] == "Idle":
|
||||
self.progress_bar.hide()
|
||||
self.glade.get_widget("button_check_download").set_sensitive(True)
|
||||
self.glade.get_widget("button_force_download").set_sensitive(True)
|
||||
|
||||
self.table_info.show()
|
||||
self.status_item.set_text(str(status["num_blocked"]))
|
||||
self.glade.get_widget("label_filesize").set_text(
|
||||
deluge.common.fsize(status["file_size"]))
|
||||
self.glade.get_widget("label_modified").set_text(
|
||||
str(status["file_date"]))
|
||||
try:
|
||||
self.glade.get_widget("label_type").set_text(
|
||||
FORMATS[status["file_type"]][0])
|
||||
except KeyError:
|
||||
self.glade.get_widget("label_type").set_text("")
|
||||
|
||||
self.glade.get_widget("label_url").set_text(
|
||||
status["file_url"])
|
||||
|
||||
client.blocklist_get_status(_on_get_status)
|
||||
|
||||
@ -97,13 +131,7 @@ class GtkUI(ui.UI):
|
||||
|
||||
self.glade.get_widget("spin_check_days").set_value(
|
||||
config["check_after_days"])
|
||||
|
||||
self.glade.get_widget("spin_timeout").set_value(
|
||||
config["timeout"])
|
||||
|
||||
self.glade.get_widget("spin_attempts").set_value(
|
||||
config["try_times"])
|
||||
|
||||
|
||||
self.glade.get_widget("chk_import_on_start").set_active(
|
||||
config["load_on_start"])
|
||||
|
||||
@ -115,16 +143,14 @@ class GtkUI(ui.UI):
|
||||
get_model()[self.glade.get_widget("combobox_types").get_active()][1]
|
||||
config["url"] = self.glade.get_widget("entry_url").get_text()
|
||||
config["check_after_days"] = self.glade.get_widget("spin_check_days").get_value_as_int()
|
||||
config["timeout"] = self.glade.get_widget("spin_timeout").get_value_as_int()
|
||||
config["try_times"] = self.glade.get_widget("spin_attempts").get_value_as_int()
|
||||
config["load_on_start"] = self.glade.get_widget("chk_import_on_start").get_active()
|
||||
client.blocklist_set_config(None, config)
|
||||
|
||||
def _on_button_download_clicked(self, widget):
|
||||
client.blocklist_download(None)
|
||||
def _on_button_check_download_clicked(self, widget):
|
||||
client.blocklist_import(None, True, False)
|
||||
|
||||
def _on_button_import_clicked(self, widget):
|
||||
client.blocklist_import(None)
|
||||
def _on_button_force_download_clicked(self, widget):
|
||||
client.blocklist_import(None, True, True)
|
||||
|
||||
def _on_status_item_clicked(self, widget, event):
|
||||
component.get("Preferences").show("Blocklist")
|
||||
@ -133,10 +159,17 @@ class GtkUI(ui.UI):
|
||||
"""Initializes the preferences page and adds it to the preferences dialog"""
|
||||
# Load the preferences page
|
||||
self.glade = gtk.glade.XML(self.get_resource("blocklist_pref.glade"))
|
||||
|
||||
|
||||
self.progress_bar = self.glade.get_widget("progressbar")
|
||||
self.table_info = self.glade.get_widget("table_info")
|
||||
|
||||
# Hide the progress bar initially
|
||||
self.progress_bar.hide()
|
||||
self.table_info.show()
|
||||
|
||||
self.glade.signal_autoconnect({
|
||||
"on_button_download_clicked": self._on_button_download_clicked,
|
||||
"on_button_import_clicked": self._on_button_import_clicked
|
||||
"on_button_check_download_clicked": self._on_button_check_download_clicked,
|
||||
"on_button_force_download_clicked": self._on_button_force_download_clicked
|
||||
})
|
||||
|
||||
# Setup types combobox
|
||||
|
@ -113,7 +113,7 @@ class PGZip(TextBase):
|
||||
def next(self):
|
||||
try:
|
||||
ret = self.reader.next()
|
||||
if ret == False:
|
||||
if not ret:
|
||||
# This bit is repeated below and could be moved into a
|
||||
# new procedure. However I'm not clear on how this
|
||||
# would effect tail recursion, so it remains
|
||||
|
@ -7,7 +7,7 @@
|
||||
#
|
||||
# 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 2 of the License, or (at your option)
|
||||
# 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,
|
||||
|
@ -8,7 +8,7 @@
|
||||
#
|
||||
# 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 2 of the License, or (at your option)
|
||||
# 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,
|
||||
|
@ -6,7 +6,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# the Free Software Foundation; either version 3, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
|
@ -7,7 +7,7 @@
|
||||
#
|
||||
# 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 2 of the License, or (at your option)
|
||||
# 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,
|
||||
|
@ -7,7 +7,7 @@
|
||||
#
|
||||
# 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 2 of the License, or (at your option)
|
||||
# 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,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user