Commit Graph
47 Commits
Author SHA1 Message Date
Šarūnas Nejus bfe5ba51c5 typing: fix annotations in bpd plugin 2026-08-29 17:49:13 +01:00
Šarūnas Nejus 1ae8778385 typing: add annotations to bpd plugin 2026-08-29 17:38:48 +01:00
Sebastian Mohr 54a2bd20e1 Removed This file is part of beets... headers. 2026-06-29 11:20:15 +02:00
Šarūnas Nejus d53ee774a9 Enable and fix flake8-return 2026-06-09 00:14:06 +01:00
Šarūnas Nejus 30ab81eb5b Extract UserError from beets.ui to a new beets.exceptions module.
Update all references in core, plugins, and tests to import UserError
from the new location. This centralizes exception handling and improves
code organization.
2026-05-16 11:18:51 +01:00
Šarūnas Nejus c52656fb0a Enable RUF rules 2026-01-13 20:55:40 +00:00
Ognyan Moore aa2dc9005f Catch ValueError when setting gst required version
pytest.importskip is used to catch the case when beetsplug.bpd cannot be
imported. On macOS, the gi module was able to be imported, but when
trying to specify `gi.require_version`, a ValueError is raised about
Gst being unavailable. pytest does not catch this ValueError during
importskip as it is not an ImportError, and thus the test suite errors
during the test collection phase.

With this change, we catch the ValueError, and re-raise it as an
ImportError and pytest gracefully skips those tests.
2025-11-19 14:43:30 +03:00
Šarūnas Nejus 1c16b2b308 Replace string concatenation (' + ')
- Join hardcoded strings
- Replace concatenated variables with f-strings
2025-08-30 23:10:15 +01:00
Šarūnas Nejus 85a17ee503 Reformat the codebase 2024-09-21 11:57:48 +01:00
Serene-Arc a6e5201ff3 Apply formatting tools to all files
This is 'the big one', which touches every file so that it all conforms
to the given standard.
2023-10-22 09:53:18 +10:00
Andrew Rogl ee4268dabb Remove unused imports
Fix imports
Fix formatting
2021-08-26 20:59:48 +10:00
Andrew Rogl 1ec87a3bdd pyupgrade beetsplug and tests
All tests working
More tidy up to be done
2021-08-26 19:12:51 +10:00
FichteFoll 9631616b53 Replace a couple URLs that don't point to anything
I'm unsure regarding the pygst tutorial, so I just added another URL
of the best resource I could find with a quick web search.
2019-06-05 23:08:18 +02:00
Carl Suster 3da23167ca bpd: support decoders command
This uses GStreamer APIs to extract a list of audio decoders and the
relevant MIME types and file extensions. Some clients like ncmpcpp use
this command to fetch a list of supported file extensions.
2019-04-19 16:08:05 +10:00
Carl Suster 28db7d3d33 bpd: provide precision time in status 2019-04-02 11:15:00 +11:00
Adrian Sampson 958ad430fc bpd: Use integers for time values (fix 2394) 2017-01-17 11:37:10 -08:00
Johnny Robeson 7a2bdf502f s/utf8/utf-8/ in all encoding/decoding contexts
This matches up with the python documentation.
2016-09-06 23:10:24 -04:00
Adrian Sampson 58afaf07a5 Switch to new noqa syntax for flake8 3.0
Apparently, `# noqa ignore=X` worked before, but now the syntax is more terse,
like this: `# noqa: X`.

See the changelog here:
http://flake8.pycqa.org/en/latest/release-notes/3.0.0.html
2016-07-25 15:02:10 -04:00
Johnny Robeson cb6efc4c22 Reorganize Gst import and version req in bpd
This avoids

```sh
PyGIWarning: Gst was imported without specifying a version first. Use
gi.require_version('Gst', '1.0') before import to ensure that the right
version gets loaded.
```

