1
0
mirror of https://gitlab.gnome.org/GNOME/libxslt synced 2025-04-19 05:42:15 +03:00

49 Commits

Author SHA1 Message Date
Nick Wellnhofer
579e32c88d python: Declare init func with PyMODINIT_FUNC 2024-12-07 15:34:11 +01:00
Yegor Yefremov
5df99903ae python: fix typos
Typos were found with codespell.
2024-10-14 10:20:33 +02:00
Nick Wellnhofer
c65a7c05f9 build: Remove mem-debug option
This is an ancient, internal debugging option which only works if
libxml2 is built with mem-debug as well. Remove the option to avoid
crashes.

Fixes #105.
2024-01-30 13:02:45 +01:00
Nick Wellnhofer
99f2036bd2 python: Don't set deprecated global 2023-09-21 03:29:28 +02:00
Chun-wei Fan
966296cb9b python/libxslt.c: Replace ssize_t with Py_ssize_t
This ensures that we have the ssize_t that we want on all compilers supported
by Python, since ssize_t is not supported on Visual Studio, for instance, since
it is a POSIX type.
2022-11-21 12:38:53 +08:00
Nick Wellnhofer
a0623d9f7a Fix various compiler warnings 2022-09-01 08:19:00 +02:00
Nick Wellnhofer
43e3b41def Migrate from PyEval_ to PyObject_
PyEval_ functions are deprecated.
2022-08-29 17:23:35 +02:00
Nick Wellnhofer
940e59939d Don't mess with xmlDefaultSAXHandler
This is deprecated and shouldn't have any effect.
2022-08-26 04:32:18 +02:00
Nick Wellnhofer
22f12ce58e Stop calling deprecated libxml2 init functions 2022-03-18 15:38:40 +01:00
Nick Wellnhofer
b3076bccdb Finish and clean up Python 3 support
- Handle Python 3 types similar to libxml2
- Copy new versions of libxml_xmlXPathDestructNsNode and
  libxml_xmlXPathObjectPtrConvert from libxml2
- Fix compiler warnings
- Fix whitespace
- Remove unneeded imports from __future__
- Remove test in extelem.py (StringIO can't be converted to FILE under
  Python 3)
- string.lower() works in both Python 2 and 3

Closes #25.
2020-11-19 17:59:37 +01:00
Suleyman Poyraz
a2db8da1ac Initial support for Python 3
Squashed merge of pull request !19.
2020-11-19 17:08:37 +01:00
Nick Wellnhofer
d5d511f0b7 Fix vsnprintf in Python bindings on Windows
- Fix vsnprintf on older MSVC versions
- Stop using _vsnprintf on MinGW
2019-02-12 12:31:20 +01:00
Nick Wellnhofer
51b79bfa90 Fix callback signatures in Python bindings 2018-01-16 19:04:33 +01:00
Nick Wellnhofer
3bea417b5e Fix extension callback signatures 2017-11-29 16:52:13 +01:00
Nick Wellnhofer
8760bb2276 Fix Windows compiler warnings
Fixes bug 788317. Thanks to J. Peter Mugaas for the initial patch.
2017-10-25 16:21:23 +02:00
Nick Wellnhofer
477f5779ed Fix compiler warnings in Python bindings 2017-10-08 14:26:56 +02:00
Daniel Veillard
90e8b9066d Fix a couple of places where (f)printf parameters were broken
As reported by Thomas Jarosch <thomas.jarosch@intra2net.com>
2013-01-30 17:31:37 +01:00
Daniel Veillard
0ca0a15ffb Big space and tabs cleanup
Remove spaces followed by tabs, and space and tabs at the end of lines
2012-09-12 14:07:24 +08:00
William M. Brack
f9876fd931 changed iterator argument for Py_Dict_Next from int to ssize_t to fix
* python/libxslt.c: changed iterator argument for Py_Dict_Next
  from int to ssize_t to fix x86_64 bug #489854

svn path=/trunk/; revision=1447
2007-10-25 00:43:22 +00:00
William M. Brack
66af4a3907 applied patch from Daniel Gryniewicz to fix a segfault caused by a
* python/libxslt.c: applied patch from Daniel Gryniewicz to
  fix a segfault caused by a parameter array not being preset
  to zero.

