Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions erply_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
"""
ErplyAPI
~~~~~~~~

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep existing empty lines in the docstrings. Please check PEP 257.

Simple Python wrapper for Erply API

:copyright: (c) 2014-2016 by Priit Laes
:license: BSD, see LICENSE for details.
"""
Expand Down Expand Up @@ -33,7 +31,6 @@ class ErplyException(Exception):
class ErplyAPILimitException(ErplyException):
"""Raised when Erply API limit (by default 1000 requests per hour) has
been exceeded.

:param server_time: Erply server time. Can be used to determine amount of
time until API accepts requests again.
"""
Expand Down Expand Up @@ -67,21 +64,26 @@ class Erply(object):
,'getEmployees'
,'getProducts'
,'getProductCategories'
,'getProductCostForSpecificAmount' # untested
,'getProductCostForSpecificAmount'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you test this API call?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

,'getProductGroups'
,'getProductPrices' # untested, broken ??
,'getProductPriorityGroups' # untested
,'getProductStock' # untested
,'getProductPrices'
,'getProductPriorityGroups'
,'getProductStock'
,'getProductUnits'
,'getPurchaseDocuments'
,'getReports'
,'getSalesDocuments'
,'getServices'
,'getWarehouses'
,'getAllowedWarehouses'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This list is supposed to be alphabetically ordered.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry For that

,'verifyUser'
,'getCampaigns'
,'getStocktakings'
,'getAccountStatements'
,'getCostOfGoodsSold'
)
ERPLY_CSV = ('getProductStockCSV', 'getSalesReport')
ERPLY_POST = ('saveProduct',)
ERPLY_CSV = ('getProductStockCSV', 'getSalesReport','getPurchaseReport')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alphabetic order please.

ERPLY_POST = ('saveProduct')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removed comma is needed as ERPLY_POST variable is filled with tuple of strings. With your change you turned it to just single string..


def __init__(self, auth, erply_api_url=None, wait_on_limit=False):
self.auth = auth
Expand Down Expand Up @@ -122,7 +124,6 @@ def api_url(self):

def _erply_query(self, data, _initial_response=None):
"""Send request to Erply API and parse response.

Returns two-tuple containing: `retry` and `data` values:
- `retry` is boolean specifying whether session token was expired
and signalling caller to request new session token and redo the
Expand Down