Added logic to migrate attributes from workspace and project settings

This commit is contained in:
Sven Heidemann 2021-08-05 14:02:00 +02:00
parent 091c89df2c
commit c12ff4f9e3
4 changed files with 18 additions and 5 deletions

View File

@ -76,7 +76,11 @@ class BuildSettings(ConfigurationModelABC):
self._included = settings[BuildSettingsNameEnum.included.value]
self._excluded = settings[BuildSettingsNameEnum.excluded.value]
self._package_data = settings[BuildSettingsNameEnum.package_data.value]
if BuildSettingsNameEnum.project_references.value in settings:
self._project_references = settings[BuildSettingsNameEnum.project_references.value]
else:
self._project_references = []
if sys.platform == 'win32':
self._source_path = str(self._source_path).replace('/', '\\')

View File

@ -127,7 +127,11 @@ class ProjectSettings(ConfigurationModelABC):
self._python_executable = path
if ProjectSettingsNameEnum.classifiers.value:
self._classifiers = settings[ProjectSettingsNameEnum.classifiers.value]
else:
self._classifiers = []
except Exception as e:
Console.set_foreground_color(ForegroundColorEnum.red)
Console.write_line(

View File

@ -31,7 +31,11 @@ class WorkspaceSettings(ConfigurationModelABC):
try:
self._default_project = settings[WorkspaceSettingsNameEnum.default_project.value]
self._projects = settings[WorkspaceSettingsNameEnum.projects.value]
if WorkspaceSettingsNameEnum.scripts.value in settings:
self._scripts = settings[WorkspaceSettingsNameEnum.scripts.value]
else:
self._scripts = {}
except Exception as e:
Console.error(f'[ ERROR ] [ {__name__} ]: Reading error in {self.__name__} settings')
Console.error(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}')

View File

@ -16,7 +16,7 @@
"LicenseName": "MIT",
"LicenseDescription": "MIT, see LICENSE for more details.",
"Dependencies": [
"sh_cpl==2021.4.dev1"
"sh_cpl==2021.4.0.post2"
],
"PythonVersion": ">=3.8",
"PythonPath": {
@ -40,6 +40,7 @@
"*/logs",
"*/tests"
],
"PackageData": {}
"PackageData": {},
"ProjectReferences": []
}
}