Commit graph

18 commits

Author SHA1 Message Date
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
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