pyxecm 3.9.0__tar.gz → 3.9.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 (88) hide show
  1. {pyxecm-3.9.0 → pyxecm-3.9.2}/PKG-INFO +1 -1
  2. {pyxecm-3.9.0 → pyxecm-3.9.2}/pyproject.toml +1 -1
  3. pyxecm-3.9.2/src/pyxecm/__init__.py +65 -0
  4. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm/avts.py +33 -3
  5. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm/coreshare.py +44 -3
  6. pyxecm-3.9.2/src/pyxecm/errors.py +985 -0
  7. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm/otac.py +13 -3
  8. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm/otawp.py +45 -11
  9. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm/otca.py +40 -8
  10. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm/otcs.py +306 -110
  11. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm/otds.py +69 -10
  12. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm/otkd.py +41 -5
  13. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm/otmm.py +42 -29
  14. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm/otpd.py +37 -4
  15. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_customizer/sap.py +107 -5
  16. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_customizer/settings.py +7 -1
  17. pyxecm-3.9.0/src/pyxecm/__init__.py +0 -21
  18. {pyxecm-3.9.0 → pyxecm-3.9.2}/.gitignore +0 -0
  19. {pyxecm-3.9.0 → pyxecm-3.9.2}/README.md +0 -0
  20. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm/helper/__init__.py +0 -0
  21. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm/helper/assoc.py +0 -0
  22. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm/helper/data.py +0 -0
  23. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm/helper/logadapter.py +0 -0
  24. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm/helper/web.py +0 -0
  25. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm/helper/xml.py +0 -0
  26. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm/otiv.py +0 -0
  27. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm/py.typed +0 -0
  28. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/__init__.py +0 -0
  29. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/__main__.py +0 -0
  30. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/app.py +0 -0
  31. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/auth/__init__.py +0 -0
  32. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/auth/functions.py +0 -0
  33. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/auth/models.py +0 -0
  34. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/auth/router.py +0 -0
  35. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/common/__init__.py +0 -0
  36. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/common/functions.py +0 -0
  37. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/common/metrics.py +0 -0
  38. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/common/models.py +0 -0
  39. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/common/router.py +0 -0
  40. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/config/__init__.py +0 -0
  41. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/config/functions.py +0 -0
  42. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/config/models.py +0 -0
  43. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/config/router.py +0 -0
  44. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/pods/__init__.py +0 -0
  45. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/pods/functions.py +0 -0
  46. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/pods/log_spool.py +0 -0
  47. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/pods/models.py +0 -0
  48. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/pods/router.py +0 -0
  49. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/settings.py +0 -0
  50. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/terminal/__init__.py +0 -0
  51. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/terminal/router.py +0 -0
  52. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/v1_maintenance/__init__.py +0 -0
  53. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/v1_maintenance/functions.py +0 -0
  54. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/v1_maintenance/models.py +0 -0
  55. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/v1_maintenance/router.py +0 -0
  56. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/v1_otcs/__init__.py +0 -0
  57. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/v1_otcs/functions.py +0 -0
  58. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/v1_otcs/router.py +0 -0
  59. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/v1_payload/__init__.py +0 -0
  60. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/v1_payload/functions.py +0 -0
  61. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/v1_payload/log_reader.py +0 -0
  62. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/v1_payload/models.py +0 -0
  63. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_api/v1_payload/router.py +0 -0
  64. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_customizer/__init__.py +0 -0
  65. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_customizer/__main__.py +0 -0
  66. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_customizer/browser_automation.py +0 -0
  67. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_customizer/customizer.py +0 -0
  68. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_customizer/exceptions.py +0 -0
  69. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_customizer/guidewire.py +0 -0
  70. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_customizer/k8s.py +0 -0
  71. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_customizer/log.py +0 -0
  72. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_customizer/m365.py +0 -0
  73. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_customizer/manager_push.py +0 -0
  74. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_customizer/payload.py +0 -0
  75. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_customizer/payload_list.py +0 -0
  76. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_customizer/salesforce.py +0 -0
  77. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_customizer/sap_forms.py +0 -0
  78. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_customizer/sap_models.py +0 -0
  79. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_customizer/servicenow.py +0 -0
  80. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_customizer/successfactors.py +0 -0
  81. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_customizer/translate.py +0 -0
  82. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_customizer/version.py +0 -0
  83. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_maintenance_page/__init__.py +0 -0
  84. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_maintenance_page/__main__.py +0 -0
  85. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_maintenance_page/app.py +0 -0
  86. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_maintenance_page/settings.py +0 -0
  87. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_maintenance_page/static/favicon.avif +0 -0
  88. {pyxecm-3.9.0 → pyxecm-3.9.2}/src/pyxecm_maintenance_page/templates/maintenance.html +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: pyxecm
