Commit graph

43 commits

Author SHA1 Message Date
Šarūnas Nejus
4260162d44
Remove all Python 2 references 2025-07-08 11:37:34 +01:00
Šarūnas Nejus
9acfa3c175
Remove arg_encoding 2025-04-21 12:41:57 +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
wisp3rwind
22826c6d36 drop old Python: remove obsolete custom string formatter in hooks plugin 2022-12-24 13:09:26 +01: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
Adrian Sampson
2f5f9ea174
Remove shlex_split utility
This works around a bug that does not exist in Python 3.x, and the
workaround (by calling the underlying shlex.split function with bytes)
was causing crashes on some versions of Python 3. Seemed to work fine on
3.10-dev, though, oddly.
2021-08-19 17:14:16 -04:00
Jack Wilsdon
430eab2cf0
Switch to using check_call for hooks 2019-10-17 11:00:59 +01:00
Jack Wilsdon
9bb6c29d22
Always use custom formatter for formatting hook commands 2019-02-25 14:41:59 +00:00
Jack Wilsdon
768770d561
Fix incorrect indentation 2019-01-31 00:15:42 +00:00
Barry Broderick
530beb6312 removed whitespaces from empty line 2017-11-22 10:10:28 -05:00
Barry Broderick
a7818027ab replaced the exception test in convert_field with an isinstance test 2017-11-20 23:09:36 -05:00
Barry Broderick
585d4ba89d attempted fix for #2740 2017-11-20 09:56:40 -05:00
Johnny Robeson
5b3cd44608 add coding: utf-8 magic comment to every .py file 2016-08-07 04:09:17 -04:00
Johnny Robeson
304df82361 rename/move ui._arg_encoding to util.arg_encoding
We use this for more than ui concerns, so it should be in util.

It is also no longer marked as a "private" method.
2016-08-04 17:16:11 -04:00
Adrian Sampson
039825e0e0 Only use CodingFormatter on Python 2 2016-07-24 15:01:06 -07:00
Adrian Sampson
c67fbefc4c A little more spcificity in CodingFormatter 2016-07-24 14:59:31 -07:00
Adrian Sampson
5efd5b21c5 Use new as_str method
Instead of `get(six.text_type)`, which was a surprisingly large portion of our
uses of six.
2016-06-25 19:16:14 -07:00
Johnny Robeson
e8afcbe7ec replace unicode with six.text_type 2016-06-24 05:53:49 -04:00
Jack Wilsdon
982272deb3 Merge pull request #1981 from jackwilsdon/fix-hook-unicode
Fix command formatting for hook plugin
2016-05-03 17:45:38 +01:00
Jack Wilsdon
92af723682 Format individual command pieces instead of whole command 2016-05-01 23:04:22 +01:00
Jack Wilsdon
9f0db13675 Remove unnecessary variable 2016-05-01 21:44:40 +01:00
Jack Wilsdon
63caf1fceb Add documentation for coding formatter 2016-05-01 21:44:05 +01:00
Jack Wilsdon
ba7004de6e Remove unneeded AutoFieldCountFormatter 2016-05-01 21:33:06 +01:00
Jack Wilsdon
e66981c4d8 Use beets shlex_split instead of shlex.split 2016-05-01 21:31:53 +01:00
Jack Wilsdon
b4715d61e1 Fix over-indentation of wrapped code 2016-05-01 21:30:20 +01:00
Jack Wilsdon
576ec92992 Fix encoding for hook plugin
- Add a AutoFieldCountFormatter formatter for auto field
   incrementation.
 - Add a CodingFormatter for formatting encoded strings.
 - Fix encoding for hook plugin using CodingFormatter.
2016-05-01 21:21:40 +01:00
Adrian Sampson
04bbdede38 hook: Typed configuration accessors 2016-05-01 13:04:35 -07:00
Jack Wilsdon
b9464d1ea4 Use unicode for command formatting 2016-05-01 18:26:06 +01:00
Jack Wilsdon
85fd60852f Remove unused dependencies 2016-04-18 19:21:31 +01:00
Jack Wilsdon
dea091ee53 Improve error handling for invalid commands 2016-04-18 19:16:31 +01:00
Jack Wilsdon
070469e259 Remove unicode_literals from __future__ imports 2016-04-18 16:00:13 +01:00
Jack Wilsdon
3e35660ff3 Remove unnecessary escaping on double quotes 2016-04-18 15:36:08 +01:00
Jack Wilsdon
686e069bc4 Replace double quotes with single quotes 2016-04-18 15:35:15 +01:00
Jack Wilsdon
8b4f349e27 Improve hook plugin design and configuration
- Remove `shell` option and split all commands using `shlex.split`
   before passing them to `subprocess.Popen`.
 - General refactor of hook plugin code - move hook creation function
   inside `HookPlugin`.
 - Add improved error handling for invalid (i.e. empty) commands or
   commands that do not exist.
2016-04-18 15:04:57 +01:00
Jack Wilsdon
55bd513278 Remove completed TODO comments 2015-09-12 02:17:06 +01:00
Jack Wilsdon
417a724e42 Remove unused sys import and use correct platform encoding 2015-09-12 02:15:11 +01:00
Jack Wilsdon
0dff24eb96 Move Popen call to a single line 2015-09-12 02:14:33 +01:00
Jack Wilsdon
ae2ff6185f Use default stdout and stderr streams for hook processes 2015-09-12 02:09:19 +01:00
Jack Wilsdon
8b7af7fe23 Fix indentation for wrapped method call 2015-09-11 18:38:30 +01:00
Jack Wilsdon
8fea1e65c5 Add logging for hook plugin 2015-09-11 18:11:24 +01:00
Jack Wilsdon
2d0c217252 Improve the way substitute_args is iterated
Iterate substitute_args instead of kwargs, as we
ignore anything that is not in substitute_args
already.

Fix an issue where a hook argument containing
non-ascii characters caused an exception.
2015-09-11 15:19:51 +01:00
Jack Wilsdon
88ece413f3 Add Hook plugin to run commands on events
This plugin allows users to execute scripts on
different events, as well as forward any
arguments from the events to the script.
2015-09-11 04:49:50 +01:00