Commit graph

25 commits

Author SHA1 Message Date
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
Johnny Robeson
e8afcbe7ec replace unicode with six.text_type 2016-06-24 05:53:49 -04:00
Jack Wilsdon
b1c58e99ec Update code to match pep8 naming standards 2016-04-27 20:15:10 +01: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
43572f50b0 Removed unicode_literals from library, logging and mediafile 2016-02-19 22:31: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
Bruno Cauet
bad87c1668 Delete hacks & workarounds for python 2.6 2015-04-01 10:46:22 +02:00
Bruno Cauet
05de43a942 Share logging level between beets base logger refs
Add BeetsLogger.set_global_level() so the 'beets' logger has the same
level in all threads, which is important for an import session.
2015-03-31 18:03:11 +02:00
Bruno Cauet
dfa18b1119 Make beets loggers level thread local.
This updates the beets logger class. Tests are missing.
2015-03-25 12:55:40 +01:00
Bruno Cauet
c2f8cb9983 Merge branch 'master' into future
Conflicts:
	test/test_plugins.py
2015-01-21 10:04:33 +01:00
Adrian Sampson
7e21c68487 Logging: pass through non-problematic values
9b83cef was a little too aggressive; we need most objects to go through
unconverted so '{0.title}' and such still work in format strings. This is now
just a targeted workaround for the case I encountered.
2015-01-20 16:28:42 -08:00
Adrian Sampson
9b83cef0de Handle encoding misfortunes in logging (#1248)
The beets loggers now, as proposed in #1044, do their utmost to avoid crashing
when logged values are not valid Unicode or Unicode-convertible. This came up
urgently when a `CalledProcessError` could not be logged with `'u{}'.format()`
(!!!) so we needed to some manner of conversion, but it should be possible to
log paths without `displayable_path`. In fact, it may be time to retire
`displayable_path` for the most part.
2015-01-20 16:17:59 -08:00
Bruno Cauet
2dab8e5fd6 Import unicode_literals in beets package 2015-01-19 21:41:33 +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
81754e5760 beets.logging exports NullHandler on python 2.6
NullHandler is not available in python 2.6. We backport it so the
importer log can use it for it is more convenient than guarding calls to
self.logger (see beets/importer.py)
2015-01-13 09:20:29 +01:00
Adrian Sampson
e83b6ae297 Logging (#1208): prefix plugin names, expand docs
We now add the plugin name to messages in verbose mode. This may not be the
best final policy, but it does help make the output more readable when many
plugins are talking at once.
2015-01-11 15:39:54 -08:00
Adrian Sampson
4ef52e6265 Minor formatting fixes for logging overhaul #1198 2015-01-05 17:39:13 -08:00
Bruno Cauet
a8b0454bfb Minor fix in beets.logging docstring
formatting → logging
2015-01-05 09:55:05 +01:00
Bruno Cauet
fa696beef2 beets.logging: fix root logger access
logging does not export 'root', so we must use Logger.root
2015-01-05 09:53:56 +01:00
Bruno Cauet
06f0e1dee1 Port beets.logging to python 2.6
Multiple hacks :-)
2015-01-05 09:21:11 +01:00
Bruno Cauet
4ba4f53053 Silence flake8 on logging.* import 2015-01-04 17:50:05 +01:00
Bruno Cauet
f5c5666729 Attain pep8-cleanliness
No more E12 or E501
2015-01-04 17:29:31 +01:00
Bruno Cauet
d409da8753 Fix docstring beets.logging.StrFormatLogger._log 2015-01-04 17:22:45 +01:00
Bruno Cauet
b40fb507c3 Offer new-style formatting for logging
beets.logging is a drop-in replacement for logging. Any logger created
from beets.logging.getLogger() will use {}-style formatting instead of
%-style, on python 2 and 3.
2015-01-04 17:02:27 +01:00