accsyn-python-api 2.1.0__tar.gz → 2.1.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.
Files changed (39) hide show
  1. accsyn-python-api-2.1.2/.github/workflows/github-actions-black.yml +11 -0
  2. accsyn-python-api-2.1.2/.gitignore +1 -0
  3. accsyn-python-api-2.1.2/.pre-commit-config.yaml +6 -0
  4. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/PKG-INFO +1 -1
  5. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/doc/jobs.rst +1 -1
  6. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/doc/release_notes.rst +1 -0
  7. accsyn-python-api-2.1.2/pyproject.toml +3 -0
  8. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/setup.py +1 -2
  9. accsyn-python-api-2.1.2/source/accsyn_api/_version.py +4 -0
  10. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/source/accsyn_api/session.py +22 -7
  11. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/source/accsyn_python_api.egg-info/PKG-INFO +1 -1
  12. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/source/accsyn_python_api.egg-info/SOURCES.txt +4 -0
  13. accsyn-python-api-2.1.0/source/accsyn_api/_version.py +0 -4
  14. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/README.md +0 -0
  15. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/doc/_static/accsyn.css +0 -0
  16. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/doc/api_reference/index.rst +0 -0
  17. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/doc/api_reference/session.rst +0 -0
  18. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/doc/clients.rst +0 -0
  19. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/doc/compute.rst +0 -0
  20. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/doc/conf.py +0 -0
  21. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/doc/datatypes.rst +0 -0
  22. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/doc/file.rst +0 -0
  23. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/doc/glossary.rst +0 -0
  24. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/doc/index.rst +0 -0
  25. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/doc/installing.rst +0 -0
  26. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/doc/introduction.rst +0 -0
  27. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/doc/misc.rst +0 -0
  28. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/doc/publish.rst +0 -0
  29. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/doc/queues.rst +0 -0
  30. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/doc/requirements.txt +0 -0
  31. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/doc/shares.rst +0 -0
  32. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/doc/users.rst +0 -0
  33. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/doc/using.rst +0 -0
  34. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/readthedocs.yaml +0 -0
  35. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/setup.cfg +0 -0
  36. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/source/accsyn_api/__init__.py +0 -0
  37. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/source/accsyn_python_api.egg-info/dependency_links.txt +0 -0
  38. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/source/accsyn_python_api.egg-info/requires.txt +0 -0
  39. {accsyn-python-api-2.1.0 → accsyn-python-api-2.1.2}/source/accsyn_python_api.egg-info/top_level.txt +0 -0
@@ -0,0 +1,11 @@
1
+ name: black-action
2
+ on: [push, pull_request]
3
+ jobs:
4
+ linter_name:
5
+ name: runner / black formatter
6
+ runs-on: ubuntu-latest
7
+ steps:
8
+ - uses: actions/checkout@v2
9
+ - uses: rickstaa/action-black@v1
10
+ with:
11
+ black_args: "--check -l 119 --skip-string-normalization ."
@@ -0,0 +1 @@
1
+ *.pyc
@@ -0,0 +1,6 @@
1
+ repos:
2
+ - repo: https://github.com/psf/black
3
+ rev: stable
4
+ hooks:
5
+ - id: black
6
+ language_version: python3.7
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: accsyn-python-api
3
- Version: 2.1.0
3
+ Version: 2.1.2
4
4
  Summary: A Python API for accsyn programmable fast and secure data delivery software
5
5
  Home-page: https://github.com/accsyn/accsyn-python-api.git
6
6
  Author: Henrik Norin
@@ -186,7 +186,7 @@ If successful, a list of dictionaries is returned on the same form as returned b
186
186
 
187
187
  .. note::
188
188
 
189
- For more examples of the accsyn jobmit syntax, see: `https://https://support.accsyn.com/job-specification <https://support.accsyn.com/job-specification>`_.
189
+ For more examples of the accsyn jobmit syntax, see: `https://support.accsyn.com/job-specification <https://support.accsyn.com/job-specification>`_.
190
190
 
191
191
  Modify
192
192
  ======
@@ -13,6 +13,7 @@ Release Notes
13
13
 
14
14
  `https://support.accsyn.com <https://support.accsyn.com>`_.
15
15
 
16
+
16
17
  .. release:: 2.1.0
17
18
  :date: 2022-12-02
18
19
 
@@ -0,0 +1,3 @@
1
+ [tool.black]
2
+ line-length = 119
3
+ skip-string-normalization = true
@@ -1,12 +1,11 @@
1
1
  import setuptools
2
2
 
3
3
  with open("README.md", "r") as fh:
4
-
5
4
  long_description = fh.read()
6
5
 
