Beispiel #1
0
def is_plugin_version_valid(plugin_name, min_required_version, exact_required_version):
    plugin_found = plugin_name in qgis.utils.plugins
    if not plugin_found:
        return False
    current_version = get_plugin_metadata(plugin_name, 'version')
    current_version = current_version[1:] if current_version.startswith("v") else current_version
    return is_version_valid(current_version, min_required_version, exact_required_version, plugin_name)
Beispiel #2
0
def is_plugin_version_valid(plugin_name, min_required_version,
                            exact_required_version):
    plugin_found = plugin_name in qgis.utils.plugins

    if not plugin_found:
        if plugin_name in qgis.utils.available_plugins:
            # It just needs to be activated
            if not qgis.utils.startPlugin(plugin_name):
                return False  # We couldn't started, no details, so return False to be safe
        else:
            return False

    current_version = get_plugin_metadata(plugin_name, 'version')
    current_version = current_version[1:] if current_version.startswith(
        "v") else current_version
    return is_version_valid(current_version, min_required_version,
                            exact_required_version, plugin_name)
DEFAULT_LOG_MODE = EnumLogMode.DEV
DEFAULT_LOG_FILE = ''

# Constants for reports
NATIONAL_LAND_AGENCY = "ANT"
ANNEX_17_REPORT = "Anexo_17"
ANT_MAP_REPORT = "Plano_ANT"

PREFIX_ERROR_CODE = 'E'

# CTM 12
DEFAULT_SRS_AUTH = "EPSG"
DEFAULT_SRS_CODE = "9377"
DEFAULT_SRS_AUTHID = "EPSG:9377"

PLUGIN_VERSION = get_plugin_metadata('asistente_ladm_col', 'version')
PLUGIN_NAME = get_plugin_metadata('asistente_ladm_col', 'name')
PLUGINS_DIR = os.path.dirname(PLUGIN_DIR)

DEFAULT_USE_ROADS_VALUE = False
DEFAULT_AUTOMATIC_VALUES_IN_BATCH_MODE = True
HELP_URL = "https://swisstierrascolombia.github.io/Asistente-LADM-COL"
ETL_MODEL_NAME = "model:ETL-model"
ETL_MODEL_WITH_REPROJECTION_NAME = "model:ETL-model-with-reprojection"
FIELD_MAPPING_PATH = os.path.join(DEPENDENCIES_BASE_PATH, 'field_mappings')
FIELD_MAPPING_PARAMETER = 'mapping' if Qgis.QGIS_VERSION_INT < 31400 else 'fieldsmapper'
MAXIMUM_FIELD_MAPPING_FILES_PER_TABLE = 10
HELP_DIR_NAME = 'help'
DEFAULT_USE_CUSTOM_MODELS = True
DEFAULT_MODELS_DIR = os.path.join(PLUGIN_DIR, 'resources', 'models')
STYLES_DIR = os.path.join(PLUGIN_DIR, 'resources', 'styles')