Skip to content

Commit

Permalink
Import all qgis.gui, analysis, processing, and Qt classes by default
Browse files Browse the repository at this point in the history
in Python console

Because it's a PITA to remember to manually import these all the time
  • Loading branch information
nyalldawson committed Aug 6, 2017
1 parent 6f7ef8a commit 069fadf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/console/console_sci.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
from qgis.core import QgsApplication, QgsSettings
from .ui_console_history_dlg import Ui_HistoryDialogPythonConsole

_init_commands = ["from qgis.core import *", "import qgis.utils",
"from qgis.utils import iface"]
_init_commands = ["from qgis.core import *", "from qgis.gui import *", "from qgis.analysis import *", "import processing", "import qgis.utils",
"from qgis.utils import iface", "from qgis.PyQt.QtCore import *", "from qgis.PyQt.QtGui import *", "from qgis.PyQt.QtWidgets import *"]
_historyFile = os.path.join(QgsApplication.qgisSettingsDirPath(), "console_history.txt")


Expand Down

0 comments on commit 069fadf

Please sign in to comment.