Commit Graph

22 Commits

Author SHA1 Message Date
Marek Roszko 7e089182b8 Swap out deprecated Iconized for IsIconized in python
Supported since wx 3.0, wxpython seems to have dropped it
2022-09-19 20:29:52 -04:00
Seth Hillbrand 917845cf00 Ensure we can version scripting properly
Adds Version() and FullVersion() calls to support reporting version to
scripts and scripting window

Fixes https://gitlab.com/kicad/code/kicad/issues/10079

(cherry picked from commit 0a13f15a9d)
2022-02-03 15:59:10 -08:00
Seth Hillbrand 182ccb63ae Remove config options menu from PyShell
We should figure out how to get these into the json settings.  In the
meantime, disable as they are broken on close

Fixes https://gitlab.com/kicad/code/kicad/issues/9691
2021-11-20 14:37:18 -08:00
Seth Hillbrand 70df3822b5 Link command IDs to window frame
This should be compatible with both 4.0 and 4.1 of wxPython

Fixes https://gitlab.com/kicad/code/kicad/issues/9432
2021-10-20 11:54:25 -07:00
Seth Hillbrand 93b25b115b Handle alternate exception
Apparently, some versions throw one exception, some another.  We really
don't care which, we just want an ID value
2021-10-20 09:28:49 -07:00
Marek Roszko 67d24e8b00 Don't try and use a empty config path for startup scripts
Fix #9205
2021-09-22 21:03:34 -04:00
Marek Roszko 1463c9ab01 Init isPcbframe in the correct order
Fix #9205
2021-09-22 20:59:32 -04:00
Seth Hillbrand 8ff20fd97b Ensure python window splits
The History/Calltips/locals window splits were only being shown when
running SingleTop.  For unknown reasons, the crust "CallAfter" routine
was not running, so we force the call
2021-09-21 15:18:24 -07:00
Seth Hillbrand becc3a228e Hide Python window on close button 2021-09-21 15:00:08 -07:00
Seth Hillbrand a5955ecbf7 Don't destroy parents
Now that we are handling windows from inside the KiCad framing system,
python console does not need to destroy its own windows.  This may help
prevent some odd preference corruption as well
2021-09-21 14:43:51 -07:00
Seth Hillbrand 38cdc362a0 Don't fail if we can't create startup file
Fixes https://gitlab.com/kicad/code/kicad/issues/9205
2021-09-21 14:21:59 -07:00
Seth Hillbrand 73401932f7 Fix python help() parser
Fixes https://gitlab.com/kicad/code/kicad/issues/9191
2021-09-21 14:14:41 -07:00
jean-pierre charras 57cfde3123 kicad_pyeditor.py: add missing imports
Fixes #9109
https://gitlab.com/kicad/code/kicad/issues/9109
2021-09-08 17:31:41 +02:00
Mikolaj Wielgus 0c66cb85e3 Python console: Adjust dark theme colors to look better
Fixes https://gitlab.com/kicad/code/kicad/issues/8928
2021-09-06 21:15:40 +00:00
jean-pierre charras 7a7eee86ce kicad_pyshell/__init_py: avoid loading pcbnew module if the board editor is not open.
It happens when opening the python console from Eeschema.
In this case, and on msys2, Pgm() returns a null pointer because the pcbnew
application is not initialized, and the first call to Pgm()
from a python script crashes Kicad
2021-08-15 15:11:07 +02:00
jean-pierre charras eece74efa7 kicad_pyeditor.py: remove useless "import pcbnew" that create issues when created from Eeschema 2021-08-15 12:37:39 +02:00
Seth Hillbrand e87fdf06c1 Wrap GetNewId() for older wxPythons
18.04 and earlier use wxPython 4.0.1 that doesn't have the new Id call.
This wraps the id to use the earlier version if the newer one is not
available

Fixes https://gitlab.com/kicad/code/kicad/issues/8887
2021-07-30 10:36:15 -07:00
Seth Hillbrand 76a6177eb7 Re-direct help() output to console
Keeps a copy of stdin as well, so that re-assigning this in the python
window does't close the output

Fixes https://gitlab.com/kicad/code/kicad/issues/8047
2021-07-12 16:22:07 -07:00
Seth Hillbrand e151130356 Adjust init for Python >=3.6 2021-06-01 20:18:24 +00:00
Seth Hillbrand 11592e6eae Fix scripting window issue not saving settings 2021-06-01 20:18:24 +00:00
Seth Hillbrand 192fbfd5e5 Finalize Python Frame 2021-06-01 20:18:24 +00:00
Seth Hillbrand 81d58bcea9 Working python window 2021-06-01 20:18:24 +00:00