aboutsummaryrefslogtreecommitdiff
path: root/pandora
diff options
context:
space:
mode:
authorMike Crute <mike@crute.us>2020-12-19 21:36:08 +0000
committerMike Crute <mike@crute.us>2020-12-19 21:36:08 +0000
commit816c7e47942c15b0ca35276fad8d23d33100798e (patch)
treed34ef0a1d922289a3c7cbbbb9aad8fa25f1889f6 /pandora
parent135c4076374b5126bd49889ee9d994fac94e4119 (diff)
downloadpydora-816c7e47942c15b0ca35276fad8d23d33100798e.tar.bz2
pydora-816c7e47942c15b0ca35276fad8d23d33100798e.tar.xz
pydora-816c7e47942c15b0ca35276fad8d23d33100798e.zip
New version of black moved the cheese :-(
Diffstat (limited to 'pandora')
-rw-r--r--pandora/clientbuilder.py3
-rw-r--r--pandora/errors.py5
-rw-r--r--pandora/models/_base.py9
3 files changed, 8 insertions, 9 deletions
diff --git a/pandora/clientbuilder.py b/pandora/clientbuilder.py
index 2b11ffb..5adebd1 100644
--- a/pandora/clientbuilder.py
+++ b/pandora/clientbuilder.py
@@ -226,8 +226,7 @@ class PydoraConfigFileBuilder(FileBasedClientBuilder):
226 226
227 227
228class PianobarSettingsDict(TranslatingDict): 228class PianobarSettingsDict(TranslatingDict):
229 """Pianobar Translating Dictionary 229 """Pianobar Translating Dictionary"""
230 """
231 230
232 KEY_TRANSLATIONS = { 231 KEY_TRANSLATIONS = {
233 "DECRYPT_PASSWORD": "DECRYPTION_KEY", 232 "DECRYPT_PASSWORD": "DECRYPTION_KEY",
diff --git a/pandora/errors.py b/pandora/errors.py
index 3b03db2..f240e0f 100644
--- a/pandora/errors.py
+++ b/pandora/errors.py
@@ -89,7 +89,10 @@ class PandoraException(Exception):
89 exception = type( 89 exception = type(
90 name, 90 name,
91 (PandoraException,), 91 (PandoraException,),
92 {"code": code, "message": api_message,}, 92 {
93 "code": code,
94 "message": api_message,
95 },
93 ) 96 )
94 97
95 export_to[name] = __API_EXCEPTIONS__[code] = exception 98 export_to[name] = __API_EXCEPTIONS__[code] = exception
diff --git a/pandora/models/_base.py b/pandora/models/_base.py
index 8904be1..c39050b 100644
--- a/pandora/models/_base.py
+++ b/pandora/models/_base.py
@@ -98,8 +98,7 @@ class PandoraModel(metaclass=ModelMetaClass):
98 98
99 @classmethod 99 @classmethod
100 def from_json_list(cls, api_client, data): 100 def from_json_list(cls, api_client, data):
101 """Convert a list of JSON values to a list of models 101 """Convert a list of JSON values to a list of models"""
102 """
103 return [cls.from_json(api_client, item) for item in data] 102 return [cls.from_json(api_client, item) for item in data]
104 103
105 def __init__(self, api_client): 104 def __init__(self, api_client):
@@ -147,15 +146,13 @@ class PandoraModel(metaclass=ModelMetaClass):
147 146
148 @classmethod 147 @classmethod
149 def from_json(cls, api_client, data): 148 def from_json(cls, api_client, data):
150 """Convert one JSON value to a model object 149 """Convert one JSON value to a model object"""
151 """
152 self = cls(api_client) 150 self = cls(api_client)
153 PandoraModel.populate_fields(api_client, self, data) 151 PandoraModel.populate_fields(api_client, self, data)
154 return self 152 return self
155 153
156 def _base_repr(self, and_also=None): 154 def _base_repr(self, and_also=None):
157 """Common repr logic for subclasses to hook 155 """Common repr logic for subclasses to hook"""
158 """
159 items = [ 156 items = [
160 "=".join((key, repr(getattr(self, key)))) 157 "=".join((key, repr(getattr(self, key))))
161 for key in sorted(self._fields.keys()) 158 for key in sorted(self._fields.keys())