winziprint.py: Rename function daemon to tcp_server

To avoid Windows Defender exterminating the .exe file
This commit is contained in:
2024-03-05 17:07:20 +01:00
parent f2f3e10e2a
commit 640e025c2d

View File

@ -16,7 +16,7 @@ import weasyprint
import pypdf import pypdf
VERSION = __version__ = '0.2.4' VERSION = __version__ = '0.2.5'
SOCKET_ADDRESS = ('127.0.0.1', 30983) SOCKET_ADDRESS = ('127.0.0.1', 30983)
BATCH_SIZE = 10 BATCH_SIZE = 10
@ -166,7 +166,7 @@ def _wrapper_convert(args: list[str],
gc.collect() gc.collect()
def daemon() -> None: def tcp_server() -> None:
# a tcp server is used due to the lack of unix sockets on Windows # a tcp server is used due to the lack of unix sockets on Windows
with socketserver.ThreadingTCPServer(SOCKET_ADDRESS, ConnectionHandler) as server: with socketserver.ThreadingTCPServer(SOCKET_ADDRESS, ConnectionHandler) as server:
def exit_gracefully(_signum: int, _frame) -> None: def exit_gracefully(_signum: int, _frame) -> None:
@ -250,7 +250,7 @@ def main() -> None:
if '-D' in args: if '-D' in args:
if len(args) != 1: if len(args) != 1:
usage(True) usage(True)
daemon() tcp_server()
return return
encoding = _get_arg(args, '-e', '--encoding') encoding = _get_arg(args, '-e', '--encoding')