pyxecm 1.6__py3-none-any.whl → 2.0.1__py3-none-any.whl

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.

Potentially problematic release.


This version of pyxecm might be problematic. Click here for more details.

Files changed (78) hide show
  1. pyxecm/__init__.py +7 -4
  2. pyxecm/avts.py +727 -254
  3. pyxecm/coreshare.py +686 -467
  4. pyxecm/customizer/__init__.py +16 -4
  5. pyxecm/customizer/__main__.py +58 -0
  6. pyxecm/customizer/api/__init__.py +5 -0
  7. pyxecm/customizer/api/__main__.py +6 -0
  8. pyxecm/customizer/api/app.py +163 -0
  9. pyxecm/customizer/api/auth/__init__.py +1 -0
  10. pyxecm/customizer/api/auth/functions.py +92 -0
  11. pyxecm/customizer/api/auth/models.py +13 -0
  12. pyxecm/customizer/api/auth/router.py +78 -0
  13. pyxecm/customizer/api/common/__init__.py +1 -0
  14. pyxecm/customizer/api/common/functions.py +47 -0
  15. pyxecm/customizer/api/common/metrics.py +92 -0
  16. pyxecm/customizer/api/common/models.py +21 -0
  17. pyxecm/customizer/api/common/payload_list.py +870 -0
  18. pyxecm/customizer/api/common/router.py +72 -0
  19. pyxecm/customizer/api/settings.py +128 -0
  20. pyxecm/customizer/api/terminal/__init__.py +1 -0
  21. pyxecm/customizer/api/terminal/router.py +87 -0
  22. pyxecm/customizer/api/v1_csai/__init__.py +1 -0
  23. pyxecm/customizer/api/v1_csai/router.py +87 -0
  24. pyxecm/customizer/api/v1_maintenance/__init__.py +1 -0
  25. pyxecm/customizer/api/v1_maintenance/functions.py +100 -0
  26. pyxecm/customizer/api/v1_maintenance/models.py +12 -0
  27. pyxecm/customizer/api/v1_maintenance/router.py +76 -0
  28. pyxecm/customizer/api/v1_otcs/__init__.py +1 -0
  29. pyxecm/customizer/api/v1_otcs/functions.py +61 -0
  30. pyxecm/customizer/api/v1_otcs/router.py +179 -0
  31. pyxecm/customizer/api/v1_payload/__init__.py +1 -0
  32. pyxecm/customizer/api/v1_payload/functions.py +179 -0
  33. pyxecm/customizer/api/v1_payload/models.py +51 -0
  34. pyxecm/customizer/api/v1_payload/router.py +499 -0
  35. pyxecm/customizer/browser_automation.py +721 -286
  36. pyxecm/customizer/customizer.py +1076 -1425
  37. pyxecm/customizer/exceptions.py +35 -0
  38. pyxecm/customizer/guidewire.py +1186 -0
  39. pyxecm/customizer/k8s.py +901 -379
  40. pyxecm/customizer/log.py +107 -0
  41. pyxecm/customizer/m365.py +2967 -920
  42. pyxecm/customizer/nhc.py +1169 -0
  43. pyxecm/customizer/openapi.py +258 -0
  44. pyxecm/customizer/payload.py +18228 -7820
  45. pyxecm/customizer/pht.py +717 -286
  46. pyxecm/customizer/salesforce.py +516 -342
  47. pyxecm/customizer/sap.py +58 -41
  48. pyxecm/customizer/servicenow.py +611 -372
  49. pyxecm/customizer/settings.py +445 -0
  50. pyxecm/customizer/successfactors.py +408 -346
  51. pyxecm/customizer/translate.py +83 -48
  52. pyxecm/helper/__init__.py +5 -2
  53. pyxecm/helper/assoc.py +83 -43
  54. pyxecm/helper/data.py +2406 -870
  55. pyxecm/helper/logadapter.py +27 -0
  56. pyxecm/helper/web.py +229 -101
  57. pyxecm/helper/xml.py +596 -171
  58. pyxecm/maintenance_page/__init__.py +5 -0
  59. pyxecm/maintenance_page/__main__.py +6 -0
  60. pyxecm/maintenance_page/app.py +51 -0
  61. pyxecm/maintenance_page/settings.py +28 -0
  62. pyxecm/maintenance_page/static/favicon.avif +0 -0
  63. pyxecm/maintenance_page/templates/maintenance.html +165 -0
  64. pyxecm/otac.py +235 -141
  65. pyxecm/otawp.py +2668 -1220
  66. pyxecm/otca.py +569 -0
  67. pyxecm/otcs.py +7956 -3237
  68. pyxecm/otds.py +2178 -925
  69. pyxecm/otiv.py +36 -21
  70. pyxecm/otmm.py +1272 -325
  71. pyxecm/otpd.py +231 -127
  72. pyxecm-2.0.1.dist-info/METADATA +122 -0
  73. pyxecm-2.0.1.dist-info/RECORD +76 -0
  74. {pyxecm-1.6.dist-info → pyxecm-2.0.1.dist-info}/WHEEL +1 -1
  75. pyxecm-1.6.dist-info/METADATA +0 -53
  76. pyxecm-1.6.dist-info/RECORD +0 -32
  77. {pyxecm-1.6.dist-info → pyxecm-2.0.1.dist-info/licenses}/LICENSE +0 -0
  78. {pyxecm-1.6.dist-info → pyxecm-2.0.1.dist-info}/top_level.txt +0 -0
pyxecm/customizer/sap.py CHANGED
@@ -1,7 +1,7 @@
1
- """
2
- SAP RFC Module to implement Remote Function calls to SAP S/4HANA
1
+ """SAP RFC Module to implement Remote Function calls to SAP S/4HANA.
2
+
3
3
  For documentation of PyRFC see here: https://github.com/SAP/PyRFC
4
- and here: https://sap.github.io/PyRFC/pyrfc.html
4
+ and here: https://sap.github.io/PyRFC/pyrfc.html
5
5
 
6
6
  RFC typically uses port 3300 to communication with the SAP server.
7
7
  Make sure this port is not blocked by your firewall.
@@ -22,41 +22,36 @@ Connection Parameter:
22
22
  ending with the root CA certifcate. It should also contain the client certificate
23
23
  used for login at the server, if your client program does not use basic
24
24
  user & password authentication)
25
-
26
- Class: SAP
27
- Methods:
28
-
29
- __init__ : class initializer
30
- call: Calls and RFC based on its name and passes parameters.
31
-
32
25
  """
33
26
 
34
27
  __author__ = "Dr. Marc Diefenbruch"
35
- __copyright__ = "Copyright 2024, OpenText"
28
+ __copyright__ = "Copyright (C) 2024-2025, OpenText"
36
29
  __credits__ = ["Kai-Philip Gatzweiler"]
37
30
  __maintainer__ = "Dr. Marc Diefenbruch"
38
31
  __email__ = "mdiefenb@opentext.com"
39
32
 
40
33
  import logging
41
34
 
42
- logger = logging.getLogger("pyxecm.customizer.sap")
35
+ default_logger = logging.getLogger("pyxecm.customizer.sap")
43
36
 
44
37
  try:
45
38
  import pyrfc
46
39
 
47
40
  _has_pyrfc = True
48
41
 
49
- except ModuleNotFoundError as module_exception:
50
- logger.error("pyrfc not installed, SAP integration impacted")
42
+ except ModuleNotFoundError:
43
+ default_logger.debug("pyrfc not installed, SAP integration impacted")
51
44
  _has_pyrfc = False
52
45
 
53
- except ImportError as import_exception:
54
- logger.error("pyrfc could not be loaded, SAP integration impacted")
46
+ except ImportError:
47
+ default_logger.debug("pyrfc could not be loaded, SAP integration impacted")
55
48
  _has_pyrfc = False
56
49
 
57
50
 
58
- class SAP(object):
59
- """Used to implement Remote Function Calls (RFC) to SAP S/4HANA"""
51
+ class SAP:
52
+ """Implement Remote Function Calls (RFC) to SAP S/4HANA."""
53
+
54
+ logger: logging.Logger = default_logger
60
55
 
61
56
  _connection_parameters = {}
62
57
 
@@ -74,11 +69,17 @@ class SAP(object):
74
69
  system_number: str = "00",
75
70
  lang: str = "EN",
76
71
  trace: str = "3",
77
- ):
72
+ logger: logging.Logger = default_logger,
73
+ ) -> None:
78
74
  """Initialize the SAP object."""
79
75
 
80
- logger.info("Initializing SAP object...")
81
- logger.info("Using PyRFC version -> %s", pyrfc.__version__)
76
+ if logger != default_logger:
77
+ self.logger = logger.getChild("sap")
78
+ for logfilter in logger.filters:
79
+ self.logger.addFilter(logfilter)
80
+
81
+ self.logger.info("Initializing SAP object...")
82
+ self.logger.info("Using PyRFC version -> %s", pyrfc.__version__)
82
83
 
83
84
  # Set up connection parameters
84
85
  self._connection_parameters = {
@@ -91,13 +92,15 @@ class SAP(object):
91
92
 
92
93
  # see https://sap.github.io/PyRFC/pyrfc.html#connection
93
94
  if ashost:
94
- logger.info("Logon with application server logon: requiring ashost, sysnr")
95
+ self.logger.info(
96
+ "Logon with application server logon: requiring ashost, sysnr",
97
+ )
95
98
  self._connection_parameters["ashost"] = ashost
96
99
  self._connection_parameters["sysnr"] = system_number
97
100
  self._connection_parameters["sysid"] = system_id
98
101
  elif mshost:
99
- logger.info(
100
- "Logon with load balancing: requiring mshost, msserv, sysid, group"
102
+ self.logger.info(
103
+ "Logon with load balancing: requiring mshost, msserv, sysid, group",
101
104
  )
102
105
  self._connection_parameters["mshost"] = mshost
103
106
  self._connection_parameters["sysid"] = system_id
@@ -110,35 +113,49 @@ class SAP(object):
110
113
  # end method definition
111
114
 
112
115
  def call(self, rfc_name: str, options: dict, rfc_parameters: dict) -> dict | None:
113
- """Do an RFC Call. See http://sap.github.io/PyRFC/pyrfc.html#pyrfc.Connection.call
116
+ """Do an RFC Call.
117
+
118
+ See http://sap.github.io/PyRFC/pyrfc.html#pyrfc.Connection.call
114
119
 
115
120
  Args:
116
- rfc_name (str): this is the name of the RFC (typical in capital letters), e.g. SM02_ADD_MESSAGE
117
- options (dictionary, optional): the call options for the RFC call. Defaults to {}.
118
- * not_requested: Allows to deactivate certain parameters in the function module interface.
119
- This is particularly useful for BAPIs which have many large tables, the Python client is not interested in.
120
- Deactivate those, to reduce network traffic and memory consumption in your application considerably.
121
- This functionality can be used for input and output parameters. If the parameter is an input,
122
- no data for that parameter will be sent to the backend. If it’s an output, the backend will be
123
- informed not to return data for that parameter.
124
- * timeout: Cancel RFC connection if ongoing RFC call not completed within timeout seconds.
125
- Timeout can be also set as client connection configuration option, in which case is valid for all RFC calls.
126
- rfc_parameters (dict, optional): the actual RFC parameters thatare specific for
127
- the type of the call. Defaults to {}.
121
+ rfc_name (str):
122
+ This is the name of the RFC (typical in capital letters), e.g. SM02_ADD_MESSAGE.
123
+ options (dictionary, optional):
124
+ The call options for the RFC call. Defaults to {}. Potential options (keys):
125
+ * not_requested:
126
+ Allows to deactivate certain parameters in the function module interface.
127
+ This is particularly useful for BAPIs which have many large tables, the Python client is not interested in.
128
+ Deactivate those, to reduce network traffic and memory consumption in your application considerably.
129
+ This functionality can be used for input and output parameters. If the parameter is an input,
130
+ no data for that parameter will be sent to the backend. If it's an output, the backend will be
131
+ informed not to return data for that parameter.
132
+ * timeout:
133
+ Cancel RFC connection if ongoing RFC call not completed within timeout seconds.
134
+ Timeout can be also set as client connection configuration option, in which case is valid
135
+ for all RFC calls.
136
+ rfc_parameters (dict, optional):
137
+ The actual RFC parameters that are specific for the type of the call. Defaults to {}.
138
+
128
139
  Returns:
129
- dict: Result of the RFC call or None if the call fails or timeouts.
140
+ dict | None:
141
+ Result of the RFC call or None if the call fails or timeouts.
142
+
130
143
  """
131
144
 
132
145
  # Create the connection object and call the RFC function
133
146
  params = self._connection_parameters
134
- logger.debug("Connection Parameters -> %s", params)
147
+ self.logger.debug("Connection Parameters -> %s", params)
135
148
 
136
149
  try:
137
150
  with pyrfc.Connection(**params) as conn:
138
151
  result = conn.call(rfc_name, options=options, **rfc_parameters)
139
152
  return result
140
- except pyrfc.RFCError as exception:
141
- logger.error("Failed to call RFC -> %s; error -> %s", rfc_name, exception)
153
+ except pyrfc.RFCError as sap_error:
154
+ self.logger.error(
155
+ "Failed to call RFC -> '%s'; error -> %s",
156
+ rfc_name,
157
+ str(sap_error),
158
+ )
142
159
  return None
143
160
 
144
161
  # end method definition