From 8968491c4287e85400c613d6fdaf4d419c660e6d Mon Sep 17 00:00:00 2001 From: Luke Pinner Date: Tue, 20 Mar 2018 13:55:25 +1100 Subject: [PATCH] Read The Docs help link --- datacube_query/defaults.py | 3 +++ datacube_query/qgisutils.py | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/datacube_query/defaults.py b/datacube_query/defaults.py index d453321..f962144 100644 --- a/datacube_query/defaults.py +++ b/datacube_query/defaults.py @@ -1,6 +1,9 @@ from collections import OrderedDict from datacube.helpers import ga_pq_fuser + +HELP_URL = 'http://datacube-qgis.readthedocs.io/en/latest' + # TODO Disabling rasterio enums (for now). # Having this enabled segfaults QGIS 2.99dev (3.0) when the "Select CRS" button # in _any_ processing alg. dialog (even core) is clicked. diff --git a/datacube_query/qgisutils.py b/datacube_query/qgisutils.py index 9f92441..b638c2e 100644 --- a/datacube_query/qgisutils.py +++ b/datacube_query/qgisutils.py @@ -6,6 +6,8 @@ from qgis.PyQt.QtGui import QIcon from qgis.PyQt.QtCore import QUrl +from .defaults import HELP_URL + def get_help(alg_class): """ @@ -17,10 +19,12 @@ def get_help(alg_class): """ helppath = Path(__file__).parent / 'help/html' filepath = helppath / 'algs/{}.html'.format(alg_class.lower()) + url = '{}/algs/{}.html'.format(HELP_URL, alg_class.lower()) + if filepath.exists(): return QUrl.fromLocalFile(str(filepath)).toString() - elif helppath.exists(): - return QUrl.fromLocalFile(str(helppath / 'index.html')).toString() + else: + return url def get_short_help(alg_class):