7
6
  setuptools.setup(
8
7
  name='accsyn-python-api',
9
- version='2.1.0',
8
+ version='2.1.2',
10
9
  package_dir={'': 'source'},
11
10
  packages=['accsyn_api'],
12
11
  setup_requires=[
@@ -0,0 +1,4 @@
1
+ # :coding: utf-8
2
+ # :copyright: Copyright (c) 2015-2023 accsyn/HDR AB
3
+
4
+ __version__ = "2.1.2-0"
@@ -26,11 +26,9 @@ import requests
26
26
  from ._version import __version__
27
27
 
28
28
  if sys.version_info.major >= 3:
29
-
30
29
  import io
31
30
 
32
31
  else:
33
-
34
32
  # Python 2 backward compability
35
33
  import binascii
36
34
 
@@ -115,10 +113,21 @@ class JSONDecoder(json.JSONDecoder):
115
113
  class Session(object):
116
114
  """accsyn API session object."""
117
115
 
116
+ DEFAULT_CONNECT_TIMEOUT = 10 # Wait 10 seconds for connection
117
+ DEFAULT_TIMEOUT = 2 * 60 # Wait 2 minutes for response
118
+
118
119
  @property
119
120
  def username(self):
120
121
  return self._username
121
122
 
123
+ @property
124
+ def timeout(self):
125
+ return self._timeout
126
+
127
+ @property
128
+ def connect_timeout(self):
129
+ return self._connect_timeout
130
+
122
131
  def __init__(
123
132
  self,
124
133
  domain=None,
@@ -133,6 +142,8 @@ class Session(object):
133
142
  pretty_json=False,
134
143
  dev=False,
135
144
  path_logfile=None,
145
+ timeout=None,
146
+ connect_timeout=None,
136
147
  ):
137
148
  """
138
149
  Initiate a new API session object. Throws exception upon authentication failure.
@@ -149,6 +160,8 @@ class Session(object):
149
160
  :param pretty_json: (verbose) Print pretty formatted JSON.
150
161
  :param dev: Dev mode.
151
162
  :param path_logfile: Output all log messages to this logfile instead of stdout.
163
+ :param timeout: Timeout in seconds for API calls - waiting for response.
164
+ :param connect_timeout: Timeout in seconds for API calls - waiting for connection.
152
165
  """
153
166
  # Generate a session ID
154
167
  self.__version__ = __version__
@@ -159,7 +172,7 @@ class Session(object):
159
172
  self._be_verbose = verbose
160
173
  self._pretty_json = pretty_json
161
174
  self._proxy = proxy
162
- self._dev = dev
175
+ self._dev = dev is True or os.environ.get('ACCSYN_DEV', 'false') in ['true', '1']
163
176
  Session._p_logfile = path_logfile
164
177
  self._clearance = CLEARANCE_NONE
165
178
  self._verbose("Creating accsyn Python API session (v{})".format(__version__))
@@ -226,6 +239,8 @@ class Session(object):
226
239
  ACCSYN_CLOUD_DOMAIN,
227
240
  )
228
241
  self._last_message = None
242
+ self._timeout = timeout or Session.DEFAULT_TIMEOUT
243
+ self._connect_timeout = connect_timeout or Session.DEFAULT_CONNECT_TIMEOUT
229
244
  self.login()
230
245
 
231
246
  @staticmethod
@@ -960,6 +975,7 @@ class Session(object):
960
975
  """
961
976
  if data is None or not isinstance(data, list):
962
977
  raise accsynException("None or empty data supplied!")
978
+
963
979
  # Check entries, calculate size
964
980
  def recursive_get_size(files):
965
981
  result = 0
@@ -1152,7 +1168,7 @@ class Session(object):
1152
1168
  ssl = False
1153
1169
  if self._dev and (uri or "").find("registry") != 0:
1154
1170
  ssl = False
1155
- port = 80
1171
+ port = 8181
1156
1172
  if proxy_type == "accsyn":
1157
1173
  if proxy_port == -1:
1158
1174
  proxy_port = 80
@@ -1178,13 +1194,12 @@ class Session(object):
1178
1194
  ("/" if not uri.startswith("/") else "") + uri,
1179
1195
  )
1180
1196
  if timeout is None:
1181
- timeout = 999999
1197
+ timeout = self.timeout
1182
1198
  if data is None:
1183
1199
  data = {}
1184
1200
  # Wait 10s to reach machine, 2min for it to send back data
1185
- CONNECT_TO, READ_TO = (10, 2 * 60)
1201
+ CONNECT_TO, READ_TO = (self.connect_timeout, timeout)
1186
1202
  r = None
1187
- initial_timeout = timeout
1188
1203
  for iteration in range(0, 2):
1189
1204
  if headers:
1190
1205
  headers_effective = copy.deepcopy(headers)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: accsyn-python-api
3
- Version: 2.1.0
3
+ Version: 2.1.2
4
4
  Summary: A Python API for accsyn programmable fast and secure data delivery software
5
5
  Home-page: https://github.com/accsyn/accsyn-python-api.git
6
6
  Author: Henrik Norin
@@ -1,7 +1,11 @@
1
+ .gitignore
2
+ .pre-commit-config.yaml
1
3
  README.md
4
+ pyproject.toml
2
5
  readthedocs.yaml
3
6
  setup.cfg
4
7
  setup.py
8
+ .github/workflows/github-actions-black.yml
5
9
  doc/clients.rst
6
10
  doc/compute.rst
7
11
  doc/conf.py
@@ -1,4 +0,0 @@
1
- # :coding: utf-8
2
- # :copyright: Copyright (c) 2015-2022 accsyn/HDR AB
3
-
4
- __version__ = "2.1.0-1"