by silencing E401 import ordering warning
2016-07-08 05:48:26 -04:00
Johnny Robeson e8afcbe7ec replace unicode with six.text_type 2016-06-24 05:53:49 -04:00
Johnny Robeson 4649226b9b use urllib from six.moves 2016-06-23 04:40:18 -04:00
Johnny Robeson 1f8fe0f9a6 use _thread from six.moves 2016-06-23 04:40:18 -04:00
Philipp Beckmann f9ed53a096 Multiple corrections as advised in the codereview 2016-06-20 18:44:37 +02:00
Philipp Beckmann 7b154cedd7 Added double line spacings between definitions 2016-06-20 18:29:46 +02:00
Philipp Beckmann 9fd227c8cc Fixed flake8 errors 2016-06-20 18:22:07 +02:00
Philipp Beckmann 5613d9d4ea bpd: Added correct error check for query_position/query_duration 2016-06-20 18:09:37 +02:00
Philipp Beckmann 0917e675d7 bpg: Converted gstplayer.py to GStreamer 1.0 2016-06-19 22:06:55 +02:00
Adrian Sampson 71b9fd785c Revert "Do __name__ comparison with bytes and not unicode"
This reverts commit 9c41c39913.
That commit used byte strings for the `if __name__ == '__main__'` pattern,
which was necessary when we were doing unicode_literals. But it is wrong on
Python 3, and now that we're liberated from unicode_literals, we need to go
back to native strings for this comparison.
2016-05-29 19:19:59 -07:00
Adrian Sampson e54c7eec3d Standardize __future__ imports without parentheses
Since the list is short enough now, we don't need parentheses for the line
wrap. This is a little less ugly.
2016-02-28 15:03:51 -08:00
Peter Kessen 5db57bdc01 Removed unicode_literals from plugin bpd 2016-02-20 11:57:36 +01:00
Jack Wilsdon 12cd5306b7 Update copyright dates to 2016 2015-12-30 15:42:06 +00:00
Peter Kessen 3eb8008b11 added encoding as comment in files
added line like
# -*- coding: utf-8 -*-
to all files with correct license in header
2015-11-19 18:41:01 +01:00
Adrian Sampson e7f8a627e9 Style fixes for pep8 1.6 2015-02-07 12:51:54 -08:00
Bruno Cauet a5026100a3 All plugins use unicode_literals
Given that part of them has no test I may have broke them
2015-01-20 16:22:27 +01:00
Bruno Cauet 02d8e88ef1 Replace all mentions of 'str' with 'bytes' 2015-01-20 12:48:15 +01:00
Bruno Cauet 9c41c39913 Do __name__ comparison with bytes and not unicode 2015-01-20 12:03:57 +01:00
Bruno Cauet 90b388b775 Use __future__ imports but unicode_literals everywhere
Include import of __future__ features division, absolute_imports and
print_function everywhere. Don't add unicode_literals yet for it is
harder to convert.

Goal is smoothing the transition to python 3.
2015-01-19 12:25:16 +01:00
Frederik “Freso” S. Olesen 4b1f0cbf48 Happy 2015. ;)
See 7a410f636b

Command used:

    git grep -l 'Copyright 201'|xargs sed -i -E 's/Copyright 201./Copyright 2015/'`
2015-01-08 21:37:09 +01:00
Fabrice Laporte 3ead936fe5 flake8 cleaning beetsplug/*
Remaining warnings are related to visual indentation.
2014-04-13 23:24:57 +02:00
Adrian Sampson 7a410f636b happy new year ✨
For future reference, this command did the trick:
ack -l 'Copyright 201' | xargs perl -pi -E 's/Copyright 201./Copyright 2013/'
2013-01-11 10:43:41 -08:00
Adrian Sampson 749b19955e bpd: use pygst.require() before importing gst
A user reports that this fixes BPD on OS X.
2012-09-12 17:57:37 -07:00
Adrian Sampson 429af42e14 use print_function __future__ import
All code should now use Python 3-style "print"s.
2012-05-13 21:08:27 -07:00
Adrian Sampson b68e87b92c The Great Trailing Whitespace Purge of 2012
What can I say? I used to use TextMate!
2012-05-13 20:22:17 -07:00
Adrian Sampson 22e8695172 BPD: use playbin2 instead of playbin (#364) 2012-03-21 14:25:01 -07:00
Adrian Sampson a1996472e8 close gstreamer pipeline after each track
(*maybe* addressing BPD memory leak)
2011-04-20 10:34:44 -07:00
Adrian Sampson f8c317a2cd undefined variable reported by pylint 2010-07-09 18:16:40 -07:00
Adrian Sampson 8ccc8e1ccd move bpd and dadd commands to plugins
--HG--
rename : beets/player/bpd.py => beetsplug/bpd/__init__.py
rename : beets/player/gstplayer.py => beetsplug/bpd/gstplayer.py
rename : beets/device.py => beetsplug/device.py
2010-07-08 17:09:07 -07:00