svn path=/trunk/; revision=1444
2007-08-30 00:17:46 +00:00
William M. Brack
40e7c29b35 added new function replace from Joel Reed. added new test case for above.
* libexslt/strings.c: added new function replace from Joel
          Reed.
        * tests/exslt/Makefile.am, replace.1.xml, replace.1.xsl,
          replace.1.out: added new test case for above.
        * libxslt.spec.in: trivial change from Gnome to GNOME
        * configure.in: trivial change for flags on my compilations
        * libxslt/documents.c, libxslt/documents.h, libxslt/keys.c,
          libxslt/keys.h, libxslt/variables.c, libxslt/templates.c,
          libxslt/transform.c, libxslt/variables.c, libxslt/xslt.c,
          libxslt/xsltutils.c: fixed some documentation/comments and
          compilation warnings - no change to logic.
        * re-generated the documentation.

svn path=/trunk/; revision=1413
2007-01-11 03:13:13 +00:00
William M. Brack
c2d91bc1cb applied patch supplied by Kjartan Maraas (bug #388567).
* python/libxslt.c: applied patch supplied by Kjartan Maraas
  (bug #388567).
2006-12-22 17:12:57 +00:00
Daniel Veillard
50605fed22 applied patch from Nic James Ferrier to make stylesheets comparable and to
* configure python/generator.py python/libxsl.py
  python/libxslt-python-api.xml python/libxslt.c
  python/tests/2stage.py python/tests/loader.py: applied patch from
  Nic James Ferrier to make stylesheets comparable and to add
  transformContext handling
Daniel
2006-12-11 11:11:06 +00:00
Daniel Veillard
a3a4c25d47 convenience change try to avoid calling libxml2 cleanup function directly
* configure.in: convenience change
* python/libxsl.py python/libxslt-python-api.xml python/libxslt.c:
  try to avoid calling libxml2 cleanup function directly but go
  though the python wrapper of libxml2 for memory debug accounting.
Daniel
2004-07-02 13:53:31 +00:00
William M. Brack
9d9bdf0b0a Minor enhancements to eliminate compile/test warnings
* libxslt/xsltconfig.h.in, libexstl/exsltconfig.h.in:
  changed macro ATTRIBUTE_UNUSED for gcc so that, if undefined,
  it's defined as __attribute__((unused))
* python/libxslt.c: fixed ATTRIBUTE_UNUSED to appear after
  variable declaration
* libxslt/preproc.c: minor change to get rid of unused var/code
2003-11-05 03:16:46 +00:00
William M. Brack
1133731a3e minor cleanup for various compilation warnings (AIX as well as gcc)
* libxslt/numbers.c, libxslt/extensions.c, libexslt/date.c,
  python/libxslt.c, xsltproc/xsltproc.c: minor cleanup for
  various compilation warnings (AIX as well as gcc)
2003-09-28 01:45:49 +00:00
Daniel Veillard
95c248b603 don't output errors to stdout by default use stderr instead. Daniel
* python/libxslt.c: don't output errors to stdout by default
  use stderr instead.
Daniel
2003-09-18 09:33:13 +00:00
Daniel Veillard
9332a25a91 patch from Sean Treadway, adding Python bindings for extension element and
* python/generator.py python/libxslt-python-api.xml python/libxslt.c
  python/libxslt_wrap.h python/libxsltclass.txt: patch from
  Sean Treadway, adding Python bindings for extension element and
  some bindings cleanups.
* python/tests/Makefile.am python/tests/extelem.py: also add an
  example/test.
Daniel
2003-07-09 10:22:14 +00:00
Daniel Veillard
eb168d9dc3 portability fixes from Albert Chin avoid RTLD_GLOBAL detection warning too
* configure.in python/Makefile.am python/libxslt.c libxslt/xsltutils.c
  libxslt/trio.h libxslt/triodef.h: portability fixes from Albert Chin
* python/libxslt.py: avoid RTLD_GLOBAL detection warning too
Daniel
2003-03-26 20:47:47 +00:00
Daniel Veillard
6139969721 fixed a couple of return error #104150 reported by Peter O'Shea Daniel
* python/libxslt.c: fixed a couple of return error #104150
  reported by Peter O'Shea
Daniel
2003-01-22 15:47:10 +00:00
Daniel Veillard
cb20183b44 Fixed a debug log, switched it off now, Daniel 2003-01-13 22:33:20 +00:00
Daniel Veillard
d932aafe73 fixing bug #101602 for extension modules init and shutdown callbacks,
* libxslt/extensions.c libxslt/transform.c: fixing bug #101602
  for extension modules init and shutdown callbacks, check that
  they are now called when needed.
* python/libxsl.py python/libxslt-python-api.xml python/libxslt.c:
  started adding the extension module support at the Python level.
  Still a strange bug to hunt down left.
Daniel
2003-01-13 22:28:34 +00:00
Daniel Veillard
24abc7719a patch from Stphane Bidoul for Python 2.1 Daniel
* python/libxslt.c: patch from Stphane Bidoul for Python 2.1
Daniel
2002-12-23 14:44:48 +00:00
Daniel Veillard
b827b9b065 fixes for compiling without config.h Daniel
* python/generator.py python/libxslt.c: fixes for compiling
  without config.h
Daniel
2002-11-23 11:25:00 +00:00
Daniel Veillard
ccc8569012 make sure to register EXSLT for the bindings add a specific test minor
* python/libxslt.c: make sure to register EXSLT for the bindings
* python/tests/Makefile.am python/tests/exslt.py: add a specific test
* xsltproc/xsltproc.c: minor cleanup
Daniel
2002-11-16 22:26:08 +00:00
Daniel Veillard
f015c8f98c applied a patch from Ralf Mattes providing style.saveResultToString()
* python/libxslt-python-api.xml python/libxslt.c
  python/libxsltclass.txt python/tests/basic.py: applied a patch
  from Ralf Mattes providing style.saveResultToString()
Daniel
2002-08-25 15:04:00 +00:00
Daniel Veillard
4c95dfde98 fixed the parameter order when calling Python based extensions. Daniel
* python/libxslt.c: fixed the parameter order when calling
  Python based extensions.
Daniel
2002-08-21 17:00:38 +00:00
Daniel Veillard
eef2ef13ad tried to fix #79105 by providing a specific error registering routine.
* python/libxslt-python-api.xml python/libxslt.c
  python/libxsltclass.txt : tried to fix #79105 by providing a
  specific error registering routine.
Daniel
2002-05-24 13:03:04 +00:00
Daniel Veillard
2abd71732c applied the same kind of fixes to the Python Makefiels than to libxml2
* python/Makefile.am python/generator.py python/libxslt.c
  python/types.c python/tests/Makefile.am: applied the same kind of
  fixes to the Python Makefiels than to libxml2 ones. Updates
  and cleanups too.
Daniel
2002-03-18 15:24:51 +00:00
Daniel Veillard
ef2531fb96 preparing release 1.0.13 updated and rebuilt the docs fixed a possible
* configure.in libxslt/xsltwin32config.h: preparing release
  1.0.13
* doc/*: updated and rebuilt the docs
* python/libxslt.c: fixed a possible reentrancy problem
Daniel
2002-03-08 16:52:34 +00:00
Daniel Veillard
bd90990db2 changes for the 'usual' setup.py to allow building a libxml2-python module
* python/generator.py python/libxslt.c: changes for the 'usual'
  setup.py to allow building a libxml2-python
  module based on the same code. The initialization is however
  different the 2 .so files fo libxml2 and libxslt are identical and
  they entry point initialize both libraries. this is done to avoid
  some possible nasty problem since the Python don't merge the maps
  of all shared modules.
* python/libxsl.py: attempt to cope with the shared library loading
  problem when both modules are not merged.
Daniel
2002-02-22 22:58:47 +00:00
Daniel Veillard
0f39f084c1 fixed a small warning. rebuilt the APIs Daniel
* python/libxml.c : fixed a small warning.
* doc/libxslt-api.xml doc/libxslt-decl.txt doc/libxslt-refs.xml
  python/libxsltclass.txt: rebuilt the APIs
Daniel
2002-02-10 19:31:34 +00:00
Daniel Veillard
43ced5c60b Fixed the python Makefiles, corrected a bug showing up on ia64, changed
* configure.in libxslt.spec.in python/Makefile.am python/generator.py
  python/libxsl.py python/libxslt.c python/tests/Makefile.am:
  Fixed the python Makefiles, corrected a bug showing up on ia64,
  changed the name of the python internal module too
Daniel
2002-02-09 18:06:02 +00:00
Daniel Veillard
3146d5356f fixup the script and rebuid the API cleanup provided accessors for a lot
* doc/libxslt-api.xml doc/libxslt-decl.txt doc/libxslt-refs.xml
  doc/parsedecl.py: fixup the script and rebuid the API
* libxslt/extensions.h: cleanup
* python/generator.py python/libxslt-python-api.xml python/libxslt.c
  python/libxsltclass.txt: provided accessors for a lot of the
  tructures involved in the transformation. Stylesheet and
  transformation python object don't free automatically the
  encapsulated object when deallocated.
* python/tests/Makefile.am python/tests/basic.py
  python/tests/extfunc.py python/tests/pyxsltproc.py:
  updated the examples
Daniel
2002-02-07 22:34:59 +00:00
Daniel Veillard
9de2bd46fc small fix cleanup avoid a problem with $(TESTS) augmented the wrappers
* xsltproc/xsltproc.c: small fix
* Makefile.am: cleanup
* python/tests/Makefile.am: avoid a problem with $(TESTS)
* python/generator.py python/libxml_wrap.h python/libxsl.py
  python/libxslt.c python/libxsltclass.txt: augmented the
  wrappers
* python/tests/pyxsltproc.py: rewrote xsltproc on top of the
  libxslt-python API to get an estimate of what is missing
Daniel
2002-02-07 17:02:34 +00:00
Daniel Veillard
ff22c1a5f9 added libxslt_xsltCleanup() added parameters to
* python/libxsl.py python/libxslt-python-api.xml python/libxslt.c
  python/libxsltclass.txt: added libxslt_xsltCleanup() added parameters
  to libxslt_xsltApplyStylesheet() removed the memleaks left and
  fixed an import order.
* python/tests/basic.py python/tests/extfunc.py: updated the tests
Daniel
2002-02-06 23:03:38 +00:00
Daniel Veillard
09af30e51e plugged the extension of the engine with python defined functions added a
* python/libxlst.c python/libxslt-python-api.xml
  python/libxsltclass.txt: plugged the extension of the engine
  with python defined functions
* python/tests/Makefile.am python/tests/extfunc.py: added a
  basic test, still a memleak, cleanup function needed.
Daniel
2002-02-06 18:48:48 +00:00
Daniel Veillard
f0cb070b69 attempst to tweak to get full memory debug... the basic API starts to work
* configure.in python/Makefile.am: attempst to tweak to get
  full memory debug...
* python/generator.py python/libxsl.py python/libxslt-python-api.xml
  python/libxslt.c python/libxslt_wrap.h python/libxsltclass.txt:
  the basic API starts to work
* python/tests/test.*: first basic test
* libxslt/xsltutils.c: fixed a comment
Daniel
2002-02-05 23:23:15 +00:00
Daniel Veillard
0e33797b05 reactivated xsltMatchPattern() since this is really something one may want
* libxslt/pattern.[ch] doc/libxslt-api.xml doc/libxslt-refs.xml:
  reactivated xsltMatchPattern() since this is really something
  one may want to have access to in an extension function.
* Makefile.am configure.in python/Makefile.am python/generator.py
  python/libxml_wrap.h python/libxsl.py python/libxslt-python-api.xml
  python/libxslt.c python/libxslt_wrap.h python/libxsltclass.txt
  python/types.c: started working on the python bindings, borrowed
  most of the work done for libxml2, most of the generator code
  is similar. Commit at the point where this compiles cleanly and
  "import libxslt" doesn't yield any missing entry point.
Daniel
2002-02-04 18:51:53 +00:00