Nyall Dawson
c033ac8ccd
Show filename in exceptions raised from Python console scripts
...
Instead of "", ensure the actual filename (or tab title, for unsaved
scripts) is shown in exceptions
2024-04-18 11:32:28 +10:00
Nyall Dawson
4e874a3c75
[console] Minor cleanups
...
- Add some typehints
- Avoid creating an unnecessary local variable
2024-03-07 14:17:22 +01:00
Nyall Dawson
fbbe690283
[console] Ensure stored last dir path settings is always a folder
...
This prevents a bug where the save action in the Python console
keeps defaulting back to the binary QGIS install folder
2024-03-07 14:17:22 +01:00
Nyall Dawson
4dcdddaa02
[console] Don't needlessly store QgsSettings objects
...
These are cheap to construct by design, so we can avoid
storing them and the messy cross-class access to member
variables
2024-03-07 14:17:22 +01:00
Nyall Dawson
310b9172fb
pyqt5to6: raise warnings on fragile addAction calls
...
The object.addAction variants with multiple arguments have changed
signature in Qt 6. It's safer to explicitly create a QAction first
and then add to an object using:
my_action=QAction(...)
obj.addAction(my_action)
It's a considerably less fragile syntax to use in any case!
Fixes errors when trying to show context menu in Python console
on Qt 6 builds
2024-01-31 10:55:33 +10:00
Nyall Dawson
e42abf7dc5
Update python files
2024-01-22 05:46:15 +10:00
Nyall Dawson
c16a1e2b3d
Update enums
2024-01-19 19:44:48 +10:00
Nyall Dawson
d7ae0aea25
+ should not be used with flags
2024-01-19 19:44:48 +10:00
Nyall Dawson
29a87bf0fc
Fix enums in console
2024-01-19 19:44:48 +10:00
Yoann Quenach de Quivillic
d798fd0732
Use embedded messageBar in showMessage
2023-04-18 14:55:32 +10:00
Nyall Dawson
895a68faee
Expose 'Search Selection in PyQGIS docs' action for all python code editors
2023-04-06 08:32:41 +10:00
Nyall Dawson
1c2aead582
Remove duplicate code
2023-03-20 16:06:24 +10:00
Matthias Kuhn
e5d6ade348
Merge pull request #51912 from YoannQDQ/python-console-__file__-available--#49191
2023-03-18 14:56:20 +01:00
Yoann Quenach de Quivillic
d2d7c5b422
Use native levenshtein distance
2023-03-17 10:52:08 +10:00
Yoann Quenach de Quivillic
5040a3b263
Fix flake8
2023-03-17 10:52:08 +10:00
Yoann Quenach de Quivillic
8db1026ed2
Use pushWarning instead of pushMessage
2023-03-17 10:52:08 +10:00
Yoann Quenach de Quivillic
53c7b8011b
Fallback to difflib if levenshtein unavailable
2023-03-17 10:52:08 +10:00
Yoann Quenach de Quivillic
04a8436187
Conditional import
2023-03-17 10:52:08 +10:00
Yoann Quenach de Quivillic
311c1b14d2
Fix infinite loop
2023-03-17 10:52:08 +10:00
Yoann Quenach de Quivillic
364bb96850
Change wording format->reformat
2023-03-17 10:52:08 +10:00
Yoann Quenach de Quivillic
6523f0c58c
Keep cursor position after formatting
2023-03-17 10:52:08 +10:00
Yoann Quenach de Quivillic
0f84e095b7
Add isort (sort imports)
2023-03-17 10:52:08 +10:00
Yoann Quenach de Quivillic
63a48983d9
Add black formatter
2023-03-17 10:52:08 +10:00
Yoann Quenach de Quivillic
3c97906bbf
Add formatting options
2023-03-17 10:52:08 +10:00
Yoann Quenach de Quivillic
ef6de1ff2c
Add format code action in Python Console Editor
2023-03-17 10:52:08 +10:00
Yoann Quenach de Quivillic
1f25b41d79
Fix duplicated newline on save (windows)
2023-03-13 14:49:32 +10:00
Yoann Quenach de Quivillic
a1a43e5362
Fixes #49191 make "__file__" available to scripts
2023-03-03 15:57:24 +01:00
Yoann Quenach de Quivillic
43c415d109
Fix focus switch on close tab
2023-03-03 12:17:01 +10:00
Yoann Quenach de Quivillic
fc3847def7
Fix bug introduced by #51913 - Proxy EditorTab attributes to Editor
2023-03-03 12:17:01 +10:00
Yoann Quenach de Quivillic
9c56921cca
Clean up code and fix shortcuts
2023-02-21 14:27:36 +10:00
Yoann Quenach de Quivillic
28146b538a
Fix Editor/EditorTab never deleted
2023-02-21 14:27:36 +10:00
Yoann Quenach de Quivillic
7f231099f4
sort imports and cleanup dead code
2023-02-21 14:27:36 +10:00
Yoann Quenach de Quivillic
e992797f8b
Restore autoCloseBracket settings and factorize autoInsertImport
2023-01-11 07:33:27 +10:00
Yoann Quenach de Quivillic
f98266b768
Get rid of the old autoCloseBracket setting
2023-01-11 07:33:27 +10:00
Yoann Quenach de Quivillic
1c79b4927d
[feature][console] Add toggle comment action in the python console ( #50341 )
...
Adds a toggle comment action in the Python Console and script editors
2023-01-07 09:27:08 +10:00
Nyall Dawson
ed54489a09
Move some useful python console methods to base class
2022-10-10 14:01:24 +10:00
nicogodet
c7207f58f1
Remove asterisk from file name when using Save
2022-04-11 08:22:33 +02:00
Nyall Dawson
d00356a0fa
[console] Use a more modern approach to running script files, to
...
avoid 'unclosed file' warnings dumped whenever script files
are run through the Python console
2022-01-18 15:23:08 +10:00
Nyall Dawson
174d5ee9e0
Ensure python script files saved in the Python console editor use
...
.py file extension
2021-07-01 15:40:20 +10:00
Salvatore Larosa
3c0fb94880
[pyqgis-console] use asterisk to track changes in script
2020-10-20 06:59:24 +10:00
Nyall Dawson
5c8013df61
[console] Fix exception when running scripts (followup cce7aa7)
...
and move responsibility for showing warning messages to QgsCodeEditor
base class, so that the same code can be used by other dialog script editors
2020-10-12 13:06:34 +10:00
Salvatore Larosa
cce7aa7315
[pyqgis-console] restore marker icon for syntax check
2020-10-12 09:49:45 +10:00
Nyall Dawson
ec2b21001e
Ensure autocomplete correctly works for all QgsCodeEditorPython instances
2020-10-06 03:57:50 +10:00
Nyall Dawson
8ec7f0e69c
Remove QgsPythonConsoleBase so that we have a single definitive Python editor class (QgsCodeEditorPython)
2020-10-06 03:57:50 +10:00
Nyall Dawson
bc55102eb8
Move icon references back out of QgsPythonConsoleBase
2020-10-05 18:37:46 +10:00
Nyall Dawson
e66a0a025b
Move more code out of QgsPythonConsoleBase
2020-10-05 18:37:46 +10:00
Nyall Dawson
d9782a12f5
Move more code to QgsCodeEditorPython base class
2020-10-05 13:24:46 +10:00
Nyall Dawson
ad946d45c8
Ensure colors in Python console match colors for Python editors
...
used elsewhere in the application
2020-10-04 05:02:57 +10:00
Salvatore Larosa
a2fb7f3eeb
[pyqgis-console] change message bar to Warning
2020-09-27 04:55:13 +10:00
Salvatore Larosa
1760e26a3a
[pyqgis-console] warn user to generate personal access token
2020-09-27 04:55:13 +10:00