Commit Graph

73 Commits

Author SHA1 Message Date
wmayer
100ab2a975 Py3.12: initialize field 'tp_watched' 2024-02-12 11:41:49 -06:00
wmayer
5a39a85b73 Tools: for generated Python binding use PyTypeObject instead of _typeobject
And name the function arguments of PyMake to handle readability-named-parameter
2023-11-16 17:03:14 +01:00
mos
c25500fc72 fix python get value rotation are a Long .
remove old check python >=3.5 -> freecad require python 3.6
2023-11-16 14:05:30 +01:00
wmayer
3b9aefa4a3 Tools: support of METH_NOARGS flag for Python methods 2023-09-27 17:48:53 +02:00
wmayer
e444f86619 Tools: modernize C++: return braced init list 2023-08-18 00:36:24 +02:00
Jonas Bähr
3e68d6fd50 Remove C++ escaping from *Py.xml templates
Now all escaping required for the C++ code generation is done when the
.cpp/.h files are generated. Previously, only newlines were escaped
automatically. This was a) inconsistent and b) leaked c++ details into
the xml data.
In addition, the escaping is now done in one central place, harmonizing
the three previous implementations.

Pre-existing c++ escape sequences in the XML files have been replaced by
their literal equivalent so that the resulting python doc sting remains
unchanged.
2023-08-16 13:17:25 +02:00
wmayer
d244dcf2da modernize C++: use nullptr 2023-08-05 11:23:12 -06:00
wmayer
bb23aaf3e9 Core: modernize C++: redundant void arg 2023-08-05 16:50:31 +02:00
wmayer
3975f31f89 Misc: modernize C++: use override 2023-08-04 17:09:53 +02:00
Chris Hennes
4a7e1b6d9b Tools: Apply pre-commit autoformatting 2023-04-22 13:07:06 -05:00
marioalexis
6cb9bdd23a src: Add descriptor protocol support for Python C++ extension modules 2023-04-10 16:53:51 +02:00
mosfet80
3137dea940 remove Python2 code 2023-03-04 17:51:43 -06:00
luzpaz
23af228b87 Fix various indentation issues (tabs->spaces) 2023-01-23 16:59:28 +01:00
wmayer
d2168f51b9 Base: modernize C++: replace 'typedef' with 'using' 2022-08-29 11:42:09 +02:00
luz paz
c457f3bfbd Fix various 'testing inequality to None' syntax issues
Substitute `is not None` for `!= None`
2022-07-30 22:41:31 -04:00
Uwe
9fcb98d9c6 Revert "remove unused python<3.6 code"
This reverts commit 0a6d271121.
2022-06-19 16:23:13 +02:00
andrea
0a6d271121 remove unused python<3.6 code 2022-06-19 15:33:44 +02:00
wmayer
42d48103e8 Tools: lgtm: removes unused imports in Python scripts 2022-03-20 21:41:30 +01:00
wmayer
9160f06e1c Base: rename BaseExceptionFreeCADError to PyExc_FC_GeneralError 2022-03-17 14:45:48 +01:00
wmayer
31e2e95203 Base: Exception handling:
* Harmonize FreeCAD with Python exception types
* Implement AbortException::getPyExceptionType() to avoid handling it in client code
* Remove catch block for plain C strings
2022-01-19 18:00:04 +01:00
luz paz
05a22ec22d Misc: remove py2 code 2021-04-27 18:52:01 +02:00
wmayer
2f276601f8 Fix generation and build of python classes for 3.8 2021-04-27 14:35:34 +02:00
markus
aa0dcff74f Fix generation and build of python classes for 3.9 2021-04-27 00:41:53 +02:00
wmayer
af16ab02a0 Base: remove some more deprecated Py2 code
and remove deprecated void from function signature and replace 0 or NULL with nullptr
2021-04-26 10:29:48 +02:00
wmayer
111a21e45c Base: do not report C++ exception when converting it to Python exception
See https://forum.freecadweb.org/viewtopic.php?f=23&t=56464
2021-04-11 14:54:11 +02:00
wmayer
da4a2e4ea4 Py3: suppress warning: 'tp_print' is deprecated [-Wdeprecated-declarations]
If the tp_print slot is not set the warning -Wmissing-field-initializers is raised. If it's set then -Wdeprecated-declarations is raised.
So, the only way is to suppress it.
2020-10-15 17:07:39 +02:00
wmayer
bc6fefe3a0 Py3: fix warning: missing field 'tp_print' initializer [-Wmissing-field-initializers]
This warning is only specific to Py3.8. See https://docs.python.org/3/c-api/typeobj.html
2020-10-15 10:35:47 +02:00
wmayer
e4d531bb8b Py3.8: missing initializer for member '_typeobject::tp_vectorcall' [-Wmissing-field-initializers] 2020-06-08 14:32:21 +02:00
luz.paz
fad1badd05 Fix typo in templateClassPyExport.py [skip ci] 2019-12-23 16:50:23 +01:00
luz.paz
0c6786d4bf Templates: fix header uniformity
This PR fixes header uniformity across all template files.
2019-12-21 16:12:54 +01:00
wmayer
228f89638d Python: change generation of callback functions for class or static methods 2019-12-19 17:55:12 +01:00
wmayer
1ec6701519 handle nested name spaces in Python generation script 2019-11-20 22:57:58 +01:00
wmayer
5c7bef0ad8 add support of static and class methods in Python wrappers 2019-11-12 23:24:42 +01:00
Zheng, Lei
8ecee3c413 Tools: modify exception catch implemention in templateClassPyExport 2019-08-28 17:46:07 +02:00
wmayer
df3853738e fix several Py3 issues 2019-01-03 18:11:37 +01:00
wmayer
83f61b4372 implement true divide handler of the number protocol for Quantity 2018-10-27 15:27:27 +02:00
wmayer
4a717a8a44 Make destructors of all generated Py class protected
This is to avoid to create an object on the stack and thus to clutter Python's reference counting mechanism
2018-09-19 18:22:22 +02:00
luz.paz
b214f606c4 Misc. typo and whitespace fixes
ref: https://forum.freecadweb.org/viewtopic.php?f=3&t=30988#p256964
along with other misc. fixes
2018-09-19 17:26:03 +02:00
Michal Ulianko
faf8834484 py3.7 fix
PyUnicode_AsUTF8() returns const char* in py3.7 instead of char*. Making
changes to reflect that which should also be safe in
other Python versions.
2018-09-01 22:44:39 +02:00
wmayer
68f6c82eb1 fix -Wcast-function-type 2018-08-19 13:11:08 +02:00
looooo
18b6544883 win: pybind11: workaround for strdup 2018-04-23 09:56:23 +02:00
wmayer
b8eb1ec841 fix generation script of Python wrapper 2017-11-16 14:30:39 +01:00
luzpaz
ab8f8919b6 Misc. typos
+ some are doxy others are just comment code.  
+ some minor whitespace and grammatical tweaks. 
+ app/SCL/* typos have also been submitted upstream (https://github.com/stepcode/stepcode/pull/366). So it's ok to merge them in to master.
2017-10-04 17:59:11 +02:00
wmayer
c4c1034e4e Py3: replace sq_slice and sq_ass_slice with mp_subscript and mp_ass_subscript because they are not used any more in Py3 2017-08-21 13:33:07 +02:00
Abdullah Tahiri
04c09b3016 Generator script modified to first report and then ask for the python representation, so as keep track of the reported status 2017-08-17 22:47:14 +02:00
wmayer
bf693725f4 py3: support of Python 3.4 2017-06-07 15:28:46 +02:00
wmayer
69d0e8bd7f py3: partially revert of getattr -> getattro because getattro is only needed for the static callback function
issue 0000995
2017-06-03 10:51:05 +02:00
looooo
bc696e5ab5 py3: change of getattr -> getattro
issue 0000995
2017-06-03 10:51:05 +02:00
looooo
947c10a4fd py3: src/Tools: python3 diff, 2. part
issue 0000995
2017-05-31 23:23:21 +02:00
wmayer
2fa2370ef1 remove const from exception handler to fix build failure 2017-05-13 17:33:13 +02:00