mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-19 21:03:14 -07:00
Update vendored beets to 1.6.0
Updates colorama to 0.4.6 Adds confuse version 1.7.0 Updates jellyfish to 0.9.0 Adds mediafile 0.10.1 Updates munkres to 1.1.4 Updates musicbrainzngs to 0.7.1 Updates mutagen to 1.46.0 Updates pyyaml to 6.0 Updates unidecode to 1.3.6
This commit is contained in:
parent
5073ec0c6f
commit
56c6773c6b
385 changed files with 25143 additions and 18080 deletions
56
libs/common/confuse/exceptions.py
Normal file
56
libs/common/confuse/exceptions.py
Normal file
|
@ -0,0 +1,56 @@
|
|||
from __future__ import division, absolute_import, print_function
|
||||
|
||||
import yaml
|
||||
|
||||
__all__ = [
|
||||
'ConfigError', 'NotFoundError', 'ConfigValueError', 'ConfigTypeError',
|
||||
'ConfigTemplateError', 'ConfigReadError']
|
||||
|
||||
YAML_TAB_PROBLEM = "found character '\\t' that cannot start any token"
|
||||
|
||||
# Exceptions.
|
||||
|
||||
|
||||
class ConfigError(Exception):
|
||||
"""Base class for exceptions raised when querying a configuration.
|
||||
"""
|
||||
|
||||
|
||||
class NotFoundError(ConfigError):
|
||||
"""A requested value could not be found in the configuration trees.
|
||||
"""
|
||||
|
||||
|
||||
class ConfigValueError(ConfigError):
|
||||
"""The value in the configuration is illegal."""
|
||||
|
||||
|
||||
class ConfigTypeError(ConfigValueError):
|
||||
"""The value in the configuration did not match the expected type.
|
||||
"""
|
||||
|
||||
|
||||
class ConfigTemplateError(ConfigError):
|
||||
"""Base class for exceptions raised because of an invalid template.
|
||||
"""
|
||||
|
||||
|
||||
class ConfigReadError(ConfigError):
|
||||
"""A configuration source could not be read."""
|
||||
def __init__(self, name, reason=None):
|
||||
self.name = name
|
||||
self.reason = reason
|
||||
|
||||
message = u'{0} could not be read'.format(name)
|
||||
if (isinstance(reason, yaml.scanner.ScannerError)
|
||||
and reason.problem == YAML_TAB_PROBLEM):
|
||||
# Special-case error message for tab indentation in YAML markup.
|
||||
message += u': found tab character at line {0}, column {1}'.format(
|
||||
reason.problem_mark.line + 1,
|
||||
reason.problem_mark.column + 1,
|
||||
)
|
||||
elif reason:
|
||||
# Generic error message uses exception's message.
|
||||
message += u': {0}'.format(reason)
|
||||
|
||||
super(ConfigReadError, self).__init__(message)
|
Loading…
Add table
Add a link
Reference in a new issue