2021-06-03 13:35:05 +03:00
|
|
|
"""
|
|
|
|
***************************************************************************
|
2024-02-06 13:50:29 +10:00
|
|
|
grass_plugin.py
|
2021-06-03 13:35:05 +03:00
|
|
|
---------------------
|
|
|
|
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'
|
|
|
|
|
|
|
|
|
2021-06-20 11:16:00 +03:00
|
|
|
from qgis.core import QgsApplication, QgsRuntimeProfiler
|
2021-06-03 13:35:05 +03:00
|
|
|
|
2021-06-20 11:16:00 +03:00
|
|
|
with QgsRuntimeProfiler.profile('Import GRASS Provider'):
|
2024-02-06 13:50:29 +10:00
|
|
|
from grassprovider.grass_provider import GrassProvider
|
2021-06-03 13:35:05 +03:00
|
|
|
|
|
|
|
|
|
|
|
class GrassProviderPlugin:
|
|
|
|
|
|
|
|
def __init__(self):
|
2024-02-06 13:50:29 +10:00
|
|
|
self.provider = GrassProvider()
|
2021-06-03 13:35:05 +03:00
|
|
|
|
2021-06-20 11:16:00 +03:00
|
|
|
def initProcessing(self):
|
2021-06-03 13:35:05 +03:00
|
|
|
QgsApplication.processingRegistry().addProvider(self.provider)
|
|
|
|
|
2021-06-20 11:16:00 +03:00
|
|
|
def initGui(self):
|
|
|
|
self.initProcessing()
|
|
|
|
|
2021-06-03 13:35:05 +03:00
|
|
|
def unload(self):
|
|
|
|
QgsApplication.processingRegistry().removeProvider(self.provider)
|