Make request to Marketplace API when package list loads

We don't parse the response just yet, but this is part of the work.

Contributes to issue CURA-8556.
This commit is contained in:
Ghostkeeper 2021-10-21 15:33:37 +02:00
parent 5851ad52c6
commit 4337e81b77
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A
2 changed files with 37 additions and 5 deletions

View file

@ -15,14 +15,14 @@ from UM.PluginRegistry import PluginRegistry # To find out where we are stored
if TYPE_CHECKING:
from PyQt5.QtCore import QObject
ROOT_URL = f"{UltimakerCloudConstants.CuraCloudAPIRoot}/cura-packages/v{UltimakerCloudConstants.CuraCloudAPIVersion}/cura/v{CuraSDKVersion}" # Root of all Marketplace API requests.
PACKAGES_URL = f"{ROOT_URL}/packages" # URL to use for requesting the list of packages.
class Marketplace(Extension):
"""
The main managing object for the Marketplace plug-in.
"""
ROOT_URL = f"{UltimakerCloudConstants.CuraCloudAPIRoot}/cura-packages/v{UltimakerCloudConstants.CuraCloudAPIVersion}/cura/v{CuraSDKVersion}" # Root of all Marketplace API requests.
PACKAGES_URL = f"{ROOT_URL}/packages" # URL to use for requesting the list of packages.
def __init__(self):
super().__init__()
self._window: Optional["QObject"] = None # If the window has been loaded yet, it'll be cached in here.