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

@ -35,6 +35,9 @@ class CloudApiClient:
CLUSTER_API_ROOT = "{}/connect/v1".format(ROOT_PATH)
CURA_API_ROOT = "{}/cura/v1".format(ROOT_PATH)
# In order to avoid garbage collection we keep the callbacks in this list.
_anti_gc_callbacks = [] # type: List[Callable[[], None]]
## Initializes a new cloud API client.
# \param account: The user's account object
# \param on_error: The callback to be called whenever we receive errors from the server.
@ -44,8 +47,6 @@ class CloudApiClient:
self._account = account
self._on_error = on_error
self._upload = None # type: Optional[ToolPathUploader]
# In order to avoid garbage collection we keep the callbacks in this list.
self._anti_gc_callbacks = [] # type: List[Callable[[], None]]
## Gets the account used for the API.
@property