pam-python 0.1.6__tar.gz → 0.1.7__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.
- {pam_python-0.1.6/pam_python.egg-info → pam_python-0.1.7}/PKG-INFO +1 -1
- {pam_python-0.1.6 → pam_python-0.1.7}/pam/task_manager.py +36 -5
- {pam_python-0.1.6 → pam_python-0.1.7/pam_python.egg-info}/PKG-INFO +1 -1
- {pam_python-0.1.6 → pam_python-0.1.7}/setup.py +1 -1
- {pam_python-0.1.6 → pam_python-0.1.7}/LICENSE.txt +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/README.md +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam/__init__.py +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam/api.py +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam/cli.py +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam/interface_task_manager.py +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam/models/__init__.py +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam/models/request_command.py +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam/server.py +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam/service.py +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam/temp_file_utils.py +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam/templates/buildcmd/pamb +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam/templates/buildcmd/pamb-base.sh +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam/templates/docker/Dockerfile +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam/templates/init/dockerignore.tmpl +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam/templates/init/gitignore.tmpl +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam/templates/init/main.tmpl +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam/templates/init/pylintrc.tmpl +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam/templates/service/functions.tmpl +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam/templates/service/service.test.tmpl +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam/templates/service/service.yaml +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam/templates/service/service_class.tmpl +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam/tester_task.py +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam/utils.py +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam_python.egg-info/SOURCES.txt +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam_python.egg-info/dependency_links.txt +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam_python.egg-info/entry_points.txt +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam_python.egg-info/requires.txt +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/pam_python.egg-info/top_level.txt +0 -0
- {pam_python-0.1.6 → pam_python-0.1.7}/setup.cfg +0 -0
|
@@ -129,31 +129,62 @@ class TaskManager(ITaskManager):
|
|
|
129
129
|
def service_request_data(self, service: Service, page):
|
|
130
130
|
"""
|
|
131
131
|
Makes an asynchronous request for data from a service.
|
|
132
|
+
Logs the response without blocking the main thread.
|
|
132
133
|
"""
|
|
133
134
|
endpoint = service.request.data_api
|
|
134
135
|
token = service.request.token
|
|
135
136
|
json_data = {"page": page, "token": token}
|
|
136
137
|
|
|
138
|
+
def handle_response(response):
|
|
139
|
+
"""Logs the response from the API."""
|
|
140
|
+
log(f"Response from {endpoint}: {response}")
|
|
141
|
+
|
|
142
|
+
def api_call_wrapper():
|
|
143
|
+
"""Wrapper for the API call to handle response."""
|
|
144
|
+
response = self.api.http_post(endpoint, json_data)
|
|
145
|
+
handle_response(response)
|
|
146
|
+
|
|
137
147
|
log(f"Requesting Data from: {endpoint}, page: {page}, token={token}")
|
|
138
|
-
http_thread = threading.Thread(target=
|
|
148
|
+
http_thread = threading.Thread(target=api_call_wrapper)
|
|
139
149
|
http_thread.start()
|
|
140
150
|
|
|
151
|
+
|
|
141
152
|
def service_upload_result(self, service: Service, file_path):
|
|
142
153
|
"""
|
|
143
|
-
Uploads a result file asynchronously.
|
|
154
|
+
Uploads a result file asynchronously and logs the response.
|
|
144
155
|
"""
|
|
145
156
|
endpoint = service.request.response_api
|
|
157
|
+
|
|
158
|
+
def handle_upload_response(response):
|
|
159
|
+
"""Logs the response after the upload completes."""
|
|
160
|
+
log(f"Response from upload to {endpoint}: {response}")
|
|
161
|
+
|
|
162
|
+
def upload_wrapper():
|
|
163
|
+
"""Wrapper for the upload to handle response logging."""
|
|
164
|
+
response = self.api.http_upload(endpoint, file_path)
|
|
165
|
+
handle_upload_response(response)
|
|
166
|
+
|
|
146
167
|
log(f"Uploading Result to: {endpoint}")
|
|
147
|
-
http_thread = threading.Thread(target=
|
|
168
|
+
http_thread = threading.Thread(target=upload_wrapper)
|
|
148
169
|
http_thread.start()
|
|
149
170
|
|
|
150
171
|
def service_upload_report(self, service: Service, file_path):
|
|
151
172
|
"""
|
|
152
|
-
Uploads a report file asynchronously.
|
|
173
|
+
Uploads a report file asynchronously and logs the response.
|
|
153
174
|
"""
|
|
154
175
|
endpoint = service.request.response_api
|
|
176
|
+
|
|
177
|
+
def handle_report_response(response):
|
|
178
|
+
"""Logs the response after the report upload completes."""
|
|
179
|
+
log(f"Response from report upload to {endpoint}: {response}")
|
|
180
|
+
|
|
181
|
+
def upload_wrapper():
|
|
182
|
+
"""Wrapper for the report upload to handle response logging."""
|
|
183
|
+
response = self.api.http_upload(endpoint, file_path)
|
|
184
|
+
handle_report_response(response)
|
|
185
|
+
|
|
155
186
|
log(f"Uploading Report to: {endpoint}")
|
|
156
|
-
http_thread = threading.Thread(target=
|
|
187
|
+
http_thread = threading.Thread(target=upload_wrapper)
|
|
157
188
|
http_thread.start()
|
|
158
189
|
|
|
159
190
|
def service_exit(self, service: Service):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|