Skip to content

Commit

Permalink
v1.3.3 update
Browse files Browse the repository at this point in the history
- Fix Team_V3.get_workdiaries - parameters were not sent
- Default `timeout` parameter for urllib3 has been set to the maximum 8 seconds
- The `retries` parameter for urllib3 has been set to `False`
  • Loading branch information
mnovozhylov committed Jun 17, 2019
1 parent c2e8c81 commit 31bc917
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
8 changes: 8 additions & 0 deletions changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
Changelog
***************

.. _1.3.3:

Version 1.3.3
-------------
* Fix Team_V3.get_workdiaries - parameters were not sent
* Default `timeout` parameter for urllib3 has been set to the maximum 8 seconds
* The `retries` parameter for urllib3 has been set to `False`

.. _1.3.2:

Version 1.3.2
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
README = readme.read()
readme.close()

VERSION = (1, 3, 2, 0, 0)
VERSION = (1, 3, 3, 0, 0)


def get_version():
Expand Down
2 changes: 1 addition & 1 deletion upwork/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"""

VERSION = '1.3.2'
VERSION = '1.3.3'


def get_version():
Expand Down
8 changes: 4 additions & 4 deletions upwork/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ class Client(object):
Whether to attach
:py:mod:`upwork.routers.job` router
:timeout: (optional, default ``3 secs``)
:timeout: (optional, default ``8 secs``)
Socket operations timeout.
"""

def __init__(self, public_key, secret_key,
oauth_access_token=None, oauth_access_token_secret=None,
fmt='json', finreport=True, hr=True, messages=True,
offers=True, provider=True, task=True, team=True,
timereport=True, job=True, timeout=3):
timereport=True, job=True, timeout=8):

self.public_key = public_key
self.secret_key = secret_key
Expand All @@ -117,8 +117,8 @@ def __init__(self, public_key, secret_key,
self.http = urllib3.PoolManager(
cert_reqs='CERT_REQUIRED',
ca_certs=ca_certs_locater.get(),
timeout=int(timeout),
retries=Retry(2, backoff_factor=0.5)
timeout=urllib3.Timeout(connect=0.5, read=float(timeout)),
retries=False
)

self.oauth_access_token = oauth_access_token
Expand Down
8 changes: 4 additions & 4 deletions upwork/routers/team.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ def get_workdiaries(self, team_id, date, sort_by=None, activity=None, freelancer
"""
url = 'workdiaries/companies/{0}/{1}'.format(team_id, date)
result = self.get(url)
if 'error' in result:
return result

data = {}

if sort_by:
Expand All @@ -109,6 +105,10 @@ def get_workdiaries(self, team_id, date, sort_by=None, activity=None, freelancer
if paging:
data['paging'] = paging

result = self.get(url, data)
if 'error' in result:
return result

snapshots = result.get('data', data)
if not isinstance(snapshots, list):
snapshots = [snapshots]
Expand Down

0 comments on commit 31bc917

Please sign in to comment.