Sitelet https://github.com/gpodder/gpodder/pull/843/files
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9fd26f2
remove python2 import check
elelay Jul 10, 2020
3babb86
use requests package for util.urlopen
elelay Jul 11, 2020
a56651a
fix linter warning
elelay Jul 12, 2020
d40bc49
move download's get_header_param() to util, to use in soundcloud plugin
elelay Jul 12, 2020
d88a909
set requests timeout
elelay Jul 12, 2020
6188efc
use requests for download
elelay Jul 12, 2020
3967572
escape download task error message before using it as markup
elelay Jul 12, 2020
8d3e65b
add 'Show Password' checkbox to password prompt
elelay Jul 12, 2020
ef82eba
add more cases to the test server
elelay Jul 12, 2020
1c806ed
gtk: make error dialog message copyable
elelay Jul 12, 2020
bb30191
add requests to windows deps
elelay Jul 12, 2020
3ae875d
add requests to travis build
elelay Jul 12, 2020
818441d
test server: add podcast with space in the filename, not encoded
elelay Jul 12, 2020
48d851d
rework feedcore.Fetcher interface to allow reusing it in custom chann…
elelay Jul 14, 2020
d59bba5
fix invalid encoding used to parse feeds
elelay Jul 14, 2020
12912be
fix naive access to response.text
elelay Jul 18, 2020
7c551ee
gpodder escapist_videos doesn't work with escapist magazine v2
elelay Jul 18, 2020
831186b
fix overlooked stream.text in conversion to util.response_text
elelay Jul 23, 2020
7394ca4
add feedcore unittests
elelay Jul 23, 2020
0d0e7f6
retry 3 times for feedcore and other util.urlopen usage
elelay Jul 23, 2020
5fe4ca3
fix isort warnings
elelay Sep 7, 2020
c9ba877
run tests and lint on ubuntu 20.04 with python 3.8
elelay Sep 7, 2020
24c94d0
fix isort warnings
elelay Sep 7, 2020
c624800
isort --float-to-top is not a good option
elelay Sep 7, 2020
2f6ad17
force isort < 5.0 until available in gentoo
elelay Sep 11, 2020
463e460
Merge remote-tracking branch 'origin/master' into requests
elelay Sep 11, 2020
dd16574
fix paginated feeds: res.feed already a PodcastParsedFeed
elelay Sep 11, 2020
89d9baf
apply #869 fix NEW_LOCATION with same url
elelay Sep 12, 2020
e632bfd
Merge remote-tracking branch 'origin/master' into requests
elelay Nov 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
language: python
dist: trusty
dist: focal
sudo: required
python:
- "3.5"
- "3.8"
install:
- sudo apt-get update -q
- sudo apt-get install intltool desktop-file-utils
- pip3 install coverage==4.5.4 minimock pycodestyle isort
- "pip3 install pytest-cov minimock pycodestyle 'isort<5.0' requests pytest pytest-httpserver"
- python3 tools/localdepends.py
script:
- make lint
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
- [Python 3.5](http://python.org/) or newer
- [Podcastparser](http://gpodder.org/podcastparser/) 0.6.0 or newer
- [mygpoclient](http://gpodder.org/mygpoclient/) 1.7 or newer
- [requests](https://requests.readthedocs.io) 2.24.0 or newer
- Python D-Bus bindings

As an alternative to python-dbus on Mac OS X and Windows, you can use
Expand Down Expand Up @@ -66,7 +67,9 @@ PyPI. With this, you get a self-contained gPodder CLI codebase.
### Test Dependencies

- python-minimock
- python-coverage
- pytest
- pytest-httpserver
- pytest-cov
- desktop-file-utils

## Testing
Expand All @@ -85,9 +88,8 @@ Tests in gPodder are written in two different ways:
- [unittests](http://docs.python.org/3/library/unittest.html)

If you want to add doctests, simply write the doctest and make sure that
the module appears in "doctest_modules" in src/gpodder/unittests.py. For
example, the doctests in src/gpodder/util.py are added as 'util' (the
"gpodder" prefix must not be specified there).
the module appears after `--doctest-modules` in `pytest.ini`. If you
add tests to any module in `src/gpodder` you have nothing to do.

If you want to add unit tests for a specific module (ex: gpodder.model),
you should add the tests as gpodder.test.model, or in other words:
Expand Down
4 changes: 2 additions & 2 deletions bin/gpo
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ except ImportError:
readline = None

try:
import termios
import fcntl
import struct
import termios
except ImportError:
termios = None
fcntl = None
struct = None
termios = None

# A poor man's argparse/getopt - but it works for our use case :)
verbose = False
Expand Down
4 changes: 3 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ help:
##########################################################################

unittest:
LC_ALL=C PYTHONPATH=src/ $(PYTHON) -m gpodder.unittests
LC_ALL=C PYTHONPATH=src/ pytest --ignore=tests --ignore=src/gpodder/utilwin32ctypes.py --doctest-modules src/gpodder/util.py src/gpodder/jsonconfig.py
LC_ALL=C PYTHONPATH=src/ pytest tests --ignore=src/gpodder/utilwin32ctypes.py --ignore=src/mygpoclient --cov=gpodder

# ISORTOPTS := -c share src/gpodder tools bin/* *.py # for isort >= 5.0
ISORTOPTS := -rc -c share src/gpodder tools bin/* *.py
lint:
pycodestyle share src/gpodder tools bin/* *.py
Expand Down
2 changes: 0 additions & 2 deletions pytest.ini

This file was deleted.

2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ select = W1, W2, W3, E11, E121, E122, E123, E124, E125, E127, E129, E13, E2, E3,
max-line-length = 142

[isort]
known_third_party=dbus,gi,mutagen,cairo,requests,github3,jinja2,magic,youtube_dl,podcastparser,mygpoclient
known_third_party=cairo,comtypes,dbus,gi,github3,jinja2,kaa,magic,mutagen,mygpoclient,podcastparser,requests,youtube_dl
known_first_party=gpodder,soco
3 changes: 2 additions & 1 deletion share/gpodder/extensions/rockbox_convert2mp4.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
import shlex
import subprocess

import gpodder
import kaa.metadata

import gpodder
from gpodder import util

logger = logging.getLogger(__name__)
Expand Down
3 changes: 2 additions & 1 deletion share/gpodder/extensions/taskbar_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
c_ulong, c_ulonglong, c_ushort, c_wchar_p, sizeof)
from ctypes.wintypes import tagRECT

import gpodder
from comtypes import COMMETHOD, GUID, IUnknown, client, wireHWND

import gpodder

_ = gpodder.gettext


Expand Down
5 changes: 3 additions & 2 deletions src/gpodder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def __init__(self):
SOCKET_TIMEOUT = 60
socket.setdefaulttimeout(SOCKET_TIMEOUT)
del socket
del SOCKET_TIMEOUT
SOCKET_TIMEOUT

# Variables reserved for GUI-specific use (will be set accordingly)
ui_folders = []
Expand Down Expand Up @@ -185,7 +185,8 @@ def fixup_home(old_home):
old_home = new_home # force to config directory
print("D: windows-portable build; forcing home to config directory %s" % new_home, file=sys.stderr)
else: # ui.win32, not portable build
from gpodder.utilwin32ctypes import get_documents_folder, get_reg_current_user_string_value
from gpodder.utilwin32ctypes import (
get_documents_folder, get_reg_current_user_string_value)
try:
# from old launcher, see
# https://github.com/gpodder/gpodder/blob/old/gtk2/tools/win32-launcher/folderselector.c
Expand Down
2 changes: 1 addition & 1 deletion src/gpodder/coverart.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def get_cover(self, filename, cover_url, feed_url, title,

try:
logger.info('Downloading cover art: %s', cover_url)
data = util.urlopen(cover_url, timeout=self.TIMEOUT).read()
data = util.urlopen(cover_url, timeout=self.TIMEOUT).content
except Exception as e:
logger.warn('Cover art download failed: %s', e)
return self._fallback_filename(title)
Expand Down
4 changes: 2 additions & 2 deletions src/gpodder/directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def directory_entry_from_opml(url):

def directory_entry_from_mygpo_json(url):
return [DirectoryEntry(d['title'], d['url'], d['logo_url'], d['subscribers'], d['description'])
for d in json.load(util.urlopen(url))]
for d in util.urlopen(url).json()]


class GPodderNetSearchProvider(Provider):
Expand Down Expand Up @@ -152,7 +152,7 @@ def on_tag(self, tag):
return directory_entry_from_mygpo_json('http://gpodder.net/api/2/tag/%s/50.json' % urllib.parse.quote(tag))

def get_tags(self):
return [DirectoryTag(d['tag'], d['usage']) for d in json.load(util.urlopen('http://gpodder.net/api/2/tags/40.json'))]
return [DirectoryTag(d['tag'], d['usage']) for d in util.urlopen('http://gpodder.net/api/2/tags/40.json').json()]


class SoundcloudSearchProvider(Provider):
Expand Down
Loading