Skip to content

Commit

Permalink
Add Hound checks
Browse files Browse the repository at this point in the history
Fix flake8 problems
  • Loading branch information
MatMaul committed Oct 20, 2018
1 parent f81e957 commit b8e493b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .hound.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
flake8:
enabled: true
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
language: python
python:
- '3.4'
- '3.3'
- '2.7'

before_install:
- pip install pep8
- pip install flake8
script:
- find . -name \*.py -exec pep8 --max-line-length=120 {} +
- find pynetgear -name \*.py -exec flake8 --max-line-length=120 {} +
7 changes: 4 additions & 3 deletions pynetgear/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def autodetect_url():
verify=False)
if r.status_code == 200:
return url
except:
except requests.exceptions.RequestException:
pass

return None
Expand Down Expand Up @@ -397,8 +397,8 @@ def _get_soap_headers(service, method):

def _is_valid_response(resp):
return (resp.status_code == 200 and
("<ResponseCode>0000</ResponseCode>" in resp.text or
"<ResponseCode>000</ResponseCode>" in resp.text))
("<ResponseCode>0000</ResponseCode>" in resp.text or
"<ResponseCode>000</ResponseCode>" in resp.text))


def _is_unauthorized_response(resp):
Expand All @@ -414,6 +414,7 @@ def _convert(value, to_type, default=None):
# If value could not be converted
return default


SERVICE_PREFIX = "urn:NETGEAR-ROUTER:service:"
SERVICE_DEVICE_INFO = "DeviceInfo:1"
SERVICE_DEVICE_CONFIG = "DeviceConfig:1"
Expand Down
1 change: 1 addition & 0 deletions pynetgear/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ def main():
for i in devices:
print(i)


if __name__ == '__main__':
main()
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[metadata]
description-file = README.md

[flake8]
max-line-length = 120

0 comments on commit b8e493b

Please sign in to comment.