Example #1
0
 def __init__(self, app: CuraApplication,
              on_error: Callable[[List[CloudError]], None]) -> None:
     super().__init__()
     self._app = app
     self._account = app.getCuraAPI().account
     self._scope = JsonDecoratorScope(UltimakerCloudScope(app))
     self._http = HttpRequestManager.getInstance()
     self._on_error = on_error
     self._upload = None  # type: Optional[ToolPathUploader]
Example #2
0
    def __init__(self, app: CuraApplication,
                 on_error: Callable[[List[CloudError]], None]) -> None:
        """Initializes a new cloud API client.

        :param app:
        :param account: The user's account object
        :param on_error: The callback to be called whenever we receive errors from the server.
        """
        super().__init__()
        self._app = app
        self._account = app.getCuraAPI().account
        self._scope = JsonDecoratorScope(UltimakerCloudScope(app))
        self._http = HttpRequestManager.getInstance()
        self._on_error = on_error
        self._upload = None  # type: Optional[ToolPathUploader]
Example #3
0
    def __init__(self,
                 application: CuraApplication,
                 on_error: Callable[[List[CloudError]], None],
                 projects_limit_per_page: Optional[int] = None) -> None:
        """Initializes a new digital factory API client.

        :param application:
        :param on_error: The callback to be called whenever we receive errors from the server.
        """
        super().__init__()
        self._application = application
        self._account = application.getCuraAPI().account
        self._scope = JsonDecoratorScope(UltimakerCloudScope(application))
        self._http = HttpRequestManager.getInstance()
        self._on_error = on_error
        self._file_uploader = None  # type: Optional[DFFileUploader]

        self._projects_pagination_mgr = PaginationManager(
            limit=projects_limit_per_page
        ) if projects_limit_per_page else None  # type: Optional[PaginationManager]
Example #4
0
 def __init__(self, application: CuraApplication):
     super().__init__(application)
     api = application.getCuraAPI()
     self._account = api.account  # type: Account