Skip to content

Commit 482c2b3

Browse files
authored
Merge pull request #73 from WhereGroup/qdt/fix-json-schema-url
improve(chore): modularize QDT related model
2 parents 93d4a60 + a8797d0 commit 482c2b3

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

profile_manager/profile_manager_dialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
from profile_manager.gui.mdl_profiles import ProfileListModel
1414
from profile_manager.gui.name_profile_dialog import NameProfileDialog
1515
from profile_manager.gui.utils import data_sources_as_tree, plugins_as_items
16+
from profile_manager.qdt_export.models import QDTProfileInfos
1617
from profile_manager.qdt_export.profile_export import (
17-
QDTProfileInfos,
1818
export_profile_for_qdt,
1919
get_qdt_profile_infos_from_file,
2020
)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from dataclasses import dataclass
2+
3+
4+
@dataclass
5+
class QDTProfileInfos:
6+
"""Store informations for QDT profile creation"""
7+
8+
description: str = ""
9+
email: str = ""
10+
version: str = ""
11+
qgis_min_version: str = ""
12+
qgis_max_version: str = ""

profile_manager/qdt_export/profile_export.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import dataclasses
22
import json
3-
from dataclasses import dataclass
43
from pathlib import Path
54
from shutil import copytree, rmtree
65
from typing import Any, Dict
@@ -11,21 +10,11 @@
1110
get_profile_plugin_list_information,
1211
qgis_profiles_path,
1312
)
13+
from profile_manager.qdt_export.models import QDTProfileInfos
1414

1515
QDT_PROFILE_SCHEMA = "https://raw.githubusercontent.com/qgis-deployment/qgis-deployment-toolbelt-cli/main/docs/schemas/profile/qgis_profile.json"
1616

1717

18-
@dataclass
19-
class QDTProfileInfos:
20-
"""Store informations for QDT profile creation"""
21-
22-
description: str = ""
23-
email: str = ""
24-
version: str = ""
25-
qgis_min_version: str = ""
26-
qgis_max_version: str = ""
27-
28-
2918
def get_qdt_profile_infos_from_file(profile_file: Path) -> QDTProfileInfos:
3019
"""Get QDT Profile informations from a profile.json file
3120
File must exists

0 commit comments

Comments
 (0)