Skip to content
Permalink
Browse files
separate otb provider into a plugin
  • Loading branch information
alexbruy committed Jun 21, 2021
1 parent 50fad18 commit cfc093d0e93349c6ba60ac66d61c8c58fc1a274a
@@ -55,6 +55,7 @@ endif()
add_subdirectory(processing)
add_subdirectory(sagaprovider)
add_subdirectory(grassprovider)
add_subdirectory(otbprovider)
add_subdirectory(MetaSearch)

PY_COMPILE(staged-plugins "${PYTHON_OUTPUT_DIRECTORY}/plugins")
@@ -0,0 +1,4 @@
file(GLOB PY_FILES *.py)
file(GLOB OTHER_FILES metadata.txt)

PLUGIN_INSTALL(otbprovider . ${PY_FILES} ${OTHER_FILES})
@@ -51,8 +51,8 @@
QgsProviderRegistry)

from processing.core.parameters import getParameterFromString
from processing.algs.otb.OtbChoiceWidget import OtbParameterChoice
from processing.algs.otb.OtbUtils import OtbUtils
from .OtbChoiceWidget import OtbParameterChoice
from .OtbUtils import OtbUtils


class OtbAlgorithm(QgsProcessingAlgorithm):
@@ -35,8 +35,8 @@
from qgis import utils

from processing.core.ProcessingConfig import ProcessingConfig, Setting
from processing.algs.otb.OtbUtils import OtbUtils
from processing.algs.otb.OtbAlgorithm import OtbAlgorithm
from .OtbUtils import OtbUtils
from .OtbAlgorithm import OtbAlgorithm


class OtbAlgorithmProvider(QgsProcessingProvider):
@@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-

"""
***************************************************************************
OtbProviderPlugin.py
---------------------
Date : June 2021
Copyright : (C) 2021 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************
"""

__author__ = 'Alexander Bruy'
__date__ = 'June 2021'
__copyright__ = '(C) 2021, Alexander Bruy'


from qgis.core import QgsApplication

from otbprovider.OtbAlgorithmProvider import OtbAlgorithmProvider


class OtbProviderPlugin:

def __init__(self):
self.provider = OtbAlgorithmProvider()

def initGui(self):
QgsApplication.processingRegistry().addProvider(self.provider)

def unload(self):
QgsApplication.processingRegistry().removeProvider(self.provider)
File renamed without changes.
@@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-

"""
***************************************************************************
__init__.py
---------------------
Date : June 2021
Copyright : (C) 2021 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************
"""

__author__ = 'Alexander Bruy'
__date__ = 'June 2021'
__copyright__ = '(C) 2021, Alexander Bruy'


def classFactory(iface):
from otbprovider.OtbProviderPlugin import OtbProviderPlugin
return OtbProviderPlugin()
@@ -0,0 +1,17 @@
[general]
name=OrfeoToolbox provider
description=OrfeoToolbox Processing provider
about=OrfeoToolbox Processing provider
category=Analysis
version=2.12.99
qgisMinimumVersion=3.0

author=Victor Olaya

icon=:/images/themes/default/providerOtb.svg

homepage=https://qgis.org
tracker=https://github.com/qgis/QGIS/issues
repository=https://github.com/qgis/QGIS

hasProcessingProvider=yes
@@ -2,7 +2,6 @@ file(GLOB PY_FILES *.py)

add_subdirectory(help)
add_subdirectory(gdal)
add_subdirectory(otb)
add_subdirectory(qgis)

PLUGIN_INSTALL(processing algs ${PY_FILES})

This file was deleted.

Empty file.
@@ -59,9 +59,6 @@
with QgsRuntimeProfiler.profile('Import GDAL Provider'):
from processing.algs.gdal.GdalAlgorithmProvider import GdalAlgorithmProvider # NOQA

with QgsRuntimeProfiler.profile('Import OTB Provider'):
from processing.algs.otb.OtbAlgorithmProvider import OtbAlgorithmProvider # NOQA

with QgsRuntimeProfiler.profile('Import Script Provider'):
from processing.script.ScriptAlgorithmProvider import ScriptAlgorithmProvider # NOQA

@@ -112,7 +109,6 @@ def initialize():
for c in [
QgisAlgorithmProvider,
GdalAlgorithmProvider,
OtbAlgorithmProvider,
ScriptAlgorithmProvider,
ModelerAlgorithmProvider,
ProjectProvider

0 comments on commit cfc093d

Please sign in to comment.