libuseful 0.4.1__py3-none-any.whl

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 (56) hide show
  1. libuseful/__init__.pyc +0 -0
  2. libuseful/__init__.pyi +1 -0
  3. libuseful/exception.pyc +0 -0
  4. libuseful/exception.pyi +15 -0
  5. libuseful/lib_adb.pyc +0 -0
  6. libuseful/lib_adb.pyi +31 -0
  7. libuseful/lib_args.pyc +0 -0
  8. libuseful/lib_args.pyi +23 -0
  9. libuseful/lib_async_loop.pyc +0 -0
  10. libuseful/lib_async_loop.pyi +25 -0
  11. libuseful/lib_cam_record.pyc +0 -0
  12. libuseful/lib_cam_record.pyi +17 -0
  13. libuseful/lib_dynamic_import.pyc +0 -0
  14. libuseful/lib_dynamic_import.pyi +10 -0
  15. libuseful/lib_enum.pyc +0 -0
  16. libuseful/lib_enum.pyi +6 -0
  17. libuseful/lib_excel.pyc +0 -0
  18. libuseful/lib_excel.pyi +66 -0
  19. libuseful/lib_fatal.pyc +0 -0
  20. libuseful/lib_fatal.pyi +24 -0
  21. libuseful/lib_file.pyc +0 -0
  22. libuseful/lib_file.pyi +18 -0
  23. libuseful/lib_logger.pyc +0 -0
  24. libuseful/lib_logger.pyi +37 -0
  25. libuseful/lib_math_geometry.pyc +0 -0
  26. libuseful/lib_math_geometry.pyi +31 -0
  27. libuseful/lib_path.pyc +0 -0
  28. libuseful/lib_path.pyi +34 -0
  29. libuseful/lib_path_remote_linux.pyc +0 -0
  30. libuseful/lib_path_remote_linux.pyi +10 -0
  31. libuseful/lib_processor.pyc +0 -0
  32. libuseful/lib_processor.pyi +30 -0
  33. libuseful/lib_ps.pyc +0 -0
  34. libuseful/lib_ps.pyi +44 -0
  35. libuseful/lib_retry.pyc +0 -0
  36. libuseful/lib_retry.pyi +5 -0
  37. libuseful/lib_shell.pyc +0 -0
  38. libuseful/lib_shell.pyi +30 -0
  39. libuseful/lib_shell_raw.pyc +0 -0
  40. libuseful/lib_shell_raw.pyi +30 -0
  41. libuseful/lib_singleton.pyc +0 -0
  42. libuseful/lib_singleton.pyi +5 -0
  43. libuseful/lib_thread.pyc +0 -0
  44. libuseful/lib_thread.pyi +19 -0
  45. libuseful/lib_threadsM.pyc +0 -0
  46. libuseful/lib_threadsM.pyi +14 -0
  47. libuseful/lib_time.pyc +0 -0
  48. libuseful/lib_time.pyi +13 -0
  49. libuseful/lib_usermng.pyc +0 -0
  50. libuseful/lib_usermng.pyi +37 -0
  51. libuseful/lib_watchdog.pyc +0 -0
  52. libuseful/lib_watchdog.pyi +13 -0
  53. libuseful-0.4.1.dist-info/LICENSE +19 -0
  54. libuseful-0.4.1.dist-info/METADATA +50 -0
  55. libuseful-0.4.1.dist-info/RECORD +56 -0
  56. libuseful-0.4.1.dist-info/WHEEL +4 -0
libuseful/__init__.pyc ADDED
Binary file
libuseful/__init__.pyi ADDED
@@ -0,0 +1 @@
1
+ __version__: str
Binary file
@@ -0,0 +1,15 @@
1
+ __all__ = ['CEOutOfRange', 'CEInvalidArguments', 'CENotInitialized', 'CEOutOfLeagueException', 'CECannotRecoveryException', 'CEInvalidValueException', 'CEMissMatchedException', 'CENullException', 'CENotFoundException', 'CECommunicationError', 'CEMandatoryError', 'CENotSupportException', 'CELogicErrorException']
2
+
3
+ class CEOutOfRange(Exception): ...
4
+ class CEInvalidArguments(Exception): ...
5
+ class CENotInitialized(Exception): ...
6
+ class CEOutOfLeagueException(Exception): ...
7
+ class CECannotRecoveryException(Exception): ...
8
+ class CEInvalidValueException(Exception): ...
9
+ class CEMissMatchedException(Exception): ...
10
+ class CENullException(Exception): ...
11
+ class CENotFoundException(Exception): ...
12
+ class CECommunicationError(Exception): ...
13
+ class CEMandatoryError(Exception): ...
14
+ class CENotSupportException(Exception): ...
15
+ class CELogicErrorException(Exception): ...
libuseful/lib_adb.pyc ADDED
Binary file
libuseful/lib_adb.pyi ADDED
@@ -0,0 +1,31 @@
1
+ from .exception import *
2
+ from .lib_ps import CProcess as CProcess
3
+ from .lib_retry import retry as retry
4
+ from .lib_singleton import Singleton as Singleton
5
+ from _typeshed import Incomplete
6
+ from ppadb.device import Device as ADBdev
7
+
8
+ class ADB_Sync(Singleton):
9
+ class STATE_SERVER:
10
+ RUNNING: str
11
+ SHOTDOWN: str
12
+ GET_STATE: str
13
+ class STATE_DEV:
14
+ ON: Incomplete
15
+ OFF: Incomplete
16
+ NONE: Incomplete
17
+ class FORMAT_DEV:
18
+ INSTANCE: str
19
+ SERIAL: str
20
+ ADBD_IP: str
21
+ ADBD_PORT: int
22
+ def is_dev_online(self, dev_name: str): ...
23
+ def activate_root(self, device: ADBdev, user: str): ...
24
+ def get_device(self, dev_name: str, state: STATE_DEV = ...): ...
25
+ def get_devices(self, state: STATE_DEV = ..., out_format: FORMAT_DEV = ...): ...
26
+ def remote_connect(self, ip: str, port: int): ...
27
+ def remote_disconnect(self, device: ADBdev): ...
28
+ def start_server(self) -> None: ...
29
+ def kill_server(self) -> None: ...
30
+ def __init__(self) -> None: ...
31
+ def __del__(self) -> None: ...
libuseful/lib_args.pyc ADDED
Binary file
libuseful/lib_args.pyi ADDED
@@ -0,0 +1,23 @@
1
+ from .lib_logger import *
2
+ from _typeshed import Incomplete
3
+
4
+ logger: Incomplete
5
+
6
+ class CArgParserCommon:
7
+ __inst__: Incomplete
8
+ __arg_info__: Incomplete
9
+ def __init__(self, name: str, desc: str = 'No Description.', sign_log: str = 'No Sign') -> None: ...
10
+ def get_parser_instance(self): ...
11
+ def get_info_handler(self): ...
12
+ def extract_arg_info(self): ...
13
+ def get_arg_info(self, item_name) -> None: ...
14
+ def post_proc_of_parse(self, arg_info) -> None: ...
15
+
16
+ class CHargs:
17
+ __cmd__: Incomplete
18
+ __arg_leng__: Incomplete
19
+ __arg_parser__: Incomplete
20
+ def __init__(self, class_inst: CArgParserCommon) -> None: ...
21
+ def get_cmd(self): ...
22
+ def get_arg_leng(self): ...
23
+ def get_arg_data(self, item_name): ...
Binary file
@@ -0,0 +1,25 @@
1
+ from .lib_logger import *
2
+ import asyncio
3
+ from typing import Callable
4
+
5
+ __all__ = ['CAsyncLoop']
6
+
7
+ class CAsyncLoop:
8
+ THR_JOIN_TIMEOUT: float
9
+ GATHER_TASK_NAME: str
10
+ MAJOR_TASK_NAME: str
11
+ class KEY:
12
+ NAME: str
13
+ FUNC: str
14
+ ARGS: str
15
+ KWARGS: str
16
+ CALLBACK: str
17
+ def register_task(self, name: str, func, callback: Callable[[asyncio.Task], None] = None, *args, **kwargs): ...
18
+ def unregister_task(self, name: str = None): ...
19
+ def start(self) -> None: ...
20
+ def start_onece(self, name: str, func, callback: Callable[[asyncio.Task], None] = None, *args, **kwargs): ...
21
+ def start_n_wait_done(self): ...
22
+ def wait_done(self, hook: Callable[[], None] = None): ...
23
+ async def run_inline_thread(self, func, *args, **kwargs): ...
24
+ def __init__(self) -> None: ...
25
+ def __del__(self) -> None: ...
Binary file
@@ -0,0 +1,17 @@
1
+ from .lib_logger import *
2
+ from _typeshed import Incomplete
3
+
4
+ __all__ = ['CamRecoder']
5
+
6
+ class CamRecoder:
7
+ @property
8
+ def cam(self): ...
9
+ @property
10
+ def output(self): ...
11
+ @property
12
+ def is_running(self): ...
13
+ def start(self) -> None: ...
14
+ def stop(self) -> None: ...
15
+ def __init__(self, cam_idx: int, dir_path: str, file_name: str, mirror: bool = False, func_uptime: Incomplete | None = None) -> None: ...
16
+ def __del__(self) -> None: ...
17
+ def __clean__(self) -> None: ...
Binary file
@@ -0,0 +1,10 @@
1
+ from .lib_logger import *
2
+ import types
3
+ from _typeshed import Incomplete
4
+
5
+ logger: Incomplete
6
+
7
+ def import_module(absolute_path: str): ...
8
+ def import_class(module: types.ModuleType, class_name: str): ...
9
+ def get_path_class(data: dict): ...
10
+ def get_class_reference(data: dict, local_root: str): ...
libuseful/lib_enum.pyc ADDED
Binary file
libuseful/lib_enum.pyi ADDED
@@ -0,0 +1,6 @@
1
+ __all__ = ['ENUM_STR', 'enum']
2
+
3
+ class ENUM_STR:
4
+ def __init__(self, val: str) -> None: ...
5
+
6
+ def enum(**enums): ...
Binary file
@@ -0,0 +1,66 @@
1
+ from openpyxl.styles import *
2
+ from openpyxl.chart import *
3
+ from openpyxl.utils import *
4
+ from openpyxl.utils.exceptions import *
5
+ from .exception import *
6
+ from .lib_logger import *
7
+ import openpyxl as xl
8
+ import pandas as pd
9
+ from _typeshed import Incomplete
10
+ from openpyxl.worksheet.worksheet import Worksheet as Worksheet
11
+
12
+ logger: Incomplete
13
+
14
+ class Cexcel:
15
+ class Color:
16
+ BLACK: Incomplete
17
+ WHITE: Incomplete
18
+ RED: Incomplete
19
+ GREEN: Incomplete
20
+ BLUE: Incomplete
21
+ YELLOW: Incomplete
22
+ DARKRED: Incomplete
23
+ DARKGREEN: Incomplete
24
+ DARKBLUE: Incomplete
25
+ DARKYELLOW: Incomplete
26
+ JSON_POSTFIX: str
27
+ @staticmethod
28
+ def create_simple_df(data: dict | list, columns: list): ...
29
+ @staticmethod
30
+ def create_df(data: list, columns: list = None, indexes: list = None): ...
31
+ def create_cell_style(self, font_size: int, font_color: Color, font_bold: bool = False, font_italic: bool = False, _border: Border = ..., _alignment: Alignment = ..., _fill: PatternFill = None): ...
32
+ def get_sheet(self, name: str, not_exist_then_create: bool = True): ...
33
+ def get_sheet_names(self): ...
34
+ def remove_sheet(self, name: str): ...
35
+ def save(self, file_path: str): ...
36
+ def close(self) -> None: ...
37
+ def __init__(self, file_path: str = None, wb: xl.Workbook = None) -> None: ...
38
+
39
+ class _Csheet_:
40
+ class MERGE_DIR:
41
+ COLUMNS: int
42
+ ROWS: int
43
+ def append_message(self, msg: str, start_col_name: str, end_col_name: str, gap_blank: int = 1, gap_post: int = 0, border_rows: int = 1, style: NamedStyle = ...): ...
44
+ def append_df(self, df: pd.DataFrame, title: str = None, start_col_name: str = 'A', gap_blank: int = 1, gap_title: int = 1, title_border_rows: int = 3, title_style: NamedStyle = ..., skip_column: bool = False, column_style: NamedStyle = None, column_space: list = None, index_style: NamedStyle = ..., base_style: NamedStyle = ..., desp_text: str = None): ...
45
+ def extract_dfs(self): ...
46
+ @property
47
+ def name(self): ...
48
+ @property
49
+ def json_data(self): ...
50
+ def __init__(self, sheet: Worksheet, excel_path: str = None) -> None: ...
51
+
52
+ class _CjsonSheet_:
53
+ class KEY:
54
+ SHEET: str
55
+ TITLE: str
56
+ DESP: str
57
+ DATA: str
58
+ TABLES: str
59
+ FORMAT_TYPE: str
60
+ @property
61
+ def data(self): ...
62
+ @property
63
+ def table_cnt(self): ...
64
+ def append_table(self, title: str, df: pd.DataFrame, desp: str = None): ...
65
+ def get_table(self, idx: int): ...
66
+ def __init__(self, name: str, json_path: str = None) -> None: ...
Binary file
@@ -0,0 +1,24 @@
1
+ from .lib_singleton import *
2
+ from .lib_logger import *
3
+
4
+ __all__ = ['CFatalErr']
5
+
6
+ class CFatalErr(Singleton):
7
+ class KEY:
8
+ ID: str
9
+ TYPE: str
10
+ MODE: str
11
+ PC_STAMP: str
12
+ MSG: str
13
+ class TYPE:
14
+ NONE: str
15
+ ADB: str
16
+ class MODE:
17
+ BROKEN: str
18
+ INFINITE_WAIT: str
19
+ OFFLINE: str
20
+ def get_infos(self, type: TYPE = ...) -> dict: ...
21
+ def get_info(self, id: str) -> dict: ...
22
+ def set_info(self, type: TYPE, mode: MODE, err: str) -> str: ...
23
+ def __init__(self) -> None: ...
24
+ def __del__(self) -> None: ...
libuseful/lib_file.pyc ADDED
Binary file
libuseful/lib_file.pyi ADDED
@@ -0,0 +1,18 @@
1
+ from .lib_logger import *
2
+ from .exception import CENullException as CENullException
3
+ from _typeshed import Incomplete
4
+
5
+ logger: Incomplete
6
+ LINE_ENDING_WINDOW: bytes
7
+ LINE_ENDING_LINUX: bytes
8
+ CODEC: str
9
+
10
+ def append_text(text: str, contents: str) -> str: ...
11
+ def create_text_file(file_path: str, contents: str) -> None: ...
12
+ def create_json_file(file_path: str, data: dict) -> None: ...
13
+ def delete_file(file_path: str) -> None: ...
14
+ def read_text_file(file_path: str, encoder: str = ...) -> list[str]: ...
15
+ def read_json_file(file_path: str, with_annotation: bool = False) -> dict: ...
16
+ def read_json(contents: str, with_annotation: bool = False, replace_str_indicator: bool = False) -> dict: ...
17
+ def write_string(contents: dict) -> str: ...
18
+ def copy_json_file(src_path: str, dest_path: str, with_annotation: bool = False) -> None: ...
Binary file
@@ -0,0 +1,37 @@
1
+ from .lib_enum import ENUM_STR as myEnum
2
+ from .lib_watchdog import IWatchDog
3
+ from _typeshed import Incomplete
4
+
5
+ __all__ = ['CmyLogger', 'get_instance', 'assertMy', 'WTD_logSignal']
6
+
7
+ class WTD_logSignal(IWatchDog):
8
+ SIGNAL_ID: Incomplete
9
+ SIGNAL_LISTEN_ID: Incomplete
10
+ def start(self, sig_handler: Incomplete | None = None) -> None: ...
11
+ def __init__(self) -> None: ...
12
+
13
+ class CmyLogger:
14
+ DEBUG_MODE: Incomplete
15
+ RELEASE_MODE: Incomplete
16
+ DEBUG_LEVEL: Incomplete
17
+ INFO_LEVEL: Incomplete
18
+ WARN_LEVEL: Incomplete
19
+ ERROR_LEVEL: Incomplete
20
+ NONE_LEVEL: Incomplete
21
+ def set_project(self, prj: str): ...
22
+ def stop(self) -> None: ...
23
+ def __init__(self, level: myEnum = ..., mode: myEnum = ...) -> None: ...
24
+ def __get_frameInfo__(self, func_deepth: int = 0): ...
25
+ def __level_int_to_str__(self, level: int) -> myEnum: ...
26
+ def __level_str_to_int__(self, level: myEnum) -> int: ...
27
+ def __set_mode__(self, mode: myEnum): ...
28
+ def __set_level__(self, level: myEnum): ...
29
+ def __get_level__(self) -> myEnum: ...
30
+ def get_level(self) -> str: ...
31
+ def error(self, *args, **kwargs) -> None: ...
32
+ def warn(self, *args, **kwargs) -> None: ...
33
+ def info(self, *args, **kwargs) -> None: ...
34
+ def debug(self, *args, **kwargs) -> None: ...
35
+
36
+ def get_instance(level_of_file: myEnum = None, mode: myEnum = None) -> CmyLogger: ...
37
+ def assertMy(func, except_type, msg: str = '', debug_msg: str = None): ...
Binary file
@@ -0,0 +1,31 @@
1
+ from .lib_logger import *
2
+ from _typeshed import Incomplete
3
+
4
+ logger: Incomplete
5
+
6
+ class MG_LINE:
7
+ @staticmethod
8
+ def slope_constant(p1: tuple, p2: tuple): ...
9
+ @staticmethod
10
+ def intersection_point(line1: tuple, line2: tuple): ...
11
+
12
+ class MG_RECT:
13
+ class MERGE_COND:
14
+ EQ_LEFT: str
15
+ EQ_RIGHT: str
16
+ @staticmethod
17
+ def check_validation(target: str, rect: list): ...
18
+ @staticmethod
19
+ def distinguish_intersected(src_rect: list, rect2: list): ...
20
+ @staticmethod
21
+ def calc_intersection(rect1: list, rect2: list): ...
22
+ @staticmethod
23
+ def is_intersection(rec1: list, rec2: list): ...
24
+ @staticmethod
25
+ def is_inner_point(rect: list, point: tuple): ...
26
+ @staticmethod
27
+ def is_include(parent: list, child: list): ...
28
+ @staticmethod
29
+ def max_area(rect_list: list): ...
30
+ @staticmethod
31
+ def merge_area(src: list, dest: list, cond: list[MERGE_COND] = ...): ...
libuseful/lib_path.pyc ADDED
Binary file
libuseful/lib_path.pyi ADDED
@@ -0,0 +1,34 @@
1
+ from .lib_logger import *
2
+ from _typeshed import Incomplete
3
+
4
+ logger: Incomplete
5
+
6
+ class CPath:
7
+ @staticmethod
8
+ def join_paths(path1: str, path2: str) -> str: ...
9
+ @staticmethod
10
+ def get_rootpath(): ...
11
+ @staticmethod
12
+ def get_module_root(module, internal_path: Incomplete | None = None): ...
13
+ @staticmethod
14
+ def get_dirpath(filepath: str): ...
15
+ @staticmethod
16
+ def get_filename(filepath): ...
17
+ @staticmethod
18
+ def split_filename_ext(filepath): ...
19
+ @staticmethod
20
+ def is_abspath(path: str): ...
21
+ @staticmethod
22
+ def get_relpath(target_abs_path: str, base_path: str) -> str: ...
23
+ @staticmethod
24
+ def get_abspath(rel_path: str = None) -> str: ...
25
+ @staticmethod
26
+ def get_rear_path(full_path: str, rear_cnt: int): ...
27
+ @staticmethod
28
+ def check_exist(path: str, attribute: str): ...
29
+ @staticmethod
30
+ def classfy_files_dirs(dirpath: str): ...
31
+ @staticmethod
32
+ def make_dirs(dirpath: str): ...
33
+ @staticmethod
34
+ def send_local_to_linux(src: str, dest_dir: str, send_func): ...
Binary file
@@ -0,0 +1,10 @@
1
+ from .lib_logger import *
2
+ from _typeshed import Incomplete
3
+
4
+ logger: Incomplete
5
+
6
+ def join_paths(path1: str, path2: str) -> str: ...
7
+ def get_dirpath(filepath: str): ...
8
+ def get_filename(filepath: str): ...
9
+ def split_filename_ext(filepath): ...
10
+ def get_relpath(target_abs_path: str, base_path: str) -> str: ...
Binary file
@@ -0,0 +1,30 @@
1
+ from .lib_logger import *
2
+ import multiprocessing
3
+ import multiprocessing.synchronize
4
+
5
+ __all__ = ['CMprocessors', 'CProcessor']
6
+
7
+ class CProcessor(multiprocessing.Process):
8
+ @property
9
+ def is_continue(self) -> bool: ...
10
+ @is_continue.setter
11
+ def is_continue(self, value: bool): ...
12
+ def append_queue(self, qname: str): ...
13
+ def get_queue_list(self) -> list: ...
14
+ def get_queue(self, qname: str) -> multiprocessing.Queue: ...
15
+ def append_event(self, ename: str): ...
16
+ def get_event_list(self) -> list: ...
17
+ def get_event(self, ename: str) -> multiprocessing.synchronize.Event: ...
18
+ def thread_join(self) -> None: ...
19
+ def run(self) -> None: ...
20
+ def __init__(self, name: str, func, args: tuple = (), kwargs: dict = {}) -> None: ...
21
+ def __del__(self) -> None: ...
22
+
23
+ class CMprocessors:
24
+ def append_processor(self, name: str, run_func, args: tuple = (), kwargs: dict = {}, queue_names: list = None, event_names: list = None): ...
25
+ def start_all(self) -> None: ...
26
+ def remove_processor(self, tname: str): ...
27
+ def get_processor_list(self) -> list: ...
28
+ def get_processor_handler(self, tname: str) -> CProcessor: ...
29
+ def __init__(self) -> None: ...
30
+ def __del__(self) -> None: ...
libuseful/lib_ps.pyc ADDED
Binary file
libuseful/lib_ps.pyi ADDED
@@ -0,0 +1,44 @@
1
+ from .exception import *
2
+ from .lib_logger import *
3
+ import psutil
4
+ from .lib_shell_raw import local_shell as local_shell
5
+ from _typeshed import Incomplete
6
+
7
+ logger: Incomplete
8
+
9
+ class CProcess:
10
+ @property
11
+ def name(self): ...
12
+ @property
13
+ def command(self): ...
14
+ @property
15
+ def pid(self): ...
16
+ @property
17
+ def username(self): ...
18
+ @property
19
+ def is_running(self): ...
20
+ def kill(self) -> None: ...
21
+ def __init__(self, proc: psutil.Process) -> None: ...
22
+ @staticmethod
23
+ def collect(cmd: str, name: str = None, user: str = None): ...
24
+
25
+ class CProcess:
26
+ class KEY:
27
+ NAME: str
28
+ PID: str
29
+ STATUS: str
30
+ USER: str
31
+ @property
32
+ def name(self): ...
33
+ @property
34
+ def command(self): ...
35
+ @property
36
+ def pid(self): ...
37
+ @property
38
+ def username(self): ...
39
+ @property
40
+ def is_running(self): ...
41
+ def kill(self): ...
42
+ def __init__(self, imgname: str, pid: str, status: str, user: str) -> None: ...
43
+ @staticmethod
44
+ def collect(cmd: str, name: str = None, user: str = None): ...
Binary file
@@ -0,0 +1,5 @@
1
+ from _typeshed import Incomplete
2
+
3
+ __all__ = ['retry']
4
+
5
+ def retry(exceptions=..., tries: int = -1, delay: int = 0, max_delay: Incomplete | None = None, backoff: int = 1, jitter: int = 0, logger=...): ...
Binary file
@@ -0,0 +1,30 @@
1
+ from .lib_retry import *
2
+ from .exception import *
3
+ from .lib_logger import *
4
+ from .lib_ps import CProcess as CProcess
5
+ from _typeshed import Incomplete
6
+
7
+ logger: Incomplete
8
+
9
+ class TYPE:
10
+ DIR: str
11
+ FILE: str
12
+ ALL_FILES: str
13
+
14
+ class TAR_TYPE:
15
+ GZ: str
16
+ TGZ: str
17
+ @staticmethod
18
+ def all(): ...
19
+
20
+ def local_shell(command: str, timeout_sec: int = 5): ...
21
+ def local_check_process(cmd: str, name: str = None, user: str = None, kill: bool = False): ...
22
+ def local_execute_backend(command: str, working_dir: str = None): ...
23
+ def local_start_adbd(): ...
24
+ def local_kill_adbd(): ...
25
+ def local_mkdir(dir_path: str): ...
26
+ def local_date() -> str: ...
27
+ def local_ping(ip: str, cnt: int = 5) -> str: ...
28
+ def local_copy(src: str, src_type: TYPE, dest: str, dest_type: TYPE = ...): ...
29
+ def local_remove(src: str, type: TYPE = ...): ...
30
+ def local_tar_compress(src: list[str], out: str, src_dir: str = None, out_type: TAR_TYPE = ..., timeout_sec: int = 5): ...
Binary file
@@ -0,0 +1,30 @@
1
+ from .exception import *
2
+ from .lib_logger import *
3
+ from typing import Callable
4
+
5
+ __all__ = ['local_shell', 'start_rt_shell', 'stop_rt_shell', 'check_rt_shell', 'CShellRT']
6
+
7
+ class OS_NAME:
8
+ LINUX: str
9
+ WINDOWS: str
10
+ MAC: str
11
+
12
+ def local_shell(command: str, timeout_sec: int = 5): ...
13
+
14
+ class CShellRT:
15
+ ERR_INVALID_ARG: int
16
+ @property
17
+ def handle(self): ...
18
+ @property
19
+ def is_continue(self): ...
20
+ @property
21
+ def cmd(self): ...
22
+ def start(self) -> None: ...
23
+ def stop(self) -> None: ...
24
+ def __init__(self, command: str | list[str], call_back: Callable[[list[str], int], bool] = None, release_timeout: float = 60.0) -> None: ...
25
+ def __del__(self) -> None: ...
26
+ def __iter__(self): ...
27
+
28
+ def start_rt_shell(command: str, call_back: Callable[[list[str], int], bool] = None) -> CShellRT: ...
29
+ def stop_rt_shell(handler: CShellRT) -> None: ...
30
+ def check_rt_shell(handler: CShellRT) -> bool: ...
Binary file
@@ -0,0 +1,5 @@
1
+ __all__ = ['Singleton']
2
+
3
+ class Singleton:
4
+ @classmethod
5
+ def get_instance(cls, *args, **kargs): ...
Binary file
@@ -0,0 +1,19 @@
1
+ import threading
2
+ from queue import Queue
3
+
4
+ __all__ = ['CThread']
5
+
6
+ class CThread(threading.Thread):
7
+ @property
8
+ def is_continue(self): ...
9
+ @is_continue.setter
10
+ def is_continue(self, value: bool): ...
11
+ def append_queue(self, qname: str): ...
12
+ def get_queue_list(self) -> list: ...
13
+ def get_queue(self, qname: str) -> Queue: ...
14
+ def append_event(self, ename: str): ...
15
+ def get_event_list(self) -> list: ...
16
+ def get_event(self, ename: str) -> threading.Event: ...
17
+ def run(self) -> None: ...
18
+ def __init__(self, name: str, func, daemon: bool = False, args: tuple = (), kwargs: dict = {}) -> None: ...
19
+ def __del__(self) -> None: ...
Binary file
@@ -0,0 +1,14 @@
1
+ from .lib_logger import *
2
+ from .lib_thread import CThread
3
+
4
+ __all__ = ['CMthreads']
5
+
6
+ class CMthreads:
7
+ def append_thread(self, name: str, run_func, args: tuple = (), kwargs: dict = {}, daemon: bool = False, queue_names: list = None, event_names: list = None): ...
8
+ def start_all(self) -> None: ...
9
+ def stop_all(self) -> None: ...
10
+ def remove_thread(self, tname: str): ...
11
+ def get_thread_list(self) -> list: ...
12
+ def get_thread_handler(self, tname: str) -> CThread: ...
13
+ def __init__(self) -> None: ...
14
+ def __del__(self) -> None: ...
libuseful/lib_time.pyc ADDED
Binary file
libuseful/lib_time.pyi ADDED
@@ -0,0 +1,13 @@
1
+ from datetime import tzinfo
2
+
3
+ def DATE() -> str: ...
4
+ def TIME() -> str: ...
5
+ def get_UTC() -> float: ...
6
+ def get_DATE(date_format: str = '%Y-%m-%d %H:%M:%S') -> str: ...
7
+ def get_ZONE() -> str: ...
8
+ def get_UTC_time(any_date: str, timezone: str, date_format: str = '%Y-%m-%d %H:%M:%S') -> str: ...
9
+ def get_UTC_timestamp(any_date: str, timezone: str, date_format: str = '%Y-%m-%d %H:%M:%S') -> float: ...
10
+ def cvt_utc(utc: float, date_format: str = '%Y-%m-%d %H:%M:%S') -> str: ...
11
+ def cvt_utc_DATE(utc: float, timezone: tzinfo = None, zone_utc: bool = False) -> tuple[str, str]: ...
12
+ def cvt_DATE(from_date: str, from_tz: str, to_tz: str, utc_gap: float = 0.0) -> str: ...
13
+ def get_GAP(from_date: str, from_tz: str, to_date: str, to_tz: str) -> float: ...
Binary file
@@ -0,0 +1,37 @@
1
+ from .lib_logger import *
2
+ from typing import Any, Callable
3
+
4
+ __all__ = ['UserManager', 'get_UTC', 'str_UTC']
5
+
6
+ def get_UTC(): ...
7
+ def str_UTC(utc: float): ...
8
+
9
+ class UserManager:
10
+ class CValue:
11
+ state: bool
12
+ unsub_func: Callable[[str], Any]
13
+ def __init__(self, state: bool, unsub_func: Callable[[str], Any]) -> None: ...
14
+ def __call__(self, state: bool, unsub_func: Callable[[str], Any]): ...
15
+ def __del__(self) -> None: ...
16
+ class State:
17
+ INSERTED: str
18
+ DUPLICATED: str
19
+ OVERFLOW: str
20
+ NOT_ALLOWED_USER: str
21
+ DEF_MAX_USERS: int
22
+ TIMESTAMP: str
23
+ @property
24
+ def uid_list(self): ...
25
+ def get_service_list(self, user_id: str): ...
26
+ def __init__(self, max_users: int = ...) -> None: ...
27
+ def __del__(self) -> None: ...
28
+ def join(self, timeout: float = 0.0): ...
29
+ def reg_user(self, user_id: str) -> State: ...
30
+ def unreg_user(self, user_id: str): ...
31
+ def reg_service(self, user_id: str, svc_name: str, func: Callable[[str], Any]) -> State: ...
32
+ def unreg_service(self, user_id: str, svc_name: str, force: bool = False): ...
33
+ def is_available_user(self, user_id: str): ...
34
+ def is_available(self, user_id: str, svc_name: str) -> bool: ...
35
+ def set_state(self, user_id: str, svc_name: str, stat: bool) -> bool: ...
36
+ def get_timestamp(self, user_id: str): ...
37
+ def update_timestamp(self, user_id: str): ...
Binary file
@@ -0,0 +1,13 @@
1
+ from abc import *
2
+ from .lib_singleton import Singleton as Singleton
3
+ from .lib_thread import CThread as CThread
4
+
5
+ class IWatchDog(Singleton, metaclass=ABCMeta):
6
+ DEF_MAX_SEC: int
7
+ def is_activated(self): ...
8
+ def start(self) -> None: ...
9
+ def stop(self) -> None: ...
10
+ def reset(self) -> None: ...
11
+ def __init__(self, enable: bool = True, limited_sec: int = ...) -> None: ...
12
+ def __del__(self) -> None: ...
13
+ def __clean__(self) -> None: ...
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2018 The Python Packaging Authority
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
@@ -0,0 +1,50 @@
1
+ Metadata-Version: 2.1
2
+ Name: libuseful
3
+ Version: 0.4.1
4
+ Summary: It's useful library, commonly.\n(path/file/shell/thread/process/watchdog/async/args/logger/retry/singleton/time/cam/dynamic_import/excel/geometry_math/user_mng)
5
+ License: MIT
6
+ Keywords: libuseful,useful,library,common-lib,util
7
+ Author: Kim EunSeok
8
+ Author-email: es.odysseus@gmail.com
9
+ Requires-Python: >=3.8,<4.0
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: Microsoft :: Windows :: Windows 10
12
+ Classifier: Operating System :: POSIX :: Linux
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Classifier: Topic :: Utilities
22
+ Requires-Dist: chardet (>=5.2.0,<6.0.0)
23
+ Requires-Dist: numpy (==1.24.4)
24
+ Requires-Dist: opencv-python (==4.8.1.78)
25
+ Requires-Dist: openpyxl (>=3.1.5,<4.0.0)
26
+ Requires-Dist: pandas (==2.0.3)
27
+ Requires-Dist: psutil (>=6.1.0,<7.0.0)
28
+ Requires-Dist: pure-python-adb (==0.3.*)
29
+ Requires-Dist: python-dateutil (>=2.9.0.post0,<3.0.0)
30
+ Requires-Dist: retry (>=0.9.2,<0.10.0)
31
+ Description-Content-Type: text/markdown
32
+
33
+ ## Developer
34
+
35
+ - Eunseok, Kim (email : <es.odysseus@gamil.com>)
36
+
37
+ ---
38
+
39
+ ## Latest Release
40
+
41
+ - version 0.4.1
42
+
43
+ ---
44
+
45
+ ## Prerequisites
46
+ >
47
+ > Python Version : >= 3.8
48
+ > Tested OS : Windows10 , Ubuntu18.04 LTS
49
+
50
+
@@ -0,0 +1,56 @@
1
+ libuseful-0.4.1.dist-info/LICENSE,sha256=2bm9uFabQZ3Ykb_SaSU_uUbAj2-htc6WJQmS_65qD00,1073
2
+ libuseful-0.4.1.dist-info/METADATA,sha256=hjpsUtNxjosc8ingavOiUU54byAODWb9EMCgcV7XTNc,1592
3
+ libuseful-0.4.1.dist-info/RECORD,,
4
+ libuseful-0.4.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
5
+ libuseful/__init__.pyc,sha256=oTe8cTHIfFkk2Pe3okjzYvX4nprEYXsZQIzKVjg8uQ8,151
6
+ libuseful/__init__.pyi,sha256=Y25n44pyE3vp92MiABKrcK3IWRyQ1JG1rZ4Ufqy2nC0,17
7
+ libuseful/exception.pyc,sha256=bhaqXyYwxT4C-MQgj4sp5HB-tCrKk7LbzpOVkXsuNFE,2539
8
+ libuseful/exception.pyi,sha256=4GHt6yZFKZvg2KGvMhyq8cHVp3o3e3rCU_QcUVHdq54,863
9
+ libuseful/lib_adb.pyc,sha256=R_4GjtO5HJbDf_djTgcdJW4v0P1koHOx1bdxdqX3hUs,8115
10
+ libuseful/lib_adb.pyi,sha256=nKvsgYuxwamDc_pIQWj2mCoQ74XV9UfL_agpi7Lr9OI,1059
11
+ libuseful/lib_args.pyc,sha256=5UX4F_jIrsT2fjdyPR2VlnYiYOaEGd9nJ-4odGx5ho4,3153
12
+ libuseful/lib_args.pyi,sha256=dw2I6oil_8cIt3RUegChgZ8JRax2mc2h6g4Bvz-lGus,748
13
+ libuseful/lib_async_loop.pyc,sha256=FfeGZp2XBzM4z_1AG8oyFml8awT8J6L7CaCyb_fFJZo,9529
14
+ libuseful/lib_async_loop.pyi,sha256=_RF512rJO77FKwuugLa-mlhNaEZP6z24n6TKhIn6Zg0,856
15
+ libuseful/lib_cam_record.pyc,sha256=tAa1hrZGr9ofonp6RLg0H9CLhgd_P8E_qVVpfRrzhcM,7154
16
+ libuseful/lib_cam_record.pyi,sha256=YuT0zBGjlh0X0Xnqf9m8EyjM4E8kHimESn4umD9I3Uw,504
17
+ libuseful/lib_dynamic_import.pyc,sha256=Rd-RPK1c9PLFdPcpnRTYn9K3OqqI_gWmNx4LRkJidAM,2281
18
+ libuseful/lib_dynamic_import.pyi,sha256=zvZGqvaxtiZTIyyrox_SIcjGXF7GicKXKVXadG6WuZE,295
19
+ libuseful/lib_enum.pyc,sha256=YEE-Mx_SImR8JaxQ8wtJvw9ynBgG_5s9NKQLeXmc644,719
20
+ libuseful/lib_enum.pyi,sha256=azMVcLRQaaslvmxJdJeLPE-dhJJBULrt01ldhPaRQ1k,118
21
+ libuseful/lib_excel.pyc,sha256=KJ82GVFXiVSNT9wQgfOrEN-OhlPRPdHNZeYyB5F3ZPU,26100
22
+ libuseful/lib_excel.pyi,sha256=OHauQj2SBdL4Ui1LxOs8LIoVUOjGLmF9bjc1HBECar8,2577
23
+ libuseful/lib_fatal.pyc,sha256=A84MxG5IEUfA1L94olhdUobO9UJ5Lituv3bJvriCubw,2603
24
+ libuseful/lib_fatal.pyi,sha256=93FL6Ger8HX6btxFMEawVCruYYD1-4gJwH0r7okdAC0,590
25
+ libuseful/lib_file.pyc,sha256=pTRVsoqwB2bN65o4lZ2xt-dMnPwhmC_7Ju40uRKc8l4,5164
26
+ libuseful/lib_file.pyi,sha256=HyjK9pysU9Rg6AC4RZG-LnHqIYmzPCvvkfxju6VBVQ8,827
27
+ libuseful/lib_logger.pyc,sha256=YAihr0A1cy2-m9L0frW31BDNrVvBI9vYEpsIzEGzTMU,8018
28
+ libuseful/lib_logger.pyi,sha256=uxJT5C7NLWbRW6DYflxrULFiOxtc3Fov8wb-lIe6Bwo,1457
29
+ libuseful/lib_math_geometry.pyc,sha256=VQ8ePaBsKXJKkL-e0OF98nup3oEQnFxS2WoJoJ5EO7A,9341
30
+ libuseful/lib_math_geometry.pyi,sha256=pl76G1WobJohDxEPeSmcymC1UrOAclHScULq-RI50BQ,918
31
+ libuseful/lib_path.pyc,sha256=nE9-V3o2EkSqZn1j0K_fbPFfQyeew7_TEBSRknLAj5U,5957
32
+ libuseful/lib_path.pyi,sha256=N90_gdmN8yvjNckXWSkSAtL1og7P-2iNg2xmt_xg__M,1045
33
+ libuseful/lib_path_remote_linux.pyc,sha256=tThTIvC11fpO5aI1zwGgAR3uJkh0EJADX1W6bI2kxEg,1681
34
+ libuseful/lib_path_remote_linux.pyi,sha256=u8WWaI3BN53VTSh_zVN8anYfplR_hwqLPtkDpZURWRs,308
35
+ libuseful/lib_processor.pyc,sha256=e9ZjmfUupwNSysJKpQ1KZYlmfXObMP84liNjJ_EE_-8,8101
36
+ libuseful/lib_processor.pyi,sha256=kzLb553puO1Kb6nfXQH3qhP4mapb2DbIdeAp0n9mm4U,1238
37
+ libuseful/lib_ps.pyc,sha256=CL9vIdDUrvLgJoM_vByjTEZj3Aohc2nowUp99HvRdP8,7701
38
+ libuseful/lib_ps.pyi,sha256=dyyk0EpR5ZWwEoijYbRGvcjaTEeqXE-AeN8TC-4Tp80,1066
39
+ libuseful/lib_retry.pyc,sha256=bvzchoY0kC_XvhFeAltntOVCWe26t8IvA3BgPypKOzk,5305
40
+ libuseful/lib_retry.pyi,sha256=5Wk_Nh3K87jjgeNpbddypjdPPygcBkpX1jD7MkWMoZ4,203
41
+ libuseful/lib_shell.pyc,sha256=JkuCE1E3hyfqCXqIhm43R0sJU-KWRfAM3p7G1YeCn6Y,8530
42
+ libuseful/lib_shell.pyi,sha256=p1_yRPOeyscH-Pd6_DWcH4Xx_WlOUmOv72c60F9n5rY,954
43
+ libuseful/lib_shell_raw.pyc,sha256=lYS5cN-ZZo8PTOLZ09n2J_sgxeDao1Xqi72VoEo80u8,8775
44
+ libuseful/lib_shell_raw.pyi,sha256=elZ-hzJIgwtqyAFru94ypujn4khHL1-tivJYONYFQwc,931
45
+ libuseful/lib_singleton.pyc,sha256=vsy_uGPUBEGXAdW7EA4RrGRq4nzWLgB6Jb5CVzRoj30,749
46
+ libuseful/lib_singleton.pyi,sha256=9NYqobLrRZy9OdJI4n2lFyK2ll_UXHtLEqez8A79dW4,106
47
+ libuseful/lib_thread.pyc,sha256=urzAtjTlIp55Zwk3EQrHI_ZN4JbYXmnGmQqc7KFMmRY,4624
48
+ libuseful/lib_thread.pyi,sha256=H43o3x8Ix4BLIW9B7jIHKE9JB18t6gc1tGnkUyU7lmk,671
49
+ libuseful/lib_threadsM.pyc,sha256=MdvGnIQCIWJc2s0dGfPQGe9BMyik7Gtf6OWm7Iq_P58,3834
50
+ libuseful/lib_threadsM.pyi,sha256=YJUOFiTcOQHIQm1Pffmn91PRFiccf7R10WokJ6lwCQ0,559
51
+ libuseful/lib_time.pyc,sha256=sSTMavByu3NH7Guju7GoBD6f9ksXc1oKKg9uLAKYMIs,7596
52
+ libuseful/lib_time.pyi,sha256=2cJUyQohQ1esDlYwdcGgx_sjfQ4i6_s6snyL68WodzA,749
53
+ libuseful/lib_usermng.pyc,sha256=8zQrMywjpkS-GTMktMvkrtbVcn1WDFGHZ1XWe_Q1elI,9978
54
+ libuseful/lib_usermng.pyi,sha256=C29U1ftLjiDUotFKcBqG7FS_rMCMGgTfVU6OJaiOq7M,1419
55
+ libuseful/lib_watchdog.pyc,sha256=vw74hjHnfE4TduP-1-JodVE1x9kgVIpOO9cufe7avYA,4801
56
+ libuseful/lib_watchdog.pyi,sha256=oDFmHhFBmTuwyMJhJcVTJ-Yhw-qLz9OBtyyqvnT2qTc,463
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 1.9.1
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any