mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-09 23:05:01 -06:00
Merge branch '4.10'
This commit is contained in:
commit
e7a423ea6f
16 changed files with 64 additions and 30 deletions
|
@ -7,7 +7,7 @@ import re
|
|||
import shutil
|
||||
from copy import deepcopy
|
||||
from zipfile import ZipFile, ZIP_DEFLATED, BadZipfile
|
||||
from typing import Dict, Optional, TYPE_CHECKING
|
||||
from typing import Dict, Optional, TYPE_CHECKING, List
|
||||
|
||||
from UM import i18nCatalog
|
||||
from UM.Logger import Logger
|
||||
|
@ -29,7 +29,7 @@ class Backup:
|
|||
IGNORED_FILES = [r"cura\.log", r"plugins\.json", r"cache", r"__pycache__", r"\.qmlc", r"\.pyc"]
|
||||
"""These files should be ignored when making a backup."""
|
||||
|
||||
IGNORED_FOLDERS = [r"plugins"]
|
||||
IGNORED_FOLDERS = [] # type: List[str]
|
||||
|
||||
SECRETS_SETTINGS = ["general/ultimaker_auth_data"]
|
||||
"""Secret preferences that need to obfuscated when making a backup of Cura"""
|
||||
|
|
|
@ -54,17 +54,6 @@ class BackupsManager:
|
|||
backup = Backup(self._application, zip_file = zip_file, meta_data = meta_data)
|
||||
restored = backup.restore()
|
||||
|
||||
package_manager = self._application.getPackageManager()
|
||||
|
||||
# If the backup was made with Cura 4.10 (or higher), we no longer store plugins.
|
||||
# Since the restored backup doesn't have those plugins anymore, we should remove it from the list
|
||||
# of installed plugins.
|
||||
if Version(meta_data.get("cura_release")) >= Version("4.10.0"):
|
||||
for package_id in package_manager.getAllInstalledPackageIDs():
|
||||
package_data = package_manager.getInstalledPackageInfo(package_id)
|
||||
if package_data.get("package_type") == "plugin" and not package_data.get("is_bundled"):
|
||||
package_manager.removePackage(package_id)
|
||||
|
||||
if restored:
|
||||
# At this point, Cura will need to restart for the changes to take effect.
|
||||
# We don't want to store the data at this point as that would override the just-restored backup.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue