diff --git a/Makefile b/Makefile index 514b6bb..926d6ca 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ all: .PHONY: test test: venv source venv/bin/activate - python3 src/p1st/test.py + python3 src/subprocess_util/test.py venv: if [ -d venv ]; then diff --git a/setup.cfg b/setup.cfg index 07d30e4..f0d8509 100644 --- a/setup.cfg +++ b/setup.cfg @@ -32,8 +32,8 @@ where = src [options.entry_points] ; https://setuptools.readthedocs.io/en/latest/userguide/entry_point.html console_scripts = - btrfs-send-chunks-active = p1st.btrfs_send_chunks_active:main - btrfs-receive-chunks-passive = p1st.btrfs_receive_chunks_passive:main + btrfs-send-chunks-active = subprocess_util.btrfs_send_chunks_active:main + btrfs-receive-chunks-passive = subprocess_util.btrfs_receive_chunks_passive:main - btrfs-send-chunks-passive = p1st.btrfs_send_chunks_passive:main - btrfs-receive-chunks-active = p1st.btrfs_receive_chunks_active:main + btrfs-send-chunks-passive = subprocess_util.btrfs_send_chunks_passive:main + btrfs-receive-chunks-active = subprocess_util.btrfs_receive_chunks_active:main diff --git a/src/p1st/__init__.py b/src/subprocess_util/__init__.py similarity index 100% rename from src/p1st/__init__.py rename to src/subprocess_util/__init__.py diff --git a/src/p1st/btrfs_receive_chunks_active.py b/src/subprocess_util/btrfs_receive_chunks_active.py similarity index 94% rename from src/p1st/btrfs_receive_chunks_active.py rename to src/subprocess_util/btrfs_receive_chunks_active.py index 385316b..1a15819 100644 --- a/src/p1st/btrfs_receive_chunks_active.py +++ b/src/subprocess_util/btrfs_receive_chunks_active.py @@ -5,14 +5,12 @@ import shlex from pathlib import Path from queue import Queue -from p1st.common import Message1, Message2, get_chunk_path, get_inform1_path, get_inform2_path -from p1st.exec_consume_chunks import execute_consume_chunks -from p1st.repeat import repeat_until_successful +from subprocess_util.common import Message1, Message2, get_chunk_path, get_inform1_path, get_inform2_path +from subprocess_util.exec_consume_chunks import execute_consume_chunks +from subprocess_util.repeat import repeat_until_successful def main(): - - args = parse_args() # ssh_source: str = args.ssh_source diff --git a/src/p1st/btrfs_receive_chunks_passive.py b/src/subprocess_util/btrfs_receive_chunks_passive.py similarity index 94% rename from src/p1st/btrfs_receive_chunks_passive.py rename to src/subprocess_util/btrfs_receive_chunks_passive.py index 4737b75..a316976 100644 --- a/src/p1st/btrfs_receive_chunks_passive.py +++ b/src/subprocess_util/btrfs_receive_chunks_passive.py @@ -5,8 +5,8 @@ import socket from pathlib import Path from queue import Queue -from p1st.exec_consume_chunks import execute_consume_chunks -from p1st.unix_sock_input import accept_loop_until_message +from subprocess_util.exec_consume_chunks import execute_consume_chunks +from subprocess_util.unix_sock_input import accept_loop_until_message def main(): diff --git a/src/p1st/btrfs_send_chunks_active.py b/src/subprocess_util/btrfs_send_chunks_active.py similarity index 97% rename from src/p1st/btrfs_send_chunks_active.py rename to src/subprocess_util/btrfs_send_chunks_active.py index 8ec26c8..b6d0743 100644 --- a/src/p1st/btrfs_send_chunks_active.py +++ b/src/subprocess_util/btrfs_send_chunks_active.py @@ -4,8 +4,8 @@ import argparse import shlex from pathlib import Path -from p1st.exec_produce_chunks import execute_produce_chunks -from p1st.repeat import repeat_until_successful +from subprocess_util.exec_produce_chunks import execute_produce_chunks +from subprocess_util.repeat import repeat_until_successful def main(): diff --git a/src/p1st/btrfs_send_chunks_passive.py b/src/subprocess_util/btrfs_send_chunks_passive.py similarity index 94% rename from src/p1st/btrfs_send_chunks_passive.py rename to src/subprocess_util/btrfs_send_chunks_passive.py index 8ddae92..e4907ab 100644 --- a/src/p1st/btrfs_send_chunks_passive.py +++ b/src/subprocess_util/btrfs_send_chunks_passive.py @@ -4,9 +4,9 @@ import argparse import socket from pathlib import Path -from p1st.common import Message1, Message2, get_inform1_path, get_inform2_path, get_chunk_path -from p1st.exec_produce_chunks import execute_produce_chunks -from p1st.unix_sock_input import accept_loop_until_message +from subprocess_util.common import Message1, Message2, get_inform1_path, get_inform2_path, get_chunk_path +from subprocess_util.exec_produce_chunks import execute_produce_chunks +from subprocess_util.unix_sock_input import accept_loop_until_message def main(): diff --git a/src/p1st/common.py b/src/subprocess_util/common.py similarity index 100% rename from src/p1st/common.py rename to src/subprocess_util/common.py diff --git a/src/p1st/data_units.py b/src/subprocess_util/data_units.py similarity index 100% rename from src/p1st/data_units.py rename to src/subprocess_util/data_units.py diff --git a/src/p1st/exec_capture.py b/src/subprocess_util/exec_capture.py similarity index 100% rename from src/p1st/exec_capture.py rename to src/subprocess_util/exec_capture.py diff --git a/src/p1st/exec_consume_chunks.py b/src/subprocess_util/exec_consume_chunks.py similarity index 98% rename from src/p1st/exec_consume_chunks.py rename to src/subprocess_util/exec_consume_chunks.py index bed722e..c22eded 100644 --- a/src/p1st/exec_consume_chunks.py +++ b/src/subprocess_util/exec_consume_chunks.py @@ -9,7 +9,7 @@ from pathlib import Path from queue import Queue from typing import Callable, IO, AnyStr -from p1st.data_units import DataUnitConverter +from subprocess_util.data_units import DataUnitConverter def execute_consume_chunks(command: list[str], diff --git a/src/p1st/exec_print_capture.py b/src/subprocess_util/exec_print_capture.py similarity index 100% rename from src/p1st/exec_print_capture.py rename to src/subprocess_util/exec_print_capture.py diff --git a/src/p1st/exec_produce_chunks.py b/src/subprocess_util/exec_produce_chunks.py similarity index 100% rename from src/p1st/exec_produce_chunks.py rename to src/subprocess_util/exec_produce_chunks.py diff --git a/src/p1st/receive_inform.py b/src/subprocess_util/receive_inform.py similarity index 96% rename from src/p1st/receive_inform.py rename to src/subprocess_util/receive_inform.py index fb9e58b..0564bac 100644 --- a/src/p1st/receive_inform.py +++ b/src/subprocess_util/receive_inform.py @@ -4,7 +4,7 @@ import socket from pathlib import Path from typing import IO, AnyStr, Callable -from p1st.unix_sock_input import accept_loop_until_message +from subprocess_util.unix_sock_input import accept_loop_until_message def receive_inform(in_pipe: IO[AnyStr], diff --git a/src/p1st/repeat.py b/src/subprocess_util/repeat.py similarity index 93% rename from src/p1st/repeat.py rename to src/subprocess_util/repeat.py index 5bd66f3..d384435 100644 --- a/src/p1st/repeat.py +++ b/src/subprocess_util/repeat.py @@ -1,8 +1,8 @@ import time from pathlib import Path -from p1st.exec_print_capture import execute_print_capture -from p1st.unix_sock_input import wait_for_message +from subprocess_util.exec_print_capture import execute_print_capture +from subprocess_util.unix_sock_input import wait_for_message def repeat_until_successful(command: list[str], diff --git a/src/p1st/test.py b/src/subprocess_util/test.py similarity index 92% rename from src/p1st/test.py rename to src/subprocess_util/test.py index 818bdf8..93ed458 100644 --- a/src/p1st/test.py +++ b/src/subprocess_util/test.py @@ -3,9 +3,9 @@ import shutil from pathlib import Path -from p1st.exec_capture import execute_capture -from p1st.exec_print_capture import execute_print_capture -from p1st.exec_produce_chunks import execute_produce_chunks +from subprocess_util.exec_capture import execute_capture +from subprocess_util.exec_print_capture import execute_print_capture +from subprocess_util.exec_produce_chunks import execute_produce_chunks def test(): @@ -34,9 +34,9 @@ def test1(): def test2(): _init(2) - returncode, out, err = execute_print_capture(['ls', '-la']) + _returncode, _out, _err = execute_print_capture(['ls', '-la']) print() - returncode, out, err = execute_print_capture(['ls', '/foo/bar']) + _returncode, _out, _err = execute_print_capture(['ls', '/foo/bar']) def test8(): @@ -77,14 +77,14 @@ def test9(): def test10(): _init(10) - source_file = Path('src/p1st/exec_capture.py') + source_file = Path('src/subprocess_util/exec_capture.py') chunk_dir = Path('test') target_file = Path('test/exec_capture.py') def get_chunk_path(chunk_no: int): return chunk_dir.joinpath(f'{source_file.name}.CHUNK.{chunk_no}') - def handle_chunk(chunk_no: int, last_chunk: bool): + def handle_chunk(chunk_no: int, _last_chunk: bool): chunk_path = get_chunk_path(chunk_no) print(f'Handling chunk {chunk_path}') diff --git a/src/p1st/unix_sock_input.py b/src/subprocess_util/unix_sock_input.py similarity index 100% rename from src/p1st/unix_sock_input.py rename to src/subprocess_util/unix_sock_input.py diff --git a/src/p1st/unix_socket_output.py b/src/subprocess_util/unix_socket_output.py similarity index 100% rename from src/p1st/unix_socket_output.py rename to src/subprocess_util/unix_socket_output.py