This changeset makes gPodder's codebase convertable
to Python 3 using the "2to3" utility. Right now, only
the CLI module (bin/gpo) has been tested.
See the README file for instructions and remarks.
This is closely modelled around the YouTube module.
In the future, we should probably remodel this to
use the extensions/hooks/plugins mechanism, and make
the interface for video services more generic.
For YouTube and Soundcloud feeds (among others), we try
to avoid renaming downloads even for HTTP redirects,
because the initial filename that we have is usually okay.
In some cases, proper filenames hide in the final URL
of a redirect (or redirect chain) of a web server. An
example of this is the "Science Talk" podcast.
Only show a notification for finished or failed downloads
once, both on the Desktop version and on Maemo 5 by adding
a special function to DownloadTask to keep track whether or
not the notification has already been shown previously.
This fixes issues where previously downloaded
episodes would not get their extension fixed,
because the mime type does not change, although
the filename is still wrong.
When a download limit is enabled, and downloads
are queued, right-clicking on a download now
allows to forcefully start the download task
without having to wait for the episode to hit
the queue.
Translatable format strings with more than one
positional argument should have their value
described by using a dictionary so that the
translators can reorder inserted variables.
The following command has been used:
grep -r '2005-2009 Thomas Perl and the gPodder Team' * | cut -d: -f1 |
xargs sed -i -e 's/2005-2009 Thomas Perl and the gPodder Team/2005-2010
Thomas Perl and the gPodder Team/g'
Users can now set their preferred YouTube fmt_id
for downloads of YouTube videos. The default has
been changed to 18, because that's a known-good
video format that should work on most machines.
When the "download limit" value is changed,
automatically start new threads if it makes
sense (when there are still tasks waiting
to be added and the amount of current threads
is less than the download limit).
Also let each thread check if it may continue
to accept tasks instead of using "cancelling".
This way, the number of threads more often is
in line with the download limit setting.
Thanks to "ad" for reporting this issue.
The Maemo 4 UI of gPodder now has a new and proper
shownotes dialog with a menu that allows better
control of all actions on the episode download.
The download handling code has been refined and
some minor bugs have been fixed (cancel after pause).
The current GTK+ ("Desktop") UI for the Shownotes
dialog has not been re-designed yet, but just edited
to work with the new interface structure. Later :)
Some servers, like the one serving "Bloomberg" episodes
do not send a "Content-length" header in their HTTP
response, which made gPodder fail to download files.
This patch fixes the issue and also re-calculates the
file size after the download has completed, so the real
file size appears after the file has been downloaded.
Remove the GTK+ dependency in gpodder.youtube by making the
only function that is in there fake a opml.Importer-like object,
so we can use the model from gpodder.gtkui.opml to display the
results instead of generating the model inside gpodder.youtube.
Add some additional code and checks to make the use
of password-protected podcasts more stable and easier
to use. Thanks to Dan Ramos for the bug report.
Some modules are still left that need some more refactoring.
These are: gui.py and libpodcasts.py.
All other modules now have their dependency on gPodderLib or
the config object (almost all really just depend on the config
object) injected instead of accessing a global variable.
This might break a lot, but it makes feed parsing and
updating so much cleaner, and also helps with error
reporting, because exceptions are bubbled up to the UI.
Removed:
* Changing feed URL (this introduces too many problems)
* Support for FTP proxy servers (who uses FTP for podcasts?)
If the server specifies the content length of
what we are going to download, only read at most
that amount of data from the server and then
close the connection to avoid eternal hanging.
Using wireshark you can see that gPodder gets stuck after it receives
the first 302 from the server. Wget on the other hand handles it
perfectly (there are 2 to 3, 302 responses in total).
Adding a Range header to the request will make the download fail,
this patch fixes this bug by providing our own version of
redirect_internal.
Do not install gettext globally, but have a gettext
function in the gpodder module and import it from all
dependent modules.
Remove the --local command line option and instead
automatically detect if the gpodder script is called
from a source folder (determined by the existence of
"src" and "data" in the parent folder and by the fact
that prefix does not start with '/usr').
Clean up setup.py and use metadata from the module.
When downloading files, make sure that the server sends
the correct content-range response header for the request.
If not, truncate the file and start from the beginning.
This allows our UI to directly monitor the status
of all running DownloadTask objects by checking the
truth value of the status_changed attribute and
updating the UI for all relevant episodes.
In the DownloadStatusManager, use symbolic names
from the DownloadTask class, so as to not duplicate
code and to always pick the right icon, even when
the status IDs in the DownloadTask change.
We want to get rid of gPodderLib in the end, so move
the utility function out of gPodderLib and correct
its uses accordingly. Also add a unittest for it.
This is still a work-in-progress, and many things
have been broken by introducing it, but the new
code is easier to understand and maintain, and
should also prove performance-enhancing on Maemo.
Last but not least, when it's done, it will fix
these bugs: 242, 361 (http://bugs.gpodder.org)
Only update the filename of an episode as a result of
changed mimetypes when the changed mimetype also changes
the file extension.
Also fix a small bug that omitted the extension when
searching for a "proper" filename and a bug that happens
when the filename extension is missing from a file.
Thanks to Ville-Pekka Vainio for reporting this bug.
This patch finishes off the proper filename support, so
remove the "experimental_file_naming" configuration option.
Also add download resuming based on this new code. The
resuming function currently works like this: All active
and queued downloads will not be deleted when gPodder is
closed, and gPodder will ask the user if she wants to
continue downloading at next startup (if not, the partial
files are deleted).
These two changes are very suspicious of breaking some weird
feeds (for proper filenames) and servers (for resuming).
Report any bugs that you encounter. Enjoy! :)
Remove all unnecessary full episode list reloads and
reduce the number of UI updates while downloading to
make the UI feel (and be) more responsive and also
not need to reset the scroll position because of a
full channel/episode list reload. That's good stuff!
Links to YouTube profiles are converted to the corresponding
RSS feeds (http://www.youtube.com/rssls), which aren't available
with the standard feed discovery.
Normal links to YouTube enclosures (*.swf) are now on-the-fly
replaced with links to high quality MP4 videos. Apparently
links to real enclosures are not permanent, so they can't be
saved in the database.
The FancyURLopener by default ignores HTTP errors and
downloads the HTTP error page without letting the calling
code know. We override the method and report the error
in our subclass, so we can provide feedback to the user
in the logfile and in a message dialog.
This bug has been reported by Markus Golser
When downloading an episode, and the urllib progress
callback reports a totalSize of "-1", gPodder would show
large negative values for the download progress. This is
fixed by using the size reported by the feed in this case
and also adding some sanity checks (progress between the
values 0 and 100) and spitting out warnings in case of
problems.
This bug has been reported by Heinz Erhard
While downloading episodes, show the total download speed
in the title bar in addition to the total progress percentage.
Only update the progress at most once per second, to avoid
updating the GUI too often (progress notifications).
Reported by Will <war59312@gmail.com> in gPodder bug 139
Merge "Allows user command execution after certain events" from Paul Rudkin
* src/gpodder/config.py: Add two new configuration options:
cmd_all_downloads_complete and cmd_download_complete
* src/gpodder/download.py: Call the user-specific command when a
download finishes (if configured)
* src/gpodder/gui.py: If all downloads have been completed, execute
the user-specific command (if configured)
* src/gpodder/libgpodder.py: Add ext_command_thread function that
handles calling an external command
(Closes: http://bugs.gpodder.org/show_bug.cgi?id=4)
git-svn-id: svn://svn.berlios.de/gpodder/trunk@743 b0d088ad-0a06-0410-aad2-9ed5178a7e87
Diverse changes, code clean-ups and other small annoyances
* src/gpodder/config.py: Make sure we can load a default set of
configuration options, even if we are in CLI mode
* src/gpodder/download.py: Don't display a traceback when logging a
cancelled download
* src/gpodder/gui.py: Add Doug Hellmann to contributors/coders list in
the about dialog (Doug Hellmann has done the feed cache code); do not
center the gPodderEpisode dialog on the treeAvailable widget (this
looks ugly ;)
* src/gpodder/libpodcasts.py: Clean up import statements; Make sure we
always have icon names, even in CLI mode; Remove "is_music_channel"
property of podcastChannel (not needed anymore);
git-svn-id: svn://svn.berlios.de/gpodder/trunk@684 b0d088ad-0a06-0410-aad2-9ed5178a7e87
Logging traceback is enabled by default (needs to be disabled on demand)
* src/gpodder/*.py: Remove "traceback=True" from logging calls
* src/gpodder/liblogger.py: Always print a traceback if it's
available; if not, do not print it out; this can be disabled by
passing "traceback=False" to the log() function
* src/gpodder/sync.py: Also add "traceback=False" for optional imports
git-svn-id: svn://svn.berlios.de/gpodder/trunk@682 b0d088ad-0a06-0410-aad2-9ed5178a7e87
Calculate total percentage based on byte size instead of percentage
* src/gpodder/download.py: Make sure we save the right size of a
currently in-progress download of an episode
* src/gpodder/services.py: Calculate the total percentage for all
episodes based on their file size instead of their percentage done;
this is especially important when downloading small files mixed with
large files; this makes the estimated download time more reliable;
thanks to Jérôme Chabod, who has done this patch
(Closes: http://bugs.gpodder.org/show_bug.cgi?id=46)
git-svn-id: svn://svn.berlios.de/gpodder/trunk@675 b0d088ad-0a06-0410-aad2-9ed5178a7e87
Clean up preferences dialog + Move download settings to downloads tab
* data/gpodder.glade: UI-related changes to the preferences dialog
clean-up and the moving of the download settings to the downloads tab;
thanks to Paul Rudking for the download settings to downloads tab
patch
* src/gpodder/download.py: Better rate limiting, implemented by Paul
Rudkin
* src/gpodder/gui.py: UI-related changes to the preferences dialog
clean-up; the download settings changes are by Paul Rudkin
* src/gpodder/services.py: Improve the waiting/locking for the maximum
number of simultaneous downloads using a threading.Event
(Closes: http://bugs.gpodder.org/show_bug.cgi?id=69)
(Closes: http://bugs.gpodder.org/show_bug.cgi?id=83)
git-svn-id: svn://svn.berlios.de/gpodder/trunk@673 b0d088ad-0a06-0410-aad2-9ed5178a7e87
Project management updates (authors, contributors and copyright)
* AUTHORS: Removed (was outdated); content now in gui.py (AboutDialog)
* bin/gpodder, data/po/Makefile, doc/dev/copyright_notice,
doc/dev/win32/setup-win32.py, INSTALL, Makefile, README,
setup.py: Updated Copyright and old website URL to include 2008, the
gPodder team and www.gpodder.org
* src/gpodder/*.py: Updated Copyright years
* src/gpodder/gui.py: Add list of contributors from AUTHORS file and
from the content on the website's news page (please mail me if I
forgot to mention you as a contributor, I surely have missed a few);
make the AboutDialog's application name "gPodder" (from gpodder) and
add an URL hook function to the AboutDialog, so the website is opened
in the user's default web browser
git-svn-id: svn://svn.berlios.de/gpodder/trunk@648 b0d088ad-0a06-0410-aad2-9ed5178a7e87