Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Commit

Permalink
Read The Docs help link
Browse files Browse the repository at this point in the history
  • Loading branch information
lpinner committed Mar 20, 2018
1 parent 415a1d6 commit 8968491
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions datacube_query/defaults.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
8 changes: 6 additions & 2 deletions datacube_query/qgisutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand All @@ -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):
Expand Down

0 comments on commit 8968491

Please sign in to comment.