polyswarm-api 3.13.0__tar.gz → 3.13.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: polyswarm-api
3
- Version: 3.13.0
3
+ Version: 3.13.2
4
4
  Summary: Client library to simplify interacting with the PolySwarm consumer API
5
5
  Home-page: https://github.com/polyswarm/polyswarm-api
6
6
  Author: PolySwarm Developers
@@ -9,7 +9,7 @@ with open('README.md', 'r') as readme:
9
9
 
10
10
  setup(
11
11
  name='polyswarm-api',
12
- version='3.13.0',
12
+ version='3.13.2',
13
13
  description='Client library to simplify interacting with the PolySwarm consumer API',
14
14
  long_description=long_description,
15
15
  long_description_content_type='text/markdown',
@@ -1,5 +1,5 @@
1
1
  # https://www.python.org/dev/peps/pep-0008/#module-level-dunder-names
2
- __version__ = '3.13.0'
2
+ __version__ = '3.13.2'
3
3
  __release_url__ = 'https://api.github.com/repos/polyswarm/polyswarm-api/releases/latest'
4
4
 
5
5
  from . import api
@@ -996,14 +996,15 @@ class PolyswarmAPI:
996
996
  sandbox_task_id=sandbox_task_id,
997
997
  template_id=template_id,
998
998
  template_metadata=template_metadata,
999
+ community=self.community,
999
1000
  **kwargs).result()
1000
1001
  return report
1001
1002
 
1002
1003
  def report_get(self, id, **kwargs):
1003
- return resources.ReportTask.get(self, id=id, **kwargs).result()
1004
+ return resources.ReportTask.get(self, id=id, community=self.community, **kwargs).result()
1004
1005
 
1005
1006
  def report_download(self, report_id, folder):
1006
- report = resources.ReportTask.get(self, id=report_id).result()
1007
+ report = self.report_get(id=report_id)
1007
1008
  if report.state == 'PENDING':
1008
1009
  raise exceptions.InvalidValueException('Report is in PENDING state, wait for completion first')
1009
1010
  if report.state == 'FAILED':
@@ -148,6 +148,8 @@ class PolyswarmRequest(object):
148
148
  raise exceptions.UsageLimitsExceededException(self, message)
149
149
  elif self.status_code == 404:
150
150
  raise exceptions.NotFoundException(self, self._result)
151
+ elif self.status_code == 422:
152
+ raise exceptions.FailedInstanceException(self, self._result)
151
153
  else:
152
154
  raise exceptions.RequestException(self, self._bad_status_message())
153
155
  elif self.status_code == 204:
@@ -36,6 +36,10 @@ class NoResultsException(RequestException):
36
36
  pass
37
37
 
38
38
 
39
+ class FailedInstanceException(RequestException):
40
+ pass
41
+
42
+
39
43
  #########################################
40
44
  # Types layer exceptions
41
45
  #########################################
@@ -31,11 +31,6 @@ class Engine(core.BaseJsonResource):
31
31
  self.id = str(content['id'])
32
32
  self.name = content['name']
33
33
 
34
- try:
35
- self.address = content['address'].lower()
36
- except:
37
- self.address = None
38
-
39
34
  account_number = content.get('accountNumber')
40
35
  self.account_number = str(account_number) if account_number else None
41
36
 
@@ -67,10 +62,9 @@ class Engine(core.BaseJsonResource):
67
62
  return self.id == other.id if isinstance(other, Engine) else False
68
63
 
69
64
  def __repr__(self):
70
- return '{}(name={}, address={}, status={}, engine_type={})'.format(
65
+ return '{}(name={}, status={}, engine_type={})'.format(
71
66
  self.__class__.__name__,
72
67
  self.name,
73
- self.address,
74
68
  self.status,
75
69
  self.engine_type,
76
70
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: polyswarm-api
3
- Version: 3.13.0
3
+ Version: 3.13.2
4
4
  Summary: Client library to simplify interacting with the PolySwarm consumer API
5
5
  Home-page: https://github.com/polyswarm/polyswarm-api
6
6
  Author: PolySwarm Developers
File without changes
File without changes
File without changes