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