Merge pull request #216 from tiqi-group/config/changing_loading_behaviour

feat (config): changes web_port loading
This commit is contained in:
Mose Müller 2025-04-15 08:16:12 +02:00 committed by GitHub
commit b0dd5835a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -87,8 +87,10 @@ class Server:
service: The DataService instance that this server will manage.
host: The host address for the server. Defaults to `'0.0.0.0'`, which means all
available network interfaces.
web_port: The port number for the web server. Defaults to
[`ServiceConfig().web_port`][pydase.config.ServiceConfig.web_port].
web_port: The port number for the web server. If set to None, it will use the
port defined in
[`ServiceConfig().web_port`][pydase.config.ServiceConfig.web_port]. Defaults
to None.
enable_web: Whether to enable the web server.
filename: Filename of the file managing the service state persistence.
additional_servers: A list of additional servers to run alongside the main
@ -140,7 +142,7 @@ class Server:
self,
service: DataService,
host: str = "0.0.0.0",
web_port: int = ServiceConfig().web_port,
web_port: int | None = None,
enable_web: bool = True,
filename: str | Path | None = None,
additional_servers: list[AdditionalServer] | None = None,
@ -151,6 +153,9 @@ class Server:
additional_servers = []
self._service = service
self._host = host
if web_port is None:
self._web_port = ServiceConfig().web_port
else:
self._web_port = web_port
self._enable_web = enable_web
self._kwargs = kwargs