forked from nens/threedi-results-analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
46 lines (30 loc) · 1.12 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""Plugin initialization module
Qgis automatically calls an installed plugin's :py:func:`classFactory` to
actually load the plugin.
Note: beforehand we call our dependency mechanism (see
:doc:`linked_external-dependencies_readme`) to ensure all dependencies are
there.
"""
from pathlib import Path
from ThreeDiToolbox import dependencies
import faulthandler
import sys
#: Handy constant for building relative paths.
PLUGIN_DIR = Path(__file__).parent
# sys.stderr is not available under Windows in Qgis, which is what the faulthandler
# uses by default.
if sys.stderr is not None and hasattr(sys.stderr, 'fileno'):
faulthandler.enable()
dependencies.ensure_everything_installed()
def classFactory(iface):
"""Return ThreeDiToolbox class from file ThreeDiToolbox.
In addition, we set up python logging (see
:py:mod:`ThreeDiToolbox.utils.qlogging`).
args:
iface (QgsInterface): A QGIS interface instance.
"""
from ThreeDiToolbox.utils.qlogging import setup_logging
setup_logging()
dependencies.check_importability()
from .threedi_plugin import ThreeDiPlugin
return ThreeDiPlugin(iface)