3
- Version: 3.9.0
3
+ Version: 3.9.2
4
4
  Summary: A Python library to interact with Opentext Content Management Rest API
5
5
  Project-URL: Homepage, https://github.com/opentext/pyxecm
6
6
  Author-email: Kai Gatzweiler <kgatzweiler@opentext.com>, "Dr. Marc Diefenbruch" <mdiefenb@opentext.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pyxecm"
3
- version = "3.9.0"
3
+ version = "3.9.2"
4
4
  description = 'A Python library to interact with Opentext Content Management Rest API'
5
5
  keywords = [
6
6
  'opentext',
@@ -0,0 +1,65 @@
1
+ """pyxecm - A python library to interact with OpenText REST APIs."""
2
+
3
+ __author__ = "Dr. Marc Diefenbruch"
4
+ __copyright__ = "Copyright (C) 2024-2025, OpenText"
5
+ __credits__ = ["Kai-Philip Gatzweiler"]
6
+ __maintainer__ = "Dr. Marc Diefenbruch"
7
+ __email__ = "mdiefenb@opentext.com"
8
+
9
+ from .avts import AVTS
10
+ from .coreshare import CoreShare
11
+ from .errors import (
12
+ AVTSError,
13
+ CoreShareError,
14
+ ErrorCategory,
15
+ ErrorCollector,
16
+ ErrorSeverity,
17
+ OTACError,
18
+ OTAWPError,
19
+ OTCAError,
20
+ OTCSError,
21
+ OTDSError,
22
+ OTKDError,
23
+ OTMMError,
24
+ OTPDError,
25
+ PyxecmError,
26
+ capture_errors,
27
+ )
28
+ from .otac import OTAC
29
+ from .otawp import OTAWP
30
+ from .otca import OTCA
31
+ from .otcs import OTCS
32
+ from .otds import OTDS
33
+ from .otiv import OTIV
34
+ from .otkd import OTKD
35
+ from .otmm import OTMM
36
+ from .otpd import OTPD
37
+
38
+ __all__ = [
39
+ "AVTS",
40
+ "OTAC",
41
+ "OTAWP",
42
+ "OTCA",
43
+ "OTCS",
44
+ "OTDS",
45
+ "OTIV",
46
+ "OTKD",
47
+ "OTMM",
48
+ "OTPD",
49
+ "AVTSError",
50
+ "CoreShare",
51
+ "CoreShareError",
52
+ "ErrorCategory",
53
+ "ErrorCollector",
54
+ "ErrorSeverity",
55
+ "OTACError",
56
+ "OTAWPError",
57
+ "OTCAError",
58
+ "OTCSError",
59
+ "OTDSError",
60
+ "OTKDError",
61
+ "OTMMError",
62
+ "OTPDError",
63
+ "PyxecmError",
64
+ "capture_errors",
65
+ ]
@@ -17,6 +17,14 @@ from importlib.metadata import version
17
17
 
18
18
  import requests
19
19
 
20
+ from pyxecm.errors import (
21
+ AVTSError,
22
+ ErrorCategory,
23
+ ReportingLoggerAttribute,
24
+ record_request_error,
25
+ request_error_severity,
26
+ )
27
+
20
28
  APP_NAME = "pyxecm"
21
29
  APP_VERSION = version("pyxecm")
22
30
  MODULE_NAME = APP_NAME + ".avts"
@@ -45,7 +53,7 @@ class AVTS:
45
53
 
46
54
  # Only class variables or class-wide constants should be defined here:
47
55
 
48
- logger: logging.Logger = default_logger
56
+ logger = ReportingLoggerAttribute(default_logger, error_class=AVTSError)
49
57
 
50
58
  def __init__(
51
59
  self,
@@ -257,6 +265,14 @@ class AVTS:
257
265
  response.text,
258
266
  )
259
267
 
268
+ record_request_error(
269
+ error_class=AVTSError,
270
+ message=failure_message,
271
+ method=method,
272
+ url=url,
273
+ response=response,
274
+ severity=request_error_severity(show_error=show_error),
275
+ )
260
276
  return None
261
277
  except requests.exceptions.Timeout:
262
278
  if retries <= max_retries:
@@ -271,6 +287,13 @@ class AVTS:
271
287
  "%s; timeout error.",
272
288
  failure_message,
273
289
  )
