pilot.linkstec 0.0.9__tar.gz → 0.0.11__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. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/PKG-INFO +1 -1
  2. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/pyproject.toml +1 -1
  3. pilot_linkstec-0.0.11/src/pilot/control/impl/base_controller.py +56 -0
  4. pilot_linkstec-0.0.11/src/pilot/unit/impl/base_unit.py +36 -0
  5. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot.linkstec.egg-info/PKG-INFO +1 -1
  6. pilot_linkstec-0.0.9/src/pilot/control/impl/base_controller.py +0 -31
  7. pilot_linkstec-0.0.9/src/pilot/unit/impl/base_unit.py +0 -73
  8. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/LICENSE +0 -0
  9. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/README.md +0 -0
  10. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/setup.cfg +0 -0
  11. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot/__init__.py +0 -0
  12. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot/config/__init__.py +0 -0
  13. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot/config/config_reader.py +0 -0
  14. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot/control/__init__.py +0 -0
  15. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot/control/control_interface.py +0 -0
  16. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot/control/impl/__init__.py +0 -0
  17. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot/conver/__init__.py +0 -0
  18. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot/conver/converfileEncodding.py +0 -0
  19. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot/conver/nkf_converter.py +0 -0
  20. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot/generater/__init__.py +0 -0
  21. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot/generater/vertexai.py +0 -0
  22. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot/job/__init__.py +0 -0
  23. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot/job/impl/__init__.py +0 -0
  24. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot/job/impl/base_job.py +0 -0
  25. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot/job/job_interface.py +0 -0
  26. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot/splitters/__init__.py +0 -0
  27. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot/splitters/cobolsplitter.py +0 -0
  28. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot/unit/__init__.py +0 -0
  29. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot/unit/impl/__init__.py +0 -0
  30. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot/unit/unit_interface.py +0 -0
  31. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot/util/__init__.py +0 -0
  32. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot/util/files.py +0 -0
  33. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot.linkstec.egg-info/SOURCES.txt +0 -0
  34. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot.linkstec.egg-info/dependency_links.txt +0 -0
  35. {pilot_linkstec-0.0.9 → pilot_linkstec-0.0.11}/src/pilot.linkstec.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pilot.linkstec
3
- Version: 0.0.9
3
+ Version: 0.0.11
4
4
  Summary: pilot of the ship, a tool for managing and deploying Python projects.
5
5
  Author-email: wanglr <wanglr1980@gmail.com>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pilot.linkstec"
3
- version = "0.0.9"
3
+ version = "0.0.11"
4
4
  authors = [
5
5
  { name="wanglr", email="wanglr1980@gmail.com" },
6
6
  ]
@@ -0,0 +1,56 @@
1
+ from concurrent.futures import ThreadPoolExecutor
2
+
3
+
4
+ from pilot.control.control_interface import ControlInterface
5
+ from pilot.unit.impl.base_unit import BaseUnit
6
+ from pilot.config.config_reader import ConfigReader
7
+
8
+
9
+ class BaseController(ControlInterface):
10
+
11
+ def __init__(self):
12
+ pass
13
+
14
+ def _init_unit(self):
15
+ return BaseUnit()
16
+
17
+ def run(self,configfile: str = None):
18
+ import time
19
+ config_dto = ConfigReader(configfile).get_dto()
20
+ unit = self._init_unit()
21
+ unit.config_dto = config_dto
22
+
23
+ steps = config_dto.steps
24
+ runsteps = config_dto.runsteps
25
+
26
+ def run_step(index):
27
+ if index >= len(steps):
28
+ return
29
+ step = steps[index]
30
+ if step in config_dto.skipsteps:
31
+ run_step(index + 1)
32
+ return
33
+
34
+ if len(runsteps) == 0:
35
+ pass
36
+ elif len(runsteps) != 0 and step not in runsteps:
37
+ run_step(index + 1)
38
+ return
39
+
40
+ max_workers = 1
41
+ if step in config_dto.multisteps:
42
+ max_workers = config_dto.threads
43
+
44
+ def step_worker():
45
+ unit.run(index)
46
+
47
+ with ThreadPoolExecutor(max_workers=max_workers) as executor:
48
+ futures = []
49
+ for _ in range(max_workers):
50
+ futures.append(executor.submit(step_worker))
51
+ time.sleep(0.5)
52
+ for future in futures:
53
+ future.result()
54
+ run_step(index + 1)
55
+
56
+ run_step(0)
@@ -0,0 +1,36 @@
1
+ import os
2
+
3
+ from pilot.unit.unit_interface import UnitInterface
4
+ from pilot.job.impl.base_job import BaseJob
5
+ from pilot.config.config_reader import ConfigReader, ConfigDTO # 追加
6
+
7
+ class BaseUnit(UnitInterface):
8
+ config_dto: ConfigDTO = None # 型アノテーションを追加
9
+ joblist = []
10
+
11
+ def __init__(self):
12
+ pass
13
+
14
+ def _init_job(self,step):
15
+ return BaseJob()
16
+
17
+ def run(self, index=0):
18
+ steps = self.config_dto.steps
19
+ step = steps[index]
20
+ current_step_dir = self.config_dto.work_space + "/" + step
21
+ self._run_jobs_in_step_dir(current_step_dir, step, index)
22
+
23
+ def _run_jobs_in_step_dir(self, current_step_dir, step, index):
24
+ for dirpath, _, filenames in os.walk(current_step_dir):
25
+ for filename in filenames:
26
+ file_path = os.path.join(dirpath, filename)
27
+ job = self._init_job(step)
28
+ job.config_dto = self.config_dto
29
+ job.current_step = step
30
+ job.step_index = index
31
+ job.file_path = file_path
32
+ if self.job_need_run(job, filename, index):
33
+ job.run()
34
+
35
+ def job_need_run(self, job:BaseJob,filename: str,index):
36
+ return True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pilot.linkstec
3
- Version: 0.0.9
3
+ Version: 0.0.11
4
4
  Summary: pilot of the ship, a tool for managing and deploying Python projects.
