Skip to content

Commit

Permalink
added landscape, removed pypi counter for now
Browse files Browse the repository at this point in the history
  • Loading branch information
lehins committed Aug 26, 2014
1 parent 7c1a99a commit 4a3be66
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .landscape.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
doc-warnings: yes
test-warnings: no
strictness: high
12 changes: 5 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ python-wepay: Python WePay SDK (third party)
:target: https://coveralls.io/r/lehins/python-wepay?branch=master
:alt: Tests Coverage

.. image:: https://pypip.in/d/python-wepay/badge.png
:target: https://crate.io/packages/python-wepay/
:alt: Number of PyPI downloads

.. image:: https://landscape.io/github/lehins/python-wepay/master/landscape.png
:target: https://landscape.io/github/lehins/python-wepay/master
:alt: Code Health

Features
--------
Expand Down Expand Up @@ -49,9 +48,8 @@ This package started as a part of `Django WePay Application
useful to other developers in Python community that do not use `Django
<https://djangoproject.com>`_. Originally it meant to be an extension of an
official `Python WePay SDK <https://github.com/wepay/Python-SDK>`_, but instead
it became a replacement with full compatibilty with official WePay version.
This package is also listed as a `third party Python SDK on WePay
<https://www.wepay.com/developer/resources/sdks>`_.
it became a replacement. This package is also listed as a `third party Python
SDK on WePay <https://www.wepay.com/developer/resources/sdks>`_.

Status
------
Expand Down
10 changes: 4 additions & 6 deletions wepay/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
.. moduleauthor:: lehins <lehins@yandex.ru>
:platform: independent
"""
import warnings

from wepay.calls import *
from wepay.utils import Post, cached_property

Expand Down Expand Up @@ -115,8 +113,8 @@ def user(self):

@cached_property
def account(self):
""":class:`Account<wepay.calls.account.Account>` call instance"""
return Account(self)
""":class:`Account<wepay.calls.account.Account>` call instance"""
return Account(self)


@cached_property
Expand Down Expand Up @@ -154,8 +152,8 @@ def subscription_plan(self):

@cached_property
def subscription(self):
""":class:`Subscription<wepay.calls.subscription.Subscription>` call instance"""
return Subscription(self)
""":class:`Subscription<wepay.calls.subscription.Subscription>` call instance"""
return Subscription(self)


@cached_property
Expand Down
9 changes: 7 additions & 2 deletions wepay/calls/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ class Call(object):
_api = None
floating = ['amount', 'app_fee', 'shipping_fee', 'setup_fee']

@property
def call_name(self):
raise NotImplementedError("call_name is required")

def __init__(self, api):
self._api = api


def _update_params(self, params, extra_kwargs, control_keywords):
if control_keywords is None:
control_keywords = ['access_token', 'batch_mode']
Expand Down Expand Up @@ -79,11 +84,11 @@ def make_call(self, func, params, extra_kwargs):
'call': uri
}
access_token = control_kwargs.get('access_token', None)
if not access_token is None:
if access_token is not None:
call['authorization'] = access_token
if params:
call['parameters'] = params
if not control_kwargs['reference_id'] is None:
if control_kwargs.get('reference_id', None) is not None:
call['reference_id'] = control_kwargs['reference_id']
return call
return self._api.call(uri, params=params, **control_kwargs)
1 change: 0 additions & 1 deletion wepay/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import warnings

__all__ = [
'WePayWarning', 'WePayError', 'WePayHTTPError', 'WePayClientError',
Expand Down

0 comments on commit 4a3be66

Please sign in to comment.