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.
Files changed (35) hide show
  1. {pam_python-0.1.17/pam_python.egg-info → pam_python-0.1.18}/PKG-INFO +1 -1
  2. {pam_python-0.1.17 → pam_python-0.1.18}/pam/service.py +15 -4
  3. {pam_python-0.1.17 → pam_python-0.1.18/pam_python.egg-info}/PKG-INFO +1 -1
  4. {pam_python-0.1.17 → pam_python-0.1.18}/setup.py +1 -1
  5. {pam_python-0.1.17 → pam_python-0.1.18}/LICENSE.txt +0 -0
  6. {pam_python-0.1.17 → pam_python-0.1.18}/README.md +0 -0
  7. {pam_python-0.1.17 → pam_python-0.1.18}/pam/__init__.py +0 -0
  8. {pam_python-0.1.17 → pam_python-0.1.18}/pam/api.py +0 -0
  9. {pam_python-0.1.17 → pam_python-0.1.18}/pam/cli.py +0 -0
  10. {pam_python-0.1.17 → pam_python-0.1.18}/pam/interface_task_manager.py +0 -0
  11. {pam_python-0.1.17 → pam_python-0.1.18}/pam/models/__init__.py +0 -0
  12. {pam_python-0.1.17 → pam_python-0.1.18}/pam/models/request_command.py +0 -0
  13. {pam_python-0.1.17 → pam_python-0.1.18}/pam/server.py +0 -0
  14. {pam_python-0.1.17 → pam_python-0.1.18}/pam/task_manager.py +0 -0
  15. {pam_python-0.1.17 → pam_python-0.1.18}/pam/temp_file_utils.py +0 -0
  16. {pam_python-0.1.17 → pam_python-0.1.18}/pam/templates/buildcmd/pamb +0 -0
  17. {pam_python-0.1.17 → pam_python-0.1.18}/pam/templates/buildcmd/pamb-base.sh +0 -0
  18. {pam_python-0.1.17 → pam_python-0.1.18}/pam/templates/docker/Dockerfile +0 -0
  19. {pam_python-0.1.17 → pam_python-0.1.18}/pam/templates/init/dockerignore.tmpl +0 -0
  20. {pam_python-0.1.17 → pam_python-0.1.18}/pam/templates/init/gitignore.tmpl +0 -0
  21. {pam_python-0.1.17 → pam_python-0.1.18}/pam/templates/init/main.tmpl +0 -0
  22. {pam_python-0.1.17 → pam_python-0.1.18}/pam/templates/init/pylintrc.tmpl +0 -0
  23. {pam_python-0.1.17 → pam_python-0.1.18}/pam/templates/init/run_test.sh +0 -0
  24. {pam_python-0.1.17 → pam_python-0.1.18}/pam/templates/service/functions.tmpl +0 -0
  25. {pam_python-0.1.17 → pam_python-0.1.18}/pam/templates/service/service.test.tmpl +0 -0
  26. {pam_python-0.1.17 → pam_python-0.1.18}/pam/templates/service/service.yaml +0 -0
  27. {pam_python-0.1.17 → pam_python-0.1.18}/pam/templates/service/service_class.tmpl +0 -0
  28. {pam_python-0.1.17 → pam_python-0.1.18}/pam/tester_task.py +0 -0
  29. {pam_python-0.1.17 → pam_python-0.1.18}/pam/utils.py +0 -0
  30. {pam_python-0.1.17 → pam_python-0.1.18}/pam_python.egg-info/SOURCES.txt +0 -0
  31. {pam_python-0.1.17 → pam_python-0.1.18}/pam_python.egg-info/dependency_links.txt +0 -0
  32. {pam_python-0.1.17 → pam_python-0.1.18}/pam_python.egg-info/entry_points.txt +0 -0
  33. {pam_python-0.1.17 → pam_python-0.1.18}/pam_python.egg-info/requires.txt +0 -0
  34. {pam_python-0.1.17 → pam_python-0.1.18}/pam_python.egg-info/top_level.txt +0 -0
  35. {pam_python-0.1.17 → pam_python-0.1.18}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pam-python
3
- Version: 0.1.17
3
+ Version: 0.1.18
4
4
  Summary: Pam Python Library
5
5
  Home-page: https://github.com/heart/pam-python
6
6
  Author: Narongrit Kanhanoi
@@ -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_{file_name or 'latest'}_",
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:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pam-python
3
- Version: 0.1.17
3
+ Version: 0.1.18
4
4
  Summary: Pam Python Library
5
5
  Home-page: https://github.com/heart/pam-python
6
6
  Author: Narongrit Kanhanoi
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="pam-python",
5
- version="0.1.17",
5
+ version="0.1.18",
6
6
  author="Narongrit Kanhanoi",
7
7
  author_email="narongrit@pams.ai",
8
8
  description="Pam Python Library",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes