Skip to content
Permalink
Browse files

[pyqgis-console] warn user to generate personal access token

  • Loading branch information
slarosa authored and nyalldawson committed Sep 26, 2020
1 parent 4347e81 commit 1760e26a3a1e4b929eb4f1629cf2a28f8c346fd5
Showing with 7 additions and 2 deletions.
  1. +7 −2 python/console/console_editor.py
@@ -302,8 +302,7 @@ def contextMenuEvent(self, e):
runSelected.setEnabled(True) # spellok
copyAction.setEnabled(True)
cutAction.setEnabled(True)
if self.settings.value("pythonConsole/accessTokenGithub", ''):
gist_menu.setEnabled(True)
gist_menu.setEnabled(True)
pyQGISHelpAction.setEnabled(True)
if not self.text() == '':
selectAllAction.setEnabled(True)
@@ -368,6 +367,12 @@ def objectListEditor(self):

def shareOnGist(self, is_public):
ACCESS_TOKEN = self.settings.value("pythonConsole/accessTokenGithub", '', type=QByteArray)
if not ACCESS_TOKEN:
msg_text = QCoreApplication.translate(
'PythonConsole', 'GitHub personal access token must be generated (see Console Options)')
self.parent.pc.callWidgetMessageBarEditor(msg_text, 0, True)
return

URL = "https://api.github.com/gists"

path = self.parent.tw.currentWidget().path

0 comments on commit 1760e26

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