Commit graph

69 commits

Author SHA1 Message Date
Johnny Robeson
f82f5f51a4 use !r for command exec logging in play plugin
This is a bit simpler and is compatible with py2 and 3.
2016-07-10 06:00:53 -04:00
Johnny Robeson
a15ae96616 add a missing text_string in play plugin
I don't think wanna send the cli args as bytes to the logger
2016-07-04 02:48:54 -04:00
Johnny Robeson
6b3cc6ff37 adapt print_() callers to send unicode strings 2016-06-29 03:17:02 -04:00
Johnny Robeson
6745759ea5 open even more files in binary mode
* play plugin
* smartplaylist plugin
2016-06-13 05:18:33 -04: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
456565b6f2 Removed import of unicode_literals from plugins
* play
* plexpudate
* random
* replaygain
2016-02-20 14:22:45 +01:00
nath@laptop
6e2b249c54 fix-typos: Write changelog
Also stealth-reformulate a recent comment of mine which contained
another (!) typo
2016-01-06 11:18:39 +01:00
nath@laptop
1e72ba75c7 play: Preserve backwards compat when fixing typos 2016-01-06 10:12:45 +01:00
nath@laptop
72056e8e07 play: Fix typo treshold > threshold:
We should warn users that the corresponding config key changed accordingly.
2016-01-06 09:21:37 +01:00
Jesse Weinstein
246afda9c4 Actually, push the job off on the caller 2016-01-03 13:07:27 -08:00
nath@laptop
775ac4ed83 play: Log exception from os call more accurately
Depending on raw or not, we do not necessarily play a 'playlist'. Use 'query' generically instead.
2015-12-31 21:49:03 +01:00
nath@laptop
f685a59e71 play: remove dead code
This piece of code won't ever execute because interactive open terminates python execution
2015-12-31 13:51:18 +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
3475b91c00 Remove unused import
Oops. I was trying to use shlex.quote, but that's Python 3.3+.
2015-09-30 10:32:37 -07:00
Adrian Sampson
2607bee997 Tiny fixes for play 2015-09-30 10:11:17 -07:00
nath@home
ff4fda1bb5 play: make the many files warning configurable
The warning_treshold key in the play configuration defines the
minimum number of file before a warning is issued (default 100).
A zero value means no warning is ever issued.

This is the first commit for this feature, and this should fully
implement it.
2015-09-03 22:19:51 +02:00
nath@home
b9bc06d9d8 play-raw: Rename the command target:
passed_to_command -> open_args
2015-09-01 23:42:43 +02:00
nath@home
9c663432bd Refactor util/interactive_open: multiple targets
interactive_open should now be invoked with at least the list of
targets and optionally the command to open the targets with.
This allows beets-play to pass multiple file paths directly to
the configured command.

