mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Don't import CuraApplication if not type checking
Otherwise we'll get unnecessary import loops here. Contributes to issue CURA-8609.
This commit is contained in:
parent
599c59bd3a
commit
042bd46fba
1 changed files with 8 additions and 2 deletions
|
|
@ -1,8 +1,14 @@
|
||||||
|
# Copyright (c) 2021 Ultimaker B.V.
|
||||||
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
from PyQt5.QtNetwork import QNetworkRequest
|
from PyQt5.QtNetwork import QNetworkRequest
|
||||||
|
|
||||||
from UM.Logger import Logger
|
from UM.Logger import Logger
|
||||||
from UM.TaskManagement.HttpRequestScope import DefaultUserAgentScope
|
from UM.TaskManagement.HttpRequestScope import DefaultUserAgentScope
|
||||||
from cura.API import Account
|
from cura.API import Account
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
if TYPE_CHECKING:
|
||||||
from cura.CuraApplication import CuraApplication
|
from cura.CuraApplication import CuraApplication
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -12,7 +18,7 @@ class UltimakerCloudScope(DefaultUserAgentScope):
|
||||||
Also add the user agent headers (see DefaultUserAgentScope).
|
Also add the user agent headers (see DefaultUserAgentScope).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, application: CuraApplication):
|
def __init__(self, application: "CuraApplication"):
|
||||||
super().__init__(application)
|
super().__init__(application)
|
||||||
api = application.getCuraAPI()
|
api = application.getCuraAPI()
|
||||||
self._account = api.account # type: Account
|
self._account = api.account # type: Account
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue