Commit Graph

63 Commits

Author SHA1 Message Date
Marek Roszko 5c20c5732d We don't need pgm_base to expose pybind to everything 2023-12-25 23:28:33 -05:00
Marek Roszko 34a51d3c21 Make wxPython work under run from build directory on macOS 2023-11-14 07:14:13 -05:00
Marek Roszko e5f1cfd2b2 Set PYTHONPATH internally for macOS run from build dir 2023-11-13 23:09:12 -05:00
Marek Roszko 11de95778b Unwrap the FROM_UTF8 macro in favor of direct function
The extern just gets annoying to try to export the func later. We also yeet TO_UTF8 to string_utils.h for parity.
2023-09-09 00:10:57 -04:00
Nimish Telang 51e55dd750 Convert sprintf to snprintf in most files 2023-04-17 15:39:34 +00:00
Ian McInerney 2b1040ae67 Fix compatibility with older wx versions
ToInt was only added in wx 3.1.6 apparently, so for now make them long
types. Fixes bug introduced in 8ce0a84ca7.
2023-02-14 13:48:47 +00:00
Ian McInerney 1e8cc6855d Relax wxPython version mismatch check to major.minor
The previous version check failed when the version was even slightly
different, including on the revision field. Theoretically the ABI of the
wx minor versions in use should be the same, so this might work. On the
other hand, with wxPython it could break as well. YOLO.
2023-02-14 00:21:15 +00:00
Seth Hillbrand a9ed47f06c Update KICAD6->KICAD7 2023-01-23 22:21:12 +00:00
Marek Roszko 0ff32d20cd wxS more things 2023-01-22 09:41:42 -05:00
Jon Evans 70ec2f990f Work around wxPython / wxPropertyGrid fighting over global state
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13280
2023-01-21 17:06:51 -05:00
Stefan 2449f209b1 python version check: fix error message edge case 2023-01-02 20:20:01 +00:00
Jon Evans 5067e82e06 Only run the wxPython version check once 2023-01-02 13:26:55 -05:00
Jon Evans af0b176f57 Just catch any Python exception, we don't care what it is.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13354
2023-01-02 13:06:20 -05:00
Jon Evans f4a80903f0 Attempt to handle more edge cases in wxPython version check
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13354
2023-01-02 12:58:49 -05:00
Jon Evans 0a044656e3 Disable scripting and warn when wxPython version doesn't match 2023-01-02 11:52:14 -05:00
Wayne Stambaugh 7155d1af29 Fix a few more compile warnings. 2022-08-15 15:15:35 -04:00
Marek Roszko 44296dfea2 Forcefully ignore PYTHONPATH env variable on Windows
Fix https://gitlab.com/kicad/code/kicad/-/issues/11328
2022-04-04 22:10:59 -04:00
Seth Hillbrand 455e330f3b Cleanup a few more raw strings 2022-03-10 11:22:18 -08:00
Seth Hillbrand 5881471a52 Don't write bytecode on MacOS
MacOS packages are signed and checked on each run.  Since Python lives
inside the package, adding byte code will break the package signature
2022-03-10 11:17:24 -08:00
Seth Hillbrand 098e8f7d9b Revert "cmake: adding KICAD_MACOSX_APP_BUNDLE option"
This reverts commit ea9f960cc1.

Reverted for updates as this currently breaks kicad-mac-builder
2022-01-31 15:57:56 -08:00
Davide Gerhard ea9f960cc1 cmake: adding KICAD_MACOSX_APP_BUNDLE option
ADDED: with cmake KICAD_MACOSX_APP_BUNDLE option the user can disable
the macOS app bundle creation when compiling on macOS. This permit to
use/install KiCad like any other *nix platform (/usr/bin, /usr/share,
ecc.). By default, cmake build the app bundle.
2022-01-28 15:49:37 -08:00
qu1ck 0f7c0e3872 PCM implementation 2021-08-27 21:11:47 +00:00
qu1ck 78ab69027d Add 3rdparty/plugins to plugin search 2021-08-27 21:11:47 +00:00
Jeff Young 6aaf4413b3 Fix kicad_string.h / string.cpp mismatch.
They don't define a KiCad string class, so the header file name was
somewhat misleading. But the fact that they didn't match definitely
made coding more difficult.
2021-07-29 16:03:25 +01:00
Wayne Stambaugh 6c3ba1c20b Coverity issue fixes.
Issues #332032, #332086, #332157, and #332171.
2021-07-09 10:56:35 -04:00
Jeff Young 0dfb5fcaf9 Error message cleanup.
wxString::Format is redundant in a wxLogXXX call.
Error messages should generally be translatable.
Error messages should use generally consistent sentence forms.
2021-06-26 22:53:24 +01:00
Peter Montgomery b4f5b6ef3c Update environment var for Python to allow running from build or install folder 2021-06-15 01:12:45 +00:00
luz paz f968fc8719 Fix source comment / documentation typos 2021-06-09 19:32:58 +00:00
Marek Roszko 0ffabf5e70 Shift the msvc specific pythonhome init 2021-06-08 23:39:22 -04:00
Seth Hillbrand 891e200fc8 Use Python to test for modules (not CPython)
CPython call requires Python 3.8+, so we work around to keep the 3.6
users happy

