pilot.linkstec 0.0.14__tar.gz → 0.0.16__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.

Potentially problematic release.


This version of pilot.linkstec might be problematic. Click here for more details.

Files changed (35) hide show
  1. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/PKG-INFO +1 -1
  2. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/pyproject.toml +1 -1
  3. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/job/impl/base_job.py +20 -2
  4. pilot_linkstec-0.0.16/src/pilot/logging/logger.py +57 -0
  5. pilot_linkstec-0.0.16/src/pilot/util/__init__.py +0 -0
  6. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot.linkstec.egg-info/PKG-INFO +1 -1
  7. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot.linkstec.egg-info/SOURCES.txt +2 -0
  8. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/LICENSE +0 -0
  9. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/README.md +0 -0
  10. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/setup.cfg +0 -0
  11. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/__init__.py +0 -0
  12. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/config/__init__.py +0 -0
  13. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/config/config_reader.py +0 -0
  14. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/control/__init__.py +0 -0
  15. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/control/control_interface.py +0 -0
  16. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/control/impl/__init__.py +0 -0
  17. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/control/impl/base_controller.py +0 -0
  18. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/conver/__init__.py +0 -0
  19. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/conver/converfileEncodding.py +0 -0
  20. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/conver/nkf_converter.py +0 -0
  21. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/generater/__init__.py +0 -0
  22. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/generater/vertexai.py +0 -0
  23. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/job/__init__.py +0 -0
  24. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/job/impl/__init__.py +0 -0
  25. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/job/job_interface.py +0 -0
  26. {pilot_linkstec-0.0.14/src/pilot/splitters → pilot_linkstec-0.0.16/src/pilot/logging}/__init__.py +0 -0
  27. {pilot_linkstec-0.0.14/src/pilot/unit → pilot_linkstec-0.0.16/src/pilot/splitters}/__init__.py +0 -0
  28. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/splitters/cobolsplitter.py +0 -0
  29. {pilot_linkstec-0.0.14/src/pilot/unit/impl → pilot_linkstec-0.0.16/src/pilot/unit}/__init__.py +0 -0
  30. {pilot_linkstec-0.0.14/src/pilot/util → pilot_linkstec-0.0.16/src/pilot/unit/impl}/__init__.py +0 -0
  31. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/unit/impl/base_unit.py +0 -0
  32. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/unit/unit_interface.py +0 -0
  33. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/util/files.py +0 -0
  34. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot.linkstec.egg-info/dependency_links.txt +0 -0
  35. {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/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.14
3
+ Version: 0.0.16
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.14"
3
+ version = "0.0.16"
4
4
  authors = [
5
5
  { name="wanglr", email="wanglr1980@gmail.com" },
6
6
  ]
@@ -2,11 +2,12 @@ import os
2
2
  import shutil
3
3
 
4
4
  from pilot.job.job_interface import JobInterface
5
- from pilot.config.config_reader import ConfigReader
5
+ from pilot.logging.logger import get_logger
6
6
 
7
7
 
8
8
  class BaseJob(JobInterface):
9
9
  def __init__(self):
10
+ self.logger = get_logger(__name__)
10
11
  self.config_dto = None
11
12
  self._current_step = None
12
13
  self._file_path = None
@@ -15,6 +16,7 @@ class BaseJob(JobInterface):
15
16
  self._next_step_file_path = None
16
17
  self._content = None
17
18
 
19
+
18
20
  @property
19
21
  def current_step(self):
20
22
  return self._current_step
@@ -325,4 +327,20 @@ class BaseJob(JobInterface):
325
327
  open(end_file, 'w', encoding='utf-8').close()
326
328
  return end_file
327
329
 
328
- return None
330
+ return None
331
+
332
+ def pre_run(self):
333
+ """
334
+ ジョブ実行前の前処理を行うメソッド。
335
+ 必要に応じてサブクラスでオーバーライドして使用する。
336
+ """
337
+ pass
338
+
339
+ def post_run(self):
340
+ """
341
+ ジョブ実行後の後処理を行うメソッド。
342
+ 必要に応じてサブクラスでオーバーライドして使用する。
343
+ """
344
+ pass
345
+
346
+
@@ -0,0 +1,57 @@
1
+ import logging
2
+ import sys
3
+ import threading
4
+
5
+ # コンソールカラーのコード定義
6
+ RESET = "\x1b[0m"
7
+ COLOR_MAP = {
8
+ logging.DEBUG: "\x1b[37m", # 白色
9
+ logging.INFO: "\x1b[32m", # 緑色
10
+ logging.WARNING: "\x1b[33m", # 黄色
11
+ logging.ERROR: "\x1b[31m", # 赤色
12
+ logging.CRITICAL: "\x1b[41m", # 赤背景白文字
13
+ }
14
+
15
+
16
+ class ColoredFormatter(logging.Formatter):
17
+ def format(self, record):
18
+ color = COLOR_MAP.get(record.levelno, RESET)
19
+ # スレッド名を取得
20
+ thread_name = threading.current_thread().name
21
+ thread_name = thread_name.split('_', 1)[1] if '_' in thread_name else thread_name
22
+ # クラス名、メソッド名、行番号
23
+ prefix = f"{self.formatTime(record, '%Y-%m-%d %H:%M:%S')} " \
24
+ f"[{record.levelname}] " \
25
+ f"[{thread_name}] " \
26
+ f"[{record.module}.{record.funcName}:{record.lineno}]"
27
+ message = super().format(record)
28
+ return f"{color}{prefix} {message}{RESET}"
29
+
30
+
31
+ _global_logger_configured = False
32
+
33
+
34
+ def setup_global_logger(log_level: int = logging.INFO):
35
+ global _global_logger_configured
36
+
37
+ if not _global_logger_configured:
38
+ logging.basicConfig(
39
+ level=log_level,
40
+ format='%(message)s'
41
+ )
42
+
43
+ root_logger = logging.getLogger()
44
+ if root_logger.handlers:
45
+ root_logger.handlers.clear()
46
+
47
+ handler = logging.StreamHandler(sys.stdout)
48
+ formatter = ColoredFormatter('%(message)s')
49
+ handler.setFormatter(formatter)
50
+ root_logger.addHandler(handler)
51
+ root_logger.setLevel(log_level)
52
+
53
+ _global_logger_configured = True
54
+
55
+
56
+ def get_logger(name: str) -> logging.Logger:
57
+ return logging.getLogger(name)
File without changes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pilot.linkstec
3
- Version: 0.0.14
3
+ Version: 0.0.16
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
@@ -21,6 +21,8 @@ src/pilot/job/__init__.py
21
21
  src/pilot/job/job_interface.py
22
22
  src/pilot/job/impl/__init__.py
23
23
  src/pilot/job/impl/base_job.py
24
+ src/pilot/logging/__init__.py
25
+ src/pilot/logging/logger.py
24
26
  src/pilot/splitters/__init__.py
25
27
  src/pilot/splitters/cobolsplitter.py
26
28
  src/pilot/unit/__init__.py
File without changes