Skip to content
Permalink
Browse files

Fixes #19001: update url to _pyqgis and _api commands

  • Loading branch information
slarosa committed May 27, 2018
1 parent 4bb7f82 commit fc740d7140cfb0da954f132240eee733425852cb
Showing with 7 additions and 4 deletions.
  1. +7 −4 python/console/console_sci.py
@@ -31,7 +31,7 @@
import re
import traceback

from qgis.core import QgsApplication, QgsSettings
from qgis.core import QgsApplication, QgsSettings, Qgis
from .ui_console_history_dlg import Ui_HistoryDialogPythonConsole

_init_commands = ["from qgis.core import *", "from qgis.gui import *", "from qgis.analysis import *", "import processing", "import qgis.utils",
@@ -619,11 +619,14 @@ def runCommand(self, cmd):
self.writeCMD(cmd)
import webbrowser
self.updateHistory(cmd)
if cmd in ('_pyqgis', '_api'):
version = 'master' if 'master' in Qgis.QGIS_VERSION.lower() else re.findall('^\d.[0-9]*', Qgis.QGIS_VERSION)[0]
if cmd in ('_pyqgis', '_api', '_cookbook'):
if cmd == '_pyqgis':
webbrowser.open("http://qgis.org/pyqgis-cookbook/")
webbrowser.open("https://qgis.org/pyqgis/{}".format(version))
elif cmd == '_api':
webbrowser.open("http://qgis.org/api/")
webbrowser.open("https://qgis.org/api/{}".format(version))
elif cmd == '_cookbook':
webbrowser.open("http://qgis.org/pyqgis-cookbook/")
more = False
else:
self.buffer.append(cmd)

0 comments on commit fc740d7

Please sign in to comment.
You can’t perform that action at this time.