Fix adding by manual IP, code improvements

This commit is contained in:
ChrisTerBeke 2019-08-07 00:38:07 +02:00
parent ac177659e5
commit 8a2e394abc
No known key found for this signature in database
GPG key ID: A49F1AB9D7E0C263
4 changed files with 73 additions and 36 deletions

View file

@ -25,6 +25,9 @@ class ClusterApiClient:
PRINTER_API_PREFIX = "/api/v1"
CLUSTER_API_PREFIX = "/cluster-api/v1"
# In order to avoid garbage collection we keep the callbacks in this list.
_anti_gc_callbacks = [] # type: List[Callable[[], None]]
## Initializes a new cluster API client.
# \param address: The network address of the cluster to call.
# \param on_error: The callback to be called whenever we receive errors from the server.
@ -33,8 +36,6 @@ class ClusterApiClient:
self._manager = QNetworkAccessManager()
self._address = address
self._on_error = on_error
# In order to avoid garbage collection we keep the callbacks in this list.
self._anti_gc_callbacks = [] # type: List[Callable[[], None]]
## Get printer system information.
# \param on_finished: The callback in case the response is successful.