5
5
  Author-email: wanglr <wanglr1980@gmail.com>
6
6
  License-Expression: MIT
@@ -1,31 +0,0 @@
1
- from concurrent.futures import ThreadPoolExecutor
2
-
3
-
4
- from pilot.control.control_interface import ControlInterface
5
- from pilot.unit.impl.base_unit import BaseUnit
6
- from pilot.config.config_reader import ConfigReader
7
-
8
-
9
- class BaseController(ControlInterface):
10
-
11
- def __init__(self):
12
- pass
13
-
14
-
15
- def _init_unit(self):
16
- return BaseUnit()
17
-
18
- def run(self,configfile: str = None):
19
- import time
20
- config_dto = ConfigReader(configfile).get_dto()
21
- def worker():
22
- unit = self._init_unit()
23
- unit.config_dto = config_dto
24
- unit.run()
25
- with ThreadPoolExecutor(max_workers=config_dto.threads) as executor:
26
- futures = []
27
- for _ in range(config_dto.threads):
28
- futures.append(executor.submit(worker))
29
- time.sleep(0.2)
30
- for future in futures:
31
- future.result()
@@ -1,73 +0,0 @@
1
- import os
2
- from concurrent.futures import ThreadPoolExecutor
3
- import time
4
-
5
- from pilot.unit.unit_interface import UnitInterface
6
- from pilot.job.impl.base_job import BaseJob
7
- from pilot.config.config_reader import ConfigReader, ConfigDTO # 追加
8
-
9
- class BaseUnit(UnitInterface):
10
- config_dto: ConfigDTO = None # 型アノテーションを追加
11
- joblist = []
12
-
13
- def __init__(self):
14
- pass
15
-
16
-
17
- def _init_job(self,step):
18
- return BaseJob()
19
-
20
- def run(self):
21
- steps = self.config_dto.steps
22
- skipsteps = self.config_dto.skipsteps
23
-
24
- runsteps = self.config_dto.runsteps
25
-
26
- def run_step(index):
27
- if index >= len(steps):
28
- return
29
- step = steps[index]
30
- if step in skipsteps:
31
- run_step(index + 1)
32
- return
33
-
34
- if len(runsteps) == 0 :
35
- pass
36
- elif len(runsteps) != 0 and step not in runsteps:
37
- run_step(index + 1)
38
- return
39
-
40
- current_step_dir = self.config_dto.work_space + "/" + step
41
-
42
- max_workers = self.config_dto.threads
43
- unit_multisteps = self.config_dto.multisteps
44
- if step in unit_multisteps:
45
- max_workers = self.config_dto.threads
46
- else:
47
- max_workers = 1
48
- def step_worker():
49
- self._run_jobs_in_step_dir(current_step_dir, step, index)
50
-
51
- with ThreadPoolExecutor(max_workers=max_workers) as executor:
52
- future = executor.submit(step_worker)
53
- future.result()
54
- # STEP完了後、次のSTEPを実行
55
- run_step(index + 1)
56
-
57
- run_step(0)
58
-
59
- def _run_jobs_in_step_dir(self, current_step_dir, step, index):
60
- for dirpath, _, filenames in os.walk(current_step_dir):
61
- for filename in filenames:
62
- file_path = os.path.join(dirpath, filename)
63
- job = self._init_job(step)
64
- job.config_dto = self.config_dto
65
- job.current_step = step
66
- job.step_index = index
67
- job.file_path = file_path
68
- if self.job_need_run(job, filename, index):
69
- job.run()
70
-
71
-
72
- def job_need_run(self, job:BaseJob,filename: str,index):
73
- return True
File without changes