90 Commits

Author SHA1 Message Date
Nyall Dawson
d0c24edf7d Import more useful libraries into console by default 2019-02-01 21:44:53 +11:00
Nyall Dawson
cce5c4e802 [console] Correctly save settings when exiting app
The closeEvent approach which was previously used is not reliable
on application exit, so manually force a settings save in this case too.

Avoids loss of command history when closing QGIS

Also remove the manual "Save" history action, as it's redundant
2018-12-06 05:42:47 +10:00
Salvatore Larosa
059d0e21c4 [pyqgis-console] fix link to c++ api doc 2018-07-08 12:44:57 +02:00
Nyall Dawson
398e2a17dd [console] Fix invalid regex warning 2018-06-22 13:37:58 +10:00
Salvatore Larosa
3edc07b4c2 also versioning cookbook url 2018-05-29 11:59:54 +02:00
Salvatore Larosa
8f5bde40cf use https for cookbook url 2018-05-29 11:52:43 +02:00
Salvatore Larosa
fc740d7140 Fixes #19001: update url to _pyqgis and _api commands 2018-05-28 08:42:45 +02:00
nirvn
45aca2f942 fix unclosed strings not style in python console & script editor 2018-05-23 10:08:02 +07:00
nirvn
9cf6bbf424 Improve default color scheme for python console & script editor 2018-05-22 17:56:25 +07:00
nirvn
45b045d212 Fix missing color settings for python console / script editor 2018-05-22 13:31:29 +07:00
Nyall Dawson
6d87a4cf3f [console] Fix unclosed strings don't respect the preset font size 2018-05-22 15:43:14 +10:00
Salvatore Larosa
3a5fb9d7bd Fixes #18526: Pasting data from clipboard inside Python console causes the text cursor to be moved to the end of the row 2018-03-23 22:41:00 +01:00
Alexander Bruy
7823025b8d [python console] remove 'u' prefixes from strings (fix #18171) 2018-02-23 10:39:08 +02:00
Juergen E. Fischer
325af48680 fix #18050 (followup f6269c41d) 2018-02-05 14:04:07 +01:00
Nyall Dawson
f6269c41da [console] Allow breaking execution of scripts via Ctrl-C
This allows (in some circumstances) scripts running in the console
to be halted via the Ctrl (or Meta) + C shortcut.

(It's only possible to catch and abort when the script is printing
outputs to the console - because this triggers
QCoreApplication.processEvents() calls. Without these calls the
whole QGIS application is unresponsive during script execution
and there's no ability to even catch a shortcut in order to
halt the execution.

Still, even with this limitation it's handy to be able to
break out of lengthy:

for f in iface.activeLayer().getFeatures():
    print(f.attributes())

loops!)
2018-01-30 09:58:31 +10:00
Nyall Dawson
069fadfc53 Import all qgis.gui, analysis, processing, and Qt classes by default
in Python console

Because it's a PITA to remember to manually import these all the time
2017-08-06 23:48:53 +10:00
Harrissou Sant-anna
15be88918f Replace "double click" and "doubleclick" by double-click 2017-07-07 01:26:38 +02:00
Matthias Kuhn
0e09fdacde Use monospace fonts for console on all platforms 2017-04-12 22:21:59 +02:00
Juergen E. Fischer
ecc5bb508e pep8/pyflakes3 cleanups 2017-03-04 02:38:15 +01:00
Juergen E. Fischer
a10c890383 More QgsSettings updates:
* revives WMS
* QgsSettings::clear() added
* section added to QgsSettings::contains()
* type parameter added to sip binding of QgsSettings.value()
* TODO: customization & evis
2017-03-04 02:37:59 +01:00
Denis Rouzaud
4c3968b9aa more spelling fixes 2017-01-20 15:06:09 +01:00
Denis Rouzaud
37ebcdd1cd [spellcheck] allow inwords checks and line skipping
spell check will be done automatically in words by default (when some conditions are fulfilled)
possibility to avoid in words checking by adding :* at the end in spelling.dat

one can add #spellok at the end of a line of code to skip spell check on this line
2017-01-10 20:18:37 +01:00
Juergen E. Fischer
31df84aa6b run 2to3 on source 2016-09-21 23:30:04 +02:00
Denis Rouzaud
8071acd064 move PyQt compat folder to python/qgis 2016-04-29 14:10:26 +02:00
Salvatore Larosa
0168bd5c68 [pyqgis-console] fix multi-line code execution 2016-03-31 22:53:10 +02:00
Salvatore Larosa
20ce2343cb [pyqgis-console] fix import statement 2016-03-31 22:53:10 +02:00
Matthias Kuhn
e133b42896 Enable console with Python3 / PyQt5 2016-03-29 08:20:43 +02:00
Juergen E. Fischer
885d0ec993 python console: switch to pyqt wrappers and new style signals, flake8 fixes, show exceptions in console also with pyqt5 2016-03-21 17:00:25 +01:00
Juergen E. Fischer
c6d921729e python fixes:
* issues identified by pyflakes (star and unused imports)
* pyqtwrapper: add QtSvg
* some exceptions e.message => unicode(e)
* some translations tr("..." % foo) => tr("...") % foo
* TODO:
  python/console/console_sci.py:547 QsciScintillaCompat?
  python/plugins/db_manager/dlg_query_builder.py:304 pop_up_error?
2016-03-15 17:25:23 +01:00
Juergen E. Fischer
fb3fcfa3a0 Python3/Qt5/2to3 updates:
* pyqtwrappers update (add QtNetwork, QtXml, QtSql, QtTest, uic)
* 2to3 updates
* move QPyNullVariant/NULL to PyQt.QtCore
* add global unicode/basestring/long for Python3
* expand QtGui, QtCore module and star exports
* Qscintilla2
* replace Set import with set builtin
2016-03-14 20:38:20 +01:00
Nyall Dawson
cbe8cb7282 Formatting update, using newer autopep8 version 2016-01-30 09:33:24 +11:00
Juergen E. Fischer
00633811c9 spelling fixes 2016-01-21 10:42:25 +01:00
Juergen E. Fischer
b39055b39c indentation update (now including autopep8) 2015-08-22 14:29:41 +02:00
Juergen E. Fischer
956c155e8f fix python pep8 warnings and fix some revealed errors
pep8 --ignore=E111,E128,E201,E202,E203,E211,E221,E222,E225,E226,E227,E231,E241,E261,E265,E272,E302,E303,E501,E701 \
     --exclude="ui_*.py,debian/*,python/ext-libs/*" \
     .
2015-02-01 20:46:47 +01:00
Juergen E. Fischer
5397dfe538 update qgis.org links 2014-02-07 21:02:11 +01:00
Salvatore Larosa
a411e79fa7 [pyqgis-console] add save button to history dialog, minor fixes for c38b8cb 2013-11-02 18:40:26 +01:00
Salvatore Larosa
5f916b4009 [pyqgis-console] fixes some translation string 2013-11-02 18:40:26 +01:00
Salvatore Larosa
c4b5812cf9 [pyqgis-console] allows to remove entries from command history dialog 2013-11-02 18:40:26 +01:00
Salvatore Larosa
9de5745520 [pyqgis-console] Sets minimum height for input area based of font metric 2013-10-03 11:09:18 +02:00
Salvatore Larosa
049edb2b10 [pyqgis-console] added more settings for fonts color 2013-09-19 13:17:13 +02:00
Salvatore Larosa
dc1824f560 [pyqgis-console] added some typing setting:
- auto insertion "import" string
- auto insertion "):" for classes and methods
2013-09-15 23:31:46 +02:00
Salvatore Larosa
d8b8089e38 [pyqgis-console] allows to set font color in python lexer 2013-09-14 13:49:01 +02:00
Larry Shaffer
6e197484ed [pyqgis-console] Fix build error. Revert adding of qsci-pap-master target
- Leave only qsci-pap-src target for updating default pyqgis.pap in source tree
- Mark WITH_QSCIAPI as advanced in CMake, since it mostly a dev function
2013-08-31 14:05:08 -06:00
Larry Shaffer
dc4628599e [pyqgis-console] Add targets and python script for generating console's QScintilla .pap file, for auto-completion
- Run 'make;make qsci-pap-src; make install' to update the default .pap file in source tree
- Run 'make;make qsci-pap-master[; make install]' for local-only .pap that overrides the default .pap (when testing new bindings)
- Update console to override default .pap if master.pap is available
- Include new qgis.core.NULL attribute defined in <src>/python/__init__.py for QPyNullVariant comparisons
- Update 11-month-old default .pap
2013-08-30 13:12:38 -06:00
Salvatore Larosa
b99d51d7cd [pyqgis-console] avoids IndexError when attempts to run unselected code by keybinding Ctrl+E 2013-08-30 12:22:29 +02:00
Salvatore Larosa
c2310fdbdb [pyqgis-console] small fix for autocompletion bracket, also sets to False the default setting 2013-08-27 13:21:53 +02:00
Salvatore Larosa
8dc013117f [pyqgis-console] sextante => processing renaming: followup ec82b52 2013-08-22 17:25:29 +02:00
Alexander Bruy
ec82b52d88 update console for sextante renaming 2013-08-20 12:04:46 +03:00
Salvatore Larosa
577a72baf5 [pyqgis-console] more encoding fix. 2013-08-10 01:27:11 +02:00
Salvatore Larosa
07c524a928 [pyqgis-console] small fix for non-ascii chars 2013-08-07 14:07:14 +02:00