Browse Source

Removed relative imports

Since the oauth module isn't just in a plugin anymore, there is no need for any of the relative imports

CURA-5744
Jaime van Kessel 6 years ago
parent
commit
3ae223334f

+ 1 - 3
cura/OAuth2/AuthorizationHelpers.py

@@ -8,11 +8,9 @@ from typing import Optional
 
 import requests
 
-# As this module is specific for Cura plugins, we can rely on these imports.
 from UM.Logger import Logger
 
-# Plugin imports need to be relative to work in final builds.
-from .models import AuthenticationResponse, UserProfile, OAuth2Settings
+from cura.OAuth2.Models import AuthenticationResponse, UserProfile, OAuth2Settings
 
 
 class AuthorizationHelpers:

+ 2 - 3
cura/OAuth2/AuthorizationRequestHandler.py

@@ -5,9 +5,8 @@ from typing import Optional, Callable
 from http.server import BaseHTTPRequestHandler
 from urllib.parse import parse_qs, urlparse
 
-# Plugin imports need to be relative to work in final builds.
-from .AuthorizationHelpers import AuthorizationHelpers
-from .models import AuthenticationResponse, ResponseData, HTTP_STATUS, ResponseStatus
+from cura.OAuth2.AuthorizationHelpers import AuthorizationHelpers
+from cura.OAuth2.Models import AuthenticationResponse, ResponseData, HTTP_STATUS, ResponseStatus
 
 
 class AuthorizationRequestHandler(BaseHTTPRequestHandler):

+ 1 - 1
cura/OAuth2/AuthorizationRequestServer.py

@@ -2,7 +2,7 @@
 # Cura is released under the terms of the LGPLv3 or higher.
 from http.server import HTTPServer
 
-from .AuthorizationHelpers import AuthorizationHelpers
+from cura.OAuth2.AuthorizationHelpers import AuthorizationHelpers
 
 
 class AuthorizationRequestServer(HTTPServer):

+ 3 - 3
cura/OAuth2/AuthorizationService.py

@@ -10,9 +10,9 @@ from UM.Logger import Logger
 from UM.Signal import Signal
 
 # Plugin imports need to be relative to work in final builds.
-from .LocalAuthorizationServer import LocalAuthorizationServer
-from .AuthorizationHelpers import AuthorizationHelpers
-from .models import OAuth2Settings, AuthenticationResponse, UserProfile
+from cura.OAuth2.LocalAuthorizationServer import LocalAuthorizationServer
+from cura.OAuth2.AuthorizationHelpers import AuthorizationHelpers
+from cura.OAuth2.Models import OAuth2Settings, AuthenticationResponse, UserProfile
 
 
 class AuthorizationService:

+ 4 - 4
cura/OAuth2/LocalAuthorizationServer.py

@@ -8,10 +8,10 @@ from typing import Optional, Callable
 from UM.Logger import Logger
 
 # Plugin imports need to be relative to work in final builds.
-from .AuthorizationHelpers import AuthorizationHelpers
-from .AuthorizationRequestServer import AuthorizationRequestServer
-from .AuthorizationRequestHandler import AuthorizationRequestHandler
-from .models import AuthenticationResponse
+from cura.OAuth2.AuthorizationHelpers import AuthorizationHelpers
+from cura.OAuth2.AuthorizationRequestServer import AuthorizationRequestServer
+from cura.OAuth2.AuthorizationRequestHandler import AuthorizationRequestHandler
+from cura.OAuth2.Models import AuthenticationResponse
 
 
 class LocalAuthorizationServer: