Repository navigation
Expand file tree
/
Copy path__init__.py
More file actions
45 lines (40 loc) · 2.09 KB
/
Copy path__init__.py
File metadata and controls
45 lines (40 loc) · 2.09 KB
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
# -*- coding: utf-8 -*-
"""
/***************************************************************************
GeoSubSampler
A QGIS plugin
Subsamples geological orientations, faults and polygons
Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/
-------------------
begin : 2025-07-28
copyright : (C) 2025 by Ranee Joshi
email : raneejoshi@gmail.com
git sha : $Format:%H$
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
This script initializes the plugin, making it known to QGIS.
"""
# noinspection PyPep8Naming
def classFactory(iface): # pylint: disable=invalid-name
"""Load GeoSubSampler class from file GeoSubSampler.
:param iface: A QGIS interface instance.
:type iface: QgsInterface
"""
# without the packages in requirements.txt the plugin's modules would fail to
# import: load a stand-in that warns and says how to install them instead
from .missing_packages import MissingPackagesPlugin, missing_packages
missing = missing_packages()
if missing:
return MissingPackagesPlugin(iface, missing)
try:
from .GeoSubSampler import GeoSubSampler
except ImportError as e: # installed, but cannot be loaded (e.g. a broken package)
return MissingPackagesPlugin(iface, [getattr(e, "name", None) or "?"], error=str(e))
return GeoSubSampler(iface)