server
Simple web server with Import, Generation, and Database View tabs.
This version stores package imports in SQLite and creates one SQLite data table
for each imported *.txt selection file. JSON files are intentionally ignored
for now, per current requirements.
Functions
|
Find the first available TCP port in |
|
Resolve runtime port using manual config or auto-discovery. |
|
Create handler class bound to runtime verbosity and DB path. |
|
Create a configured |
|
Run the server until interrupted. |
Create CLI argument parser for this server. |
|
|
Parse CLI arguments. |
|
Build effective settings from INI config and CLI overrides. |
|
CLI entrypoint for running this server. |
Module Contents
- server.find_available_port(host='127.0.0.1', start=8000, end=8999)
Find the first available TCP port in
start..end.- Raises:
OSError – When no free port is available in the given range.
- server.resolve_server_port(host, configured_port)
Resolve runtime port using manual config or auto-discovery.
- server.create_handler_class(verbose, db_path, *, favorites_db_path, serve_ui, db_export_path=None, db_backup_path=None)
Create handler class bound to runtime verbosity and DB path.
The runtime bootstrap initializes schema before creating the handler class, so
schema_readyis set toTrueto skip per-request schema checks on the hot path. Route maps are selected based onserve_uiso API-only deployments skip UI/static endpoints entirely.
- server.start_http_server(settings)
Create a configured
HTTPServerinstance.
- server.run_server(settings)
Run the server until interrupted.
- Parameters:
settings (pipeworks_name_generation.webapp.config.ServerSettings) – Effective runtime settings from config and CLI overrides.
- Returns:
Process-style exit code (
0on normal shutdown).- Return type:
- server.create_argument_parser()
Create CLI argument parser for this server.
- server.parse_arguments(argv=None)
Parse CLI arguments.
- server.build_settings_from_args(args)
Build effective settings from INI config and CLI overrides.
- server.main(argv=None)
CLI entrypoint for running this server.