The changes to the existing invocations are pretty trivial in
order to comply to this refactor.
2015-09-01 23:42:42 +02:00
nath@home
4eb563a08c pep8: Correct camelCase to snake_case 2015-09-01 23:42:42 +02:00
nath@home
a23c5d4f67 play-raw: Call vlc with one file par arg 2015-09-01 23:42:42 +02:00
nath@home
18d5c3b0a0 play-raw: Add the option to play the raw queried pathes
I slightly rewrote the play plugin in order to improve
the readability and to introduce the "raw" play config
option which makes beet simply pass a list of pathes
to the play command rather than a playlist.
2015-09-01 23:42:42 +02:00
Adrian Sampson
759c79c426 play: Insert arguments anywhere (#1532) 2015-08-16 09:23:09 -07:00
Adrian Sampson
ab7e9d4db2 Simplify #1532: CLI only, append to end 2015-08-14 19:52:49 -07:00
Adrian Sampson
7b6c773a3f Cleanup for #1532 2015-08-14 19:44:11 -07:00
Oliver Rümpelein
94258110a7 Forgot to remove an if-statement. 2015-08-03 17:01:56 +02:00
Oliver Rümpelein
69377291ff Try to fix TravisCI-errors. 2015-08-02 21:08:44 +02:00
Oliver Rümpelein
90bb4081fe Implemented --args-feature
* as discussed in #1532, with args-parameter, and optionally
   inserted config-key
 * updated changelog/docs
2015-08-02 20:44:56 +02:00
Oliver Rümpelein
5f9068cb50 Implemented Idea 2 from #1532
* New argument `--optargs` reads string from option
 * If "{}" is present in the given string, the `optargs`
   from config-file get inserted at that point.
2015-08-01 13:55:17 +02:00
Oliver Rümpelein
3b6373541a Fixed Errors indicated by travis-ci
See https://travis-ci.org/sampsyo/beets/jobs/69335554
2015-07-05 15:00:46 +02:00
Oliver Rümpelein
3b2c3a5b31 Renamed options, corrected small typos. 2015-07-02 20:46:10 +02:00
Oliver Rümpelein
0a995c218a Added optional argument for play-plugin
* New config key "play -> optargs"
 * New Subcommand argument "-o", "--optargs"
 * Set position using "{}" within "play -> command"-string
2015-07-02 20:25:54 +02:00
Bruno Cauet
650305c9a1 All suitable plugins use CommonOptionsParser features 2015-03-05 17:03:02 +01:00
Bruno Cauet
39a6145d2d Plugin play uses default item sort in album mode
Offer library.get_default_{item,album}_sort for that purpose.
2015-02-16 12:26:23 +01:00
Bruno Cauet
c47221555f Add beets.util.interactive_open() find cmd + execute
interactive_open() takes a target and an optional command, if it does not
receive a command then it uses open_anything().

It parses command and lexes it with shlex.split(), revieling the client
from that task.

"config -e" command uses it, and gives a better error message in case of
problem. "play" plugin uses it as well, as side-effect being that the
command is now interactive, as requested in issue #1321.

Fix issue #1321.
2015-02-16 12:26:17 +01:00
Bruno Cauet
5d9128aff3 util.interactive_open() return open/xdg-open/start
Depending on the platform return the correct automatic execution
command.
2015-02-16 11:35:13 +01:00
Bruno Cauet
1d8160f9ff Play plugin: use OO, don't pass log around 2015-02-16 10:50:41 +01:00
Bruno Cauet
13e47472ac Play plugin: byte newlines in files written
Avoid unicode errors when writing '\n' around file paths.
2015-02-15 15:49:46 +01:00
Tom Jaspers
927a53d59b Merge pull request #1281 from tomjaspers/configurable-colors
Colors are now user configurable.

Conflicts:
	beets/ui/__init__.py
	beets/ui/commands.py
2015-01-30 13:48:19 +01:00
Tom Jaspers
f483012183 Colorize is now to be called with the abstract color_name instead of the color.
E.g., `colorize('text_success', 'hello world')`

To ensure compatibility with 3rd party plugins, a valid color ('red') can still be passed,
but it will be logged.
2015-01-29 14:33:57 +01:00
Tom Jaspers
d3fce35481 Colors are user configurable
- Colors are mapped on to a dictionary using abstract names (e.g., text_success)
- Add `colors` option under `ui` to allow users to choose their own color scheme
- Move configuration option `color` from top-level to `ui`
- Show deprecation warning if top-level `color` configuration is used (but respect it)

Fix #1238
2015-01-26 17:24:32 +01: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
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
Bruno Cauet
b27c5304d1 Merge branch 'master' into logging
Conflicts:
	beetsplug/fetchart.py
	beetsplug/mpdstats.py
2015-01-09 15:15:27 +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
Bruno Cauet
32673b87e7 Update multiple plugins: pass the logger around 2015-01-06 21:42:09 +01:00
Bruno Cauet
b8211a3c4c Every plugin uses its own logger
logging.getLogger(__name__) everywhere!
Several loggers prefixed every log message with [logername], which we
delete here.
2015-01-06 10:35:44 +01:00
Bruno Cauet
30f158a95e Move "from beets import logging" statements
Move the import next to other beets-related imports
2015-01-05 10:05:21 +01:00
Bruno Cauet
f5c5666729 Attain pep8-cleanliness
No more E12 or E501
2015-01-04 17:29:31 +01:00
Bruno Cauet
7df8bef8b7 Update logging imports: logging → beets.logging 2015-01-04 17:02:27 +01:00