Skip to content

Commit

Permalink
Adhere PEP8 standards
Browse files Browse the repository at this point in the history
  • Loading branch information
Henk committed Nov 2, 2017
1 parent 79e00b4 commit fef8284
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions ssht/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def _load_data(self):
for row in c:
self._hosts.append(Host.factory(row))


class APIParser(Parser):
def __init__(self, *args, **kwargs):
super(APIParser, self).__init__(*args, **kwargs)
Expand All @@ -148,8 +149,9 @@ def _load_data(self):
logging.error(ex)
if 'headers' not in d['config']:
d['config']['headers'] = {}
req = requests.get(d['config']['url'],
headers=d['config']['headers'])
req = requests.get(
d['config']['url'],
headers=d['config']['headers'])
try:
res = req.json()
except ValueError as ex:
Expand Down
6 changes: 4 additions & 2 deletions ssht/ssht.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ def main(): # pragma: nocover
jsonparser = JsonParser(os.path.join(home_dir, '.ssht'))
mysqlparser = MySQLParser(os.path.join(home_dir, '.ssht'))
apiparser = APIParser(os.path.join(home_dir, '.ssht'))
hosts = jsonparser.search(args.name) + mysqlparser.search(args.name) \
+ apiparser.search(args.name)

hosts = jsonparser.search(args.name)
hosts.extend(mysqlparser.search(args.name))
hosts.extend(apiparser.search(args.name))
logging.info(hosts)

host = None
Expand Down

0 comments on commit fef8284

Please sign in to comment.