Skip to content

Commit

Permalink
move keyword only args to kwargs for py2 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
davidism committed Aug 14, 2015
1 parent 1467776 commit d2e186b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
8 changes: 3 additions & 5 deletions mcafee_epo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
except ImportError:
from urllib.parse import urljoin

__version__ = '1.0.2'


class APIError(Exception):
"""Represents an error with the data received within a valid HTTP response."""
Expand Down Expand Up @@ -81,7 +79,7 @@ def _request(self, name, **kwargs):

return json.loads(text[3:]) if is_json else text[3:]

def __call__(self, name, params=None, files=None, *args, **kwargs):
def __call__(self, name, *args, **kwargs):
"""Make an API call by calling this instance.
Collects arguments and calls :meth:`_request`.
Expand All @@ -100,8 +98,8 @@ def __call__(self, name, params=None, files=None, *args, **kwargs):
:return: deserialized JSON data
"""

if params is None:
params = {}
params = kwargs.pop('params', {})
files = kwargs.pop('files', {})

for i, item in enumerate(args, start=1):
params['param{}'.format(i)] = item
Expand Down
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ tag_build = .dev0

[aliases]
release = egg_info -RDb ''

[bdist_wheel]
universal = 1
7 changes: 1 addition & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
#!/usr/bin/env python
import os
import re
from setuptools import setup

with open(os.path.join(os.path.dirname(__file__), 'mcafee_epo.py')) as f:
version = re.search(r"__version__ = '(.*)'", f.read()).group(1)

setup(
name='mcafee-epo',
version=version,
version='1.0.3',
url='https://bitbucket.org/davidism/mcafee-epo',
license='BSD',
author='David Lord',
Expand Down

0 comments on commit d2e186b

Please sign in to comment.