accsyn-python-api 3.0.2__tar.gz → 3.0.3__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-3.0.2 → accsyn-python-api-3.0.3}/PKG-INFO +1 -1
  2. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/doc/misc.rst +3 -3
  3. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/doc/release_notes.rst +12 -0
  4. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/setup.py +1 -1
  5. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/source/accsyn_api/session.py +33 -12
  6. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/source/accsyn_python_api.egg-info/PKG-INFO +1 -1
  7. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/.github/workflows/github-actions-black.yml +0 -0
  8. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/.gitignore +0 -0
  9. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/.pre-commit-config.yaml +0 -0
  10. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/.readthedocs.yaml +0 -0
  11. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/README.md +0 -0
  12. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/doc/_static/accsyn.css +0 -0
  13. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/doc/api_reference/index.rst +0 -0
  14. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/doc/api_reference/session.rst +0 -0
  15. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/doc/clients.rst +0 -0
  16. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/doc/conf.py +0 -0
  17. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/doc/datatypes.rst +0 -0
  18. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/doc/file.rst +0 -0
  19. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/doc/glossary.rst +0 -0
  20. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/doc/index.rst +0 -0
  21. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/doc/installing.rst +0 -0
  22. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/doc/introduction.rst +0 -0
  23. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/doc/jobs.rst +0 -0
  24. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/doc/publish.rst +0 -0
  25. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/doc/queues.rst +0 -0
  26. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/doc/render.rst +0 -0
  27. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/doc/requirements.txt +0 -0
  28. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/doc/shares.rst +0 -0
  29. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/doc/users.rst +0 -0
  30. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/doc/using.rst +0 -0
  31. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/pyproject.toml +0 -0
  32. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/readthedocs.yaml +0 -0
  33. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/setup.cfg +0 -0
  34. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/source/accsyn_api/__init__.py +0 -0
  35. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/source/accsyn_api/_version.py +0 -0
  36. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/source/accsyn_python_api.egg-info/SOURCES.txt +0 -0
  37. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/source/accsyn_python_api.egg-info/dependency_links.txt +0 -0
  38. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/source/accsyn_python_api.egg-info/requires.txt +0 -0
  39. {accsyn-python-api-3.0.2 → accsyn-python-api-3.0.3}/source/accsyn_python_api.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: accsyn-python-api
3
- Version: 3.0.2
3
+ Version: 3.0.3
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
@@ -20,11 +20,11 @@ Will return a string with your session key.
20
20
 
21
21
 
22
22
 
23
- Check if GUI or server is running::
23
+ Check if the accsyn app or daemon (user server) is running on the same machine and same user ID::
24
24
 
25
- session.gui_is_running()
25
+ session.app_is_running()
26
26
 
27
- session.server_is_running()
27
+ session.daemon_is_running()
28
28
 
29
29
  Will return True if GUI/Server is running, False if offline, None if not installed/detected.
30
30
 
@@ -13,6 +13,18 @@ Release Notes
13
13
 
14
14
  `https://support.accsyn.com <https://support.accsyn.com>`_.
15
15
 
16
+ .. release:: 3.0.3
17
+ :date: 2024-11-26
18
+
19
+ .. change:: changed
20
+
21
+ * Replaced 'gui_is_running' and 'app_is_running' with 'app_is_running' and 'deamon_is_running', keeping the old names for backwards compatibility.
22
+ * 'daemon_is_running' now properly checks for user clients on the same machine being of type server(workspace context) or user server (run by user daemon host).
23
+
24
+ .. change:: fix
25
+
26
+ * Fixed site query bug.
27
+
16
28
  .. release:: 3.0.2
17
29
  :date: 2024-11-18
18
30
 
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name='accsyn-python-api',
8
- version='3.0.2',
8
+ version='3.0.3',
9
9
  package_dir={'': 'source'},
10
10
  packages=['accsyn_api'],
11
11
  setup_requires=[
@@ -55,6 +55,18 @@ CLEARANCE_STANDARD = "standard"
55
55
  CLEARANCE_CLIENT = CLEARANCE_STANDARD # BWCOMP
56
56
  CLEARANCE_NONE = "none"
57
57
 
58
+ CLIENT_TYPE_APP = 0
59
+ CLIENT_TYPE_SERVER = 1
60
+ CLIENT_TYPE_USERSERVER = 2
61
+ CLIENT_TYPE_BROWSER = 3
62
+ CLIENT_TYPE_COMPUTE_LANE = 4
63
+ CLIENT_TYPE_ACCSYN_VPX = 5
64
+
65
+ CLIENT_STATE_INIT = "init"
66
+ CLIENT_STATE_ONLINE = "online"
67
+ CLIENT_STATE_OFFLINE = "offline"
68
+ CLIENT_STATE_DISABLED = "disabled"
69
+ CLIENT_STATE_DISABLED_OFFLINE = "disabled-offline"
58
70
 
59
71
  class JSONEncoder(json.JSONEncoder):
60
72
  """JSON serialiser."""
@@ -430,7 +442,7 @@ class Session(object):
430
442
  data["skip"] = skip
431
443
  if attributes:
432
444
  data["attributes"] = attributes
433
- d = self._event("GET", "%s/find" % uri_base, data, query=d.get("expression"))
445
+ d = self._event("GET", "{}/find".format(uri_base), data, query=d.get("expression"))
434
446
  if d:
435
447
  retval = d["result"]
436
448
  return retval
@@ -1001,8 +1013,14 @@ class Session(object):
1001
1013
  return self._event("GET", "user/api_key", {})["api_key"]
1002
1014
 
1003
1015
  def gui_is_running(self):
1016
+ """ Backward compability """
1017
+ return self.app_is_running()
1018
+
1019
+ def app_is_running(self):
1004
1020
  """
1005
- Check if a GUI is running on the same machine (hostname match) and with same username.
1021
+ Check if the accsyn desktop app is running on the same machine (code/hostname match) and with same user ID.
1022
+
1023
+ Equivalent to do client query with user, code and type.
1006
1024
 
1007
1025
  :return: True if found, False otherwise.
1008
1026
  """
@@ -1010,19 +1028,25 @@ class Session(object):
1010
1028
  "GET",
1011
1029
  "client/find",
1012
1030
  {},
1013
- query="user={0} AND code={1} AND type={2}".format(self._uid, Session.get_hostname(), 0),
1031
+ query="user={0} AND code={1} AND type={2}".format(self._uid, Session.get_hostname(), CLIENT_TYPE_APP),
1014
1032
  )["result"]
1015
1033
  retval = None
1016
1034
  if 0 < len(result):
1017
1035
  for c in result:
1018
- retval = c["status"] in ["online", "disabled"]
1036
+ retval = c["status"] in [CLIENT_STATE_ONLINE, CLIENT_STATE_DISABLED]
1019
1037
  if retval is True:
1020
1038
  break
1021
1039
  return retval
1022
1040
 
1023
1041
  def server_is_running(self):
1042
+ """ Backward compatibility """
1043
+ return self.daemon_is_running()
1044
+
1045
+ def daemon_is_running(self):
1024
1046
  """
1025
- Check if a server is running on the same machine with same username.
1047
+ Check if a daemon is running on the same machine (code/hostname match) with same user ID.
1048
+
1049
+ Equivalent to do client query with user, code and type.
1026
1050
 
1027
1051
  :return: True if found, False otherwise.
1028
1052
  """
@@ -1030,12 +1054,13 @@ class Session(object):
1030
1054
  "GET",
1031
1055
  "client/find",
1032
1056
  {},
1033
- query="user={0} AND code={1} AND type!={2}".format(self._uid, Session.get_hostname(), 0),
1057
+ query="user={0} AND code={1} AND (type={2} OR type={3})".format(self._uid, Session.get_hostname(),
1058
+ CLIENT_TYPE_SERVER, CLIENT_TYPE_USERSERVER),
1034
1059
  )["result"]
1035
1060
  retval = None
1036
1061
  if 0 < len(result):
1037
1062
  for c in result:
1038
- retval = c["status"] in ["online", "disabled"]
1063
+ retval = c["status"] in [CLIENT_STATE_ONLINE, CLIENT_STATE_DISABLED]
1039
1064
  if retval is True:
1040
1065
  break
1041
1066
  return retval
@@ -1430,11 +1455,7 @@ class Session(object):
1430
1455
  def _get_base_uri(entitytype):
1431
1456
  uri_base = entitytype
1432
1457
  # Send query to server, first determine uri
1433
- # if entitytype == 'share':
1434
- # uri_base = 'workspace/share'
1435
- if entitytype == "site":
1436
- uri_base = "workspace/site"
1437
- elif entitytype == "queue":
1458
+ if entitytype == "queue":
1438
1459
  uri_base = "job"
1439
1460
  elif entitytype == "task":
1440
1461
  uri_base = "job/task"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: accsyn-python-api
3
- Version: 3.0.2
3
+ Version: 3.0.3
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