aboutsummaryrefslogtreecommitdiff
path: root/pandora/clientbuilder.py
diff options
context:
space:
mode:
Diffstat (limited to 'pandora/clientbuilder.py')
-rw-r--r--pandora/clientbuilder.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/pandora/clientbuilder.py b/pandora/clientbuilder.py
index 1464d5c..6c29678 100644
--- a/pandora/clientbuilder.py
+++ b/pandora/clientbuilder.py
@@ -129,7 +129,6 @@ class SettingsDict(TranslatingDict):
129 VALUE_TRANSLATIONS = {} 129 VALUE_TRANSLATIONS = {}
130 130
131 def was_translated(self, from_key, to_key): 131 def was_translated(self, from_key, to_key):
132 # TODO: Notify of deprecations
133 pass 132 pass
134 133
135 134
@@ -174,6 +173,9 @@ class FileBasedClientBuilder(APIClientBuilder):
174 def path(self, path): 173 def path(self, path):
175 self._path = os.path.expanduser(path) 174 self._path = os.path.expanduser(path)
176 175
176 def parse_config(self):
177 raise NotImplementedError
178
177 def build(self): 179 def build(self):
178 if not self.file_exists: 180 if not self.file_exists:
179 raise IOError("File not found: {}".format(self.path)) 181 raise IOError("File not found: {}".format(self.path))
@@ -204,8 +206,8 @@ class PydoraConfigFileBuilder(FileBasedClientBuilder):
204 def parse_config(self): 206 def parse_config(self):
205 cfg = ConfigParser() 207 cfg = ConfigParser()
206 208
207 with open(self.path) as fp: 209 with open(self.path) as file:
208 cfg.read_file(fp) 210 cfg.read_file(file)
209 211
210 settings = PydoraConfigFileBuilder.cfg_to_dict(cfg, "api") 212 settings = PydoraConfigFileBuilder.cfg_to_dict(cfg, "api")
211 settings["user"] = PydoraConfigFileBuilder.cfg_to_dict( 213 settings["user"] = PydoraConfigFileBuilder.cfg_to_dict(
@@ -242,8 +244,8 @@ class PianobarConfigFileBuilder(FileBasedClientBuilder):
242 def parse_config(self): 244 def parse_config(self):
243 settings = PianobarSettingsDict() 245 settings = PianobarSettingsDict()
244 246
245 with open(self.path, "r") as fp: 247 with open(self.path, "r") as file:
246 for line in fp.readlines(): 248 for line in file.readlines():
247 line = line.strip() 249 line = line.strip()
248 250
249 if line and not line.startswith("#"): 251 if line and not line.startswith("#"):