Don't use a newline at the beginning of the sync message

Again, this breaks stuff. See the previous commit.

Contributes to issue CURA-7201.
This commit is contained in:
Ghostkeeper 2020-02-24 14:33:10 +01:00
parent 633bdac21a
commit f918f39fc2
No known key found for this signature in database
GPG key ID: 37E2020986774393
2 changed files with 9 additions and 5 deletions

View file

@ -1,3 +1,6 @@
# Copyright (c) 2020 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import json import json
from typing import Optional from typing import Optional

View file

@ -1,3 +1,6 @@
# Copyright (c) 2020 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import tempfile import tempfile
from typing import Dict, List, Any from typing import Dict, List, Any
@ -81,11 +84,9 @@ class DownloadPresenter:
return DownloadPresenter(self._app) return DownloadPresenter(self._app)
def _createProgressMessage(self) -> Message: def _createProgressMessage(self) -> Message:
return Message(i18n_catalog.i18nc( return Message(i18n_catalog.i18nc("@info:generic", "Syncing..."),
"@info:generic",
"\nSyncing..."),
lifetime = 0, lifetime = 0,
use_inactivity_timer=False, use_inactivity_timer = False,
progress = 0.0, progress = 0.0,
title = i18n_catalog.i18nc("@info:title", "Changes detected from your Ultimaker account", )) title = i18n_catalog.i18nc("@info:title", "Changes detected from your Ultimaker account", ))
@ -93,7 +94,7 @@ class DownloadPresenter:
self._progress[package_id]["received"] = self._progress[package_id]["total"] self._progress[package_id]["received"] = self._progress[package_id]["total"]
try: try:
with tempfile.NamedTemporaryFile(mode ="wb+", suffix =".curapackage", delete = False) as temp_file: with tempfile.NamedTemporaryFile(mode = "wb+", suffix = ".curapackage", delete = False) as temp_file:
bytes_read = reply.read(self.DISK_WRITE_BUFFER_SIZE) bytes_read = reply.read(self.DISK_WRITE_BUFFER_SIZE)
while bytes_read: while bytes_read:
temp_file.write(bytes_read) temp_file.write(bytes_read)