pam-python 0.1.17__tar.gz → 0.1.18__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.17/pam_python.egg-info → pam_python-0.1.18}/PKG-INFO +1 -1
- {pam_python-0.1.17 → pam_python-0.1.18}/pam/service.py +15 -4
- {pam_python-0.1.17 → pam_python-0.1.18/pam_python.egg-info}/PKG-INFO +1 -1
- {pam_python-0.1.17 → pam_python-0.1.18}/setup.py +1 -1
- {pam_python-0.1.17 → pam_python-0.1.18}/LICENSE.txt +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/README.md +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam/__init__.py +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam/api.py +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam/cli.py +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam/interface_task_manager.py +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam/models/__init__.py +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam/models/request_command.py +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam/server.py +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam/task_manager.py +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam/temp_file_utils.py +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam/templates/buildcmd/pamb +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam/templates/buildcmd/pamb-base.sh +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam/templates/docker/Dockerfile +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam/templates/init/dockerignore.tmpl +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam/templates/init/gitignore.tmpl +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam/templates/init/main.tmpl +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam/templates/init/pylintrc.tmpl +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam/templates/init/run_test.sh +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam/templates/service/functions.tmpl +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam/templates/service/service.test.tmpl +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam/templates/service/service.yaml +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam/templates/service/service_class.tmpl +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam/tester_task.py +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam/utils.py +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam_python.egg-info/SOURCES.txt +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam_python.egg-info/dependency_links.txt +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam_python.egg-info/entry_points.txt +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam_python.egg-info/requires.txt +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/pam_python.egg-info/top_level.txt +0 -0
- {pam_python-0.1.17 → pam_python-0.1.18}/setup.cfg +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from abc import abstractmethod
|
|
2
2
|
from pathlib import Path
|
|
3
|
+
from datetime import datetime
|
|
3
4
|
import json
|
|
4
5
|
from typing import TYPE_CHECKING, Union
|
|
5
6
|
import pandas as pd
|
|
@@ -95,20 +96,28 @@ class Service:
|
|
|
95
96
|
raise
|
|
96
97
|
|
|
97
98
|
return report_csv_path
|
|
98
|
-
|
|
99
|
-
def _request_sqlite(self, file_name: str = "", is_shared: bool = False) -> None:
|
|
100
|
-
"""Requests last sqlite file that this plugin has uploaded from the last time.
|
|
99
|
+
|
|
100
|
+
def _request_sqlite(self, file_name: str = "", is_shared: bool = False) -> str | None:
|
|
101
|
+
"""Requests last sqlite file that this plugin has uploaded from the last time.
|
|
102
|
+
|
|
103
|
+
Returns:
|
|
104
|
+
The file path to the downloaded SQLite file, or None if the download failed.
|
|
105
|
+
"""
|
|
101
106
|
log(f"{self.request.service_name}: Requesting sqlite for file_name={file_name}")
|
|
102
107
|
|
|
103
108
|
endpoint = self.request.sqlite_download
|
|
104
109
|
token = self.request.token
|
|
105
110
|
json_data = {"file_name": file_name, "is_shared": is_shared, "token": token}
|
|
106
111
|
|
|
112
|
+
# Create a unique suffix using current datetime
|
|
113
|
+
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
|
114
|
+
unique_file_name = f"{file_name or 'latest'}_{timestamp}"
|
|
115
|
+
|
|
107
116
|
# Create a temp file path for the downloaded .sqlite file
|
|
108
117
|
output_path = TempfileUtils.get_temp_file_name(
|
|
109
118
|
self.request.service_name,
|
|
110
119
|
token,
|
|
111
|
-
f"sqlite_{
|
|
120
|
+
f"sqlite_{unique_file_name}_",
|
|
112
121
|
".sqlite"
|
|
113
122
|
)
|
|
114
123
|
|
|
@@ -117,8 +126,10 @@ class Service:
|
|
|
117
126
|
|
|
118
127
|
if success:
|
|
119
128
|
log(f"{self.request.service_name}: Successfully downloaded SQLite file to {output_path}")
|
|
129
|
+
return output_path
|
|
120
130
|
else:
|
|
121
131
|
log(f"{self.request.service_name}: Failed to download SQLite file.")
|
|
132
|
+
return None
|
|
122
133
|
|
|
123
134
|
|
|
124
135
|
def _upload_sqlite(self, file_name: str = "", is_shared: bool = False, sqlite_file: str = "") -> str:
|
|
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
|
|
File without changes
|