-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path__init__.py
64 lines (52 loc) · 2.17 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
"""
/***************************************************************************
SentinelHub
-------------------
begin : 2017-07-07
copyright : (C) 2020 by Sinergise
email : [email protected]
***************************************************************************/
/***************************************************************************
* *
* 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.
"""
WHEELS = [ # TODO: separate wheels requirements and import them from requirements file
"oauthlib",
"requests-oauthlib",
"click",
"aenum",
"tqdm",
"dataclasses-json",
"marshmallow",
"marshmallow-enum",
"packaging",
"typing-inspect",
"mypy-extensions",
"typing-extensions",
]
def classFactory(iface):
"""Load SentinelHub class from file SentinelHub.
:param iface: A QGIS interface instance.
:type iface: QgsInterface
"""
# pylint: disable=invalid-name
# pylint: disable=import-outside-toplevel
# pylint: disable=unused-import
from .utils.meta import configure_external_import_path, ensure_wheel_import
configure_external_import_path()
for package_name in WHEELS:
ensure_wheel_import(package_name)
# TODO: this import is just for testing purpose:
import sentinelhub
from .exceptions import MessageType, show_message
show_message(f"Imported sentinelhub-py {sentinelhub.__version__} !!", MessageType.INFO)
# The following initializes UI
from . import resources
from .main import SentinelHubPlugin
return SentinelHubPlugin(iface)