pam-python 0.1.4__tar.gz → 0.1.6__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 (34) hide show
  1. {pam_python-0.1.4 → pam_python-0.1.6}/PKG-INFO +1 -1
  2. {pam_python-0.1.4 → pam_python-0.1.6}/pam/cli.py +8 -6
  3. {pam_python-0.1.4 → pam_python-0.1.6}/pam/templates/service/service.test.tmpl +1 -1
  4. {pam_python-0.1.4 → pam_python-0.1.6}/pam/templates/service/service.yaml +1 -1
  5. {pam_python-0.1.4 → pam_python-0.1.6}/pam/templates/service/service_class.tmpl +2 -2
  6. {pam_python-0.1.4 → pam_python-0.1.6}/pam_python.egg-info/PKG-INFO +1 -1
  7. {pam_python-0.1.4 → pam_python-0.1.6}/setup.py +1 -1
  8. {pam_python-0.1.4 → pam_python-0.1.6}/LICENSE.txt +0 -0
  9. {pam_python-0.1.4 → pam_python-0.1.6}/README.md +0 -0
  10. {pam_python-0.1.4 → pam_python-0.1.6}/pam/__init__.py +0 -0
  11. {pam_python-0.1.4 → pam_python-0.1.6}/pam/api.py +0 -0
  12. {pam_python-0.1.4 → pam_python-0.1.6}/pam/interface_task_manager.py +0 -0
  13. {pam_python-0.1.4 → pam_python-0.1.6}/pam/models/__init__.py +0 -0
  14. {pam_python-0.1.4 → pam_python-0.1.6}/pam/models/request_command.py +0 -0
  15. {pam_python-0.1.4 → pam_python-0.1.6}/pam/server.py +0 -0
  16. {pam_python-0.1.4 → pam_python-0.1.6}/pam/service.py +0 -0
  17. {pam_python-0.1.4 → pam_python-0.1.6}/pam/task_manager.py +0 -0
  18. {pam_python-0.1.4 → pam_python-0.1.6}/pam/temp_file_utils.py +0 -0
  19. {pam_python-0.1.4 → pam_python-0.1.6}/pam/templates/buildcmd/pamb +0 -0
  20. {pam_python-0.1.4 → pam_python-0.1.6}/pam/templates/buildcmd/pamb-base.sh +0 -0
  21. {pam_python-0.1.4 → pam_python-0.1.6}/pam/templates/docker/Dockerfile +0 -0
  22. {pam_python-0.1.4 → pam_python-0.1.6}/pam/templates/init/dockerignore.tmpl +0 -0
  23. {pam_python-0.1.4 → pam_python-0.1.6}/pam/templates/init/gitignore.tmpl +0 -0
  24. {pam_python-0.1.4 → pam_python-0.1.6}/pam/templates/init/main.tmpl +0 -0
  25. {pam_python-0.1.4 → pam_python-0.1.6}/pam/templates/init/pylintrc.tmpl +0 -0
  26. {pam_python-0.1.4 → pam_python-0.1.6}/pam/templates/service/functions.tmpl +0 -0
  27. {pam_python-0.1.4 → pam_python-0.1.6}/pam/tester_task.py +0 -0
  28. {pam_python-0.1.4 → pam_python-0.1.6}/pam/utils.py +0 -0
  29. {pam_python-0.1.4 → pam_python-0.1.6}/pam_python.egg-info/SOURCES.txt +0 -0
  30. {pam_python-0.1.4 → pam_python-0.1.6}/pam_python.egg-info/dependency_links.txt +0 -0
  31. {pam_python-0.1.4 → pam_python-0.1.6}/pam_python.egg-info/entry_points.txt +0 -0
  32. {pam_python-0.1.4 → pam_python-0.1.6}/pam_python.egg-info/requires.txt +0 -0
  33. {pam_python-0.1.4 → pam_python-0.1.6}/pam_python.egg-info/top_level.txt +0 -0
  34. {pam_python-0.1.4 → pam_python-0.1.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pam-python
3
- Version: 0.1.4
3
+ Version: 0.1.6
4
4
  Summary: Pam Python Library
5
5
  Home-page: https://github.com/heart/pam-python
6
6
  Author: Narongrit Kanhanoi
@@ -78,11 +78,11 @@ def cpy(src, dest):
78
78
  src_file = os.path.join(template_dir, src)
79
79
  shutil.copy(src_file, dest)
80
80
 
81
- def replace_template_content(service_name, file_name):
81
+ def replace_template_content(service_name, class_name, file_name):
82
82
  file_path = os.path.join(service_name, file_name)
83
83
  with open(file_path, 'r+', encoding='utf-8') as file:
84
84
  filedata = file.read()
85
- updated_data = filedata.replace('#CLASS_NAME#', to_pascal_case(service_name))
85
+ updated_data = filedata.replace('#CLASS_NAME#', class_name)
86
86
  updated_data = updated_data.replace('#MODULE_NAME#', service_name)
87
87
  file.seek(0) # Move the file pointer to the beginning of the file
88
88
  file.write(updated_data)
@@ -99,14 +99,16 @@ def create_service(name):
99
99
 
100
100
  os.mkdir(name)
101
101
  open(os.path.join(name, "__init__.py"), 'a', encoding='utf-8').close()
102
- cpy("service/service_class.tmpl", os.path.join(name, name+"_service.py") )
102
+
103
+ cpy("service/service_class.tmpl", os.path.join(name, to_pascal_case(name)+"Svc.py") )
104
+
103
105
  cpy("service/service.yaml", os.path.join(name, "service.yaml") )
104
106
  cpy("service/functions.tmpl", os.path.join(name, "functions.py") )
105
107
  cpy("service/service.test.tmpl", os.path.join(name, name+".test.py") )
106
108
 
107
- replace_template_content(name, name+"_service.py")
108
- replace_template_content(name, "service.yaml")
109
- replace_template_content(name, name+".test.py")
109
+ replace_template_content(name, to_pascal_case(name)+"Svc", to_pascal_case(name)+"Svc.py")
110
+ replace_template_content(name, to_pascal_case(name)+"Svc", "service.yaml")
111
+ replace_template_content(name, to_pascal_case(name)+"Svc", name+".test.py")
110
112
 
111
113
  print(f"Service {name} created.")
112
114
  print(f"Run `pam test {name}` to run tests for the service.")
@@ -9,7 +9,7 @@ from pam.tester_task import TesterTask
9
9
  from pam.models.request_command import RequestCommand
10
10
  from pam.temp_file_utils import TempfileUtils
11
11
  #pylint: disable=import-error
12
- from #MODULE_NAME#_service import #CLASS_NAME#Svc
12
+ from #CLASS_NAME# import #CLASS_NAME#
13
13
 
14
14
  def __create_mock_csv(page):
15
15
  fake = Faker()
@@ -1,2 +1,2 @@
1
1
  endpoint: /#CLASS_NAME#
2
- class: #CLASS_NAME#
2
+ class: #CLASS_NAME#Svc
@@ -2,9 +2,9 @@ from pam.service import Service
2
2
  from pam.models.request_command import RequestCommand
3
3
  from pam.utils import log
4
4
  #pylint: disable=import-error
5
- from functions import create_report, load_csv_file
5
+ from .functions import create_report, load_csv_file
6
6
 
7
- class #CLASS_NAME#Svc(Service):
7
+ class #CLASS_NAME#(Service):
8
8
 
9
9
  #pylint: disable=useless-parent-delegation
10
10
  def __init__(self, task_manager, req):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pam-python
3
- Version: 0.1.4
3
+ Version: 0.1.6
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.4",
5
+ version="0.1.6",
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