Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
andreygrechin committed May 27, 2018
2 parents 05da73e + 5c72b7a commit abfed53
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 37 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ clear-doc:

.PHONY: clear-pyc
clear-pyc:
find . -type d -name '__pycache__' -exec rm -rf {} +
find . -type f -name '*.py[co]' -exec rm -f {} +
find . -type f -name '*~' -exec rm -f {} +
find . -type d -name '__pycache__' -not -path './venv/*' -exec rm -rf {} +
find . -type f -name '*.py[co]' -not -path './venv/*' -exec rm -f {} +
find . -type f -name '*~' -not -path './venv/*' -exec rm -f {} +

.PHONY: clear-cov
clear-cov:
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Examples:
umbrella add example.com example.com --force
umbrella del www.example.com
umbrella del 555XXXXX --key YOUR-CUSTOMER-KEY-IS-HERE-0123456789
umbrella get-list 100
umbrella get 100
umbrella get --key YOUR-CUSTOMER-KEY-IS-HERE-0123456789
Use API wrapper
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
logzero>=1.3.1
logzero~=1.5.0
requests~=2.18
keyring>=11.0.0
keyring~=12.0
22 changes: 11 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,27 +49,27 @@
keywords="cisco umbrella opendns security",
packages=["umbr_api"],
install_requires=[
"requests >= 2.18",
"logzero >= 1.3.1",
"keyring >= 11.0.0",
"requests ~= 2.18",
"logzero ~= 1.5",
"keyring ~= 12.0",
],
extras_require={
"dev": [
"coverage>=4.5.1",
"pytest>=3.4.1",
"setuptools>=38.5.1",
"twine>=1.9.1",
"pytest>=3.6.0",
"setuptools>=39.2.0",
"twine>=1.11.0",
],
"doc": [
"Sphinx>=1.7.1",
"sphinx_rtd_theme>=0.2.4",
"Sphinx>=1.7.4",
"sphinx_rtd_theme>=0.3.1",
],
"dev_lint": [
"autopep8>=1.3.4",
"autopep8>=1.3.5",
"pep257>=0.7.0",
"pycodestyle>=2.3.1",
"pycodestyle>=2.4.0",
"pydocstyle>=2.1.1",
"pylint>=1.8.2",
"pylint>=1.9.1",
],
},
package_data={
Expand Down
38 changes: 19 additions & 19 deletions umbr_api/__about__.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/usr/bin/env python3
"""Configure package wide attributes."""

__all__ = (
'__title__', '__summary__', '__uri__', '__version__', '__author__',
'__email__', '__license__', '__copyright__',
)

__title__ = 'umbr_api'
__summary__ = 'Cisco Umbrella Enforcement API wrapper and command-line utility'
__uri__ = 'https://github.com/kolatz/umbr_api'

__version__ = '0.4.post1'

__author__ = 'kolatz'
__email__ = 'private@example.com'

__license__ = 'MIT'
__copyright__ = 'Copyright 2018 %s' % __author__
#!/usr/bin/env python3
"""Configure package wide attributes."""

__all__ = (
'__title__', '__summary__', '__uri__', '__version__', '__author__',
'__email__', '__license__', '__copyright__',
)

__title__ = 'umbr_api'
__summary__ = 'Cisco Umbrella Enforcement API wrapper and command-line utility'
__uri__ = 'https://github.com/kolatz/umbr_api'

__version__ = '0.4.1'

__author__ = 'kolatz'
__email__ = 'private@example.com'

__license__ = 'MIT'
__copyright__ = 'Copyright 2018 %s' % __author__
2 changes: 2 additions & 0 deletions umbr_api/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ def format_response(response):
for key, value in json_response.items():
logger.error('%s %s', key, value)
except KeyError as msg:
print('Get abnormal code while adding:',
response.status_code)
logger.exception(msg)


Expand Down
1 change: 1 addition & 0 deletions umbr_api/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def format_response(code, json_response):
for key, value in json_response.items():
logger.error('%s %s', key, value)
except KeyError as msg:
print('Get abnormal code while read:', code)
logger.exception(msg)


Expand Down
2 changes: 1 addition & 1 deletion umbr_api/umbrella.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from umbr_api.add import add
from umbr_api.remove import remove

LOG_FORMAT = '%(asctime)s.%(msecs)03d %(module)13s[%(lineno)4d] ' \
LOG_FORMAT = '%(asctime)s.%(msecs)03d %(module)14s[%(lineno)4d] ' \
+ '%(threadName)10s %(color)s%(levelname)8s%(end_color)s ' \
+ '%(message)s'

Expand Down

0 comments on commit abfed53

Please sign in to comment.