290
+ record_request_error(
291
+ error_class=AVTSError,
292
+ message="{}; the request timed out".format(failure_message or "Request failed"),
293
+ method=method,
294
+ url=url,
295
+ category=ErrorCategory.TIMEOUT,
296
+ )
274
297
  if retry_forever:
275
298
  # If it fails after REQUEST_MAX_RETRIES retries we let it wait forever
276
299
  self.logger.warning("Turn timeouts off and wait forever...")
@@ -290,6 +313,13 @@ class AVTS:
290
313
  "%s; connection error.",
291
314
  failure_message,
292
315
  )
316
+ record_request_error(
317
+ error_class=AVTSError,
318
+ message="{}; connection error".format(failure_message or "Request failed"),
319
+ method=method,
320
+ url=url,
321
+ category=ErrorCategory.CONNECTION,
322
+ )
293
323
  if retry_forever:
294
324
  # If it fails after REQUEST_MAX_RETRIES retries we let it wait forever
295
325
  self.logger.warning("Turn timeouts off and wait forever...")
@@ -922,7 +952,7 @@ class AVTS:
922
952
  )
923
953
 
924
954
  if response is None:
925
- self.logger.error("Failed to create repository -> '%s'", name)
955
+ self.logger.error("Failed to create repository -> '%s'", name, report=True)
926
956
  return None
927
957
 
928
958
  self.repo_admin_consent(response["id"])
@@ -1304,7 +1334,7 @@ class AVTS:
1304
1334
  )
1305
1335
 
1306
1336
  if response is None:
1307
- self.logger.error("Failed to create repository -> '%s'!", name)
1337
+ self.logger.error("Failed to create repository -> '%s'!", name, report=True)
1308
1338
  return None
1309
1339
 
1310
1340
  self.repo_admin_consent(response["id"])
@@ -31,6 +31,14 @@ from urllib.parse import parse_qs, urlparse
31
31
 
32
32
  import requests
33
33
 
34
+ from pyxecm.errors import (
35
+ CoreShareError,
36
+ ErrorCategory,
37
+ ReportingLoggerAttribute,
38
+ record_request_error,
39
+ request_error_severity,
40
+ )
41
+
34
42
  APP_NAME = "pyxecm"
35
43
  APP_VERSION = version("pyxecm")
36
44
  MODULE_NAME = APP_NAME + ".coreshare"
@@ -66,7 +74,7 @@ class CoreShare:
66
74
 
67
75
  # Only class variables or class-wide constants should be defined here:
68
76
 
69
- logger: logging.Logger = default_logger
77
+ logger = ReportingLoggerAttribute(default_logger, error_class=CoreShareError)
70
78
 
71
79
  def __init__(
72
80
  self,
@@ -369,6 +377,8 @@ class CoreShare:
369
377
  if headers is None:
370
378
  self.logger.error(
371
379
  "Missing request header. Cannot send request to Core Share!",
380
+ report=True,
381
+ category=ErrorCategory.AUTHENTICATION,
372
382
  )
373
383
  return None
374
384
 
@@ -452,6 +462,14 @@ class CoreShare:
452
462
  HTTPStatus(response.status_code).phrase,
453
463
  response.text,
454
464
  )
465
+ record_request_error(
466
+ error_class=CoreShareError,
467
+ message=failure_message if show_error else (warning_message or failure_message),
468
+ method=method,
469
+ url=url,
470
+ response=response,
471
+ severity=request_error_severity(show_error=show_error, show_warning=show_warning),
472
+ )
455
473
  return None
456
474
  except requests.exceptions.Timeout:
457
475
  if retries <= max_retries:
@@ -466,6 +484,13 @@ class CoreShare:
466
484
  "%s; timeout error!",
467
485
  failure_message,
468
486
  )
487
+ record_request_error(
488
+ error_class=CoreShareError,
489
+ message="{}; the request timed out".format(failure_message or "Request failed"),
490
+ method=method,
491
+ url=url,
492
+ category=ErrorCategory.TIMEOUT,
493
+ )
469
494
  if retry_forever:
470
495
  # If it fails after REQUEST_MAX_RETRIES retries we let it wait forever
471
496
  self.logger.warning("Turn timeouts off and wait forever...")
@@ -485,6 +510,13 @@ class CoreShare:
485
510
  "%s; connection error!",
486
511
  failure_message,
487
512
  )
513
+ record_request_error(
514
+ error_class=CoreShareError,
515
+ message="{}; connection error".format(failure_message or "Request failed"),
516
+ method=method,
517
+ url=url,
518
+ category=ErrorCategory.CONNECTION,
519
+ )
488
520
  if retry_forever:
489
521
  # If it fails after REQUEST_MAX_RETRIES retries we let it wait forever
490
522
  self.logger.warning("Turn timeouts off and wait forever...")
@@ -750,6 +782,7 @@ class CoreShare:
750
782
  "Unable to connect to -> %s : %s",
751
783
  request_url,
752
784
  exception,
785
+ report=True,
753
786
  )
754
787
  return None
755
788
 
@@ -779,6 +812,7 @@ class CoreShare:
779
812
  self.logger.error(
780
813
  "Failed to request a Core Share Tenant Admin Access Token; error -> %s",
781
814
  response.text,
815
+ report=True,
782
816
  )
783
817
  return None
784
818
 
@@ -848,6 +882,7 @@ class CoreShare:
848
882
  "Unable to connect to -> %s : %s",
849
883
  request_url,
850
884
  exception,
885
+ report=True,
851
886
  )
852
887
  return None
853
888
 
@@ -866,6 +901,7 @@ class CoreShare:
866
901
  self.logger.error(
867
902
  "Failed to request a Core Share Tenant Service User Access Token; error -> %s",
868
903
  response.text,
904
+ report=True,
869
905
  )
870
906
  return None
871
907
 
@@ -2205,7 +2241,9 @@ class CoreShare:
2205
2241
 
2206
2242
  # Check if the photo file exists
2207
2243
  if not os.path.isfile(photo_path):
2208
- self.logger.error("Photo file -> '%s' not found for Core Share user with ID -> %s!", photo_path, user_id)
2244
+ self.logger.error(
2245
+ "Photo file -> '%s' not found for Core Share user with ID -> %s!", photo_path, user_id, report=True
2246
+ )
2209
2247
  return None
2210
2248
 
2211
2249
  try:
@@ -2215,7 +2253,10 @@ class CoreShare:
2215
2253
  except OSError:
2216
2254
  # Handle any errors that occurred while reading the photo file
2217
2255
  self.logger.error(
2218
- "Error reading photo file -> '%s' for Core Share user with ID -> '%s'!", photo_path, user_id
2256
+ "Error reading photo file -> '%s' for Core Share user with ID -> '%s'!",
2257
+ photo_path,
2258
+ user_id,
2259
+ report=True,
2219
2260
  )
2220
2261
  return None
2221
2262