Fixes https://gitlab.com/kicad/code/kicad/issues/8554
2021-06-07 13:56:31 -07:00
Jon Evans 148ac19386 Fix launching from the build dir after new_python 2021-06-01 21:37:33 -04:00
Marek Roszko 0dbfd28942 Remove unused vars 2021-06-01 18:49:55 -04:00
Seth Hillbrand c0bc6b1107 Fix compile errors on MSVC 2021-06-01 20:18:24 +00:00
Seth Hillbrand e050d42658 Re-enable KICAD_SCRIPTING_WXPYTHON
This keeps wxpython behind a build flag for platforms (mingw) that do
not yet support it.
2021-06-01 20:18:24 +00:00
Seth Hillbrand bf1437899e Add Python Tool to pcbnew 2021-06-01 20:18:24 +00:00
Seth Hillbrand c7d188a8d0 Centralizing SCRIPTING class 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
Dick Hollenbeck 7311f07eaf SWIG Improvements
*) Extend SWIG support deeper into the BOARD class.
*) Move swig *.i files into a directory identified for SWIG, in preparation
   for a parallel universe involving Phoenix's SIP.
*) Move swig files which will be common to both eeschema and pcbnew into
   common/swig.
*) Sketch out a "common" python module, and plan on dovetailing that into a
   libkicad_shared.{dll,so}
*) Add common/swig/ki_exceptions.i and define a macro HANDLE_EXCEPTIONS()
   which is to be applied to any function which needs C++ to python
   exception translation.
*) Move the test for SWIG tool into top level CMakeLists.txt file for use
   in all python modules beyond pcbnew, i.e. eeschema and common.
*) Add SWIG_MODULE_pcbnew_EXTRA_DEPS which generates a better Makefile, one
   which rebuilds the swig generated *.cxx file when one of its dependencies
   change.
*) Re-architect the board.i file so that it can be split into multiple *.i
   files easily.
*) Make some KIWAY from python progress, in preparation for Modular KiCad
   phase III.
2016-09-20 11:59:43 -04:00
Wayne Stambaugh cbcb3b896b Fix incorrect string translation macros.
* Replace _T() with _() for translatable strings.

* Don't translate debug messages.

* Don't translate copyright symbol.
2016-09-03 12:10:49 -04:00
Strontium c3d3a7a4c8 Scripting: replace PyCrust shell with enhanced PyAlaMode shell. 2015-12-21 09:55:31 -05:00
jean-pierre charras 204eb49ce5 Minor enhancement in python console: remove margins around the client area. simplify code. 2015-08-24 20:32:56 +02:00
jean-pierre charras 718053376d forgotten python_scripting.cpp fix. 2015-07-09 18:51:08 +02:00
jean-pierre charras 01ae08a9a9 Remove the call to wxversion.py on winbuilder, because it does not work (not found, even when exists), ans it is not useful. Avoid crashes when wxPython scripting layer is not loaded, on kicad exit, and when trying to open the py console. 2015-07-09 18:44:23 +02:00
Wayne Stambaugh c288d200fb Minor wxPython scripting improvements.
* Wrap Pgm().OnPgmExit() changes in APP_SINGLE_TOP to build conditionally
  when KICAD_SCRIPTING_WXPYTHON is enabled.
* Check the result of loading the correct wxPython version during
  initialization.
2015-06-27 15:05:26 -04:00
Mark Roszko 3c42764563 Fix snprintf usage. 2015-02-22 18:56:38 -05:00
Wayne Stambaugh 69553d6fa3 wxPython find and version loading fixes. (fixes lp:1408060)
* Add test to CMakeLists.txt to verify wxPython is installed when
  KICAD_SCRIPTING_WXPYTHON=ON.
* Add test to make sure wxPython version major and minor numbers match
  the version of wxWidgets found.
* Add code to set the correct version of wxPython to the python scripting
  initialization code.
* Minor code simplification in Pcbnew KIFACE main window creation.
2015-02-14 19:23:54 -05:00
Jean-Samuel Reynaud 47b5bdcd47 Fix a mismatch between method signature in scripting/python_scripting.cpp and scripting/python_scripting.h 2014-03-28 07:27:58 -05:00
jean-pierre charras fd2afec6f5 Remove some fully outdated code (#pragma, from Henner Zeller's report, and some other things) 2014-02-18 12:41:53 +01:00
jean-pierre charras 50743cf3ba Initial release of pl_editor, the page layout and title block editor. 2013-07-19 20:27:22 +02:00