from distutils.core import setup, Extension
# Below ROOT, we expect to find include, include/libxml2, lib and bin.
from distutils.core import setup, Extension
# Below ROOT, we expect to find include, include/libxml2, lib and bin.
# a private copy of the dlls are included in the package.
# If this flag is not set, the libxml2 and libxslt
# dlls must be found somewhere in the PATH at runtime.
# a private copy of the dlls are included in the package.
# If this flag is not set, the libxml2 and libxslt
# dlls must be found somewhere in the PATH at runtime.
xml_files = ["libxml2-api.xml", "libxml2-python-api.xml",
"libxml.c", "libxml.py", "libxml_wrap.h", "types.c",
xml_files = ["libxml2-api.xml", "libxml2-python-api.xml",
"libxml.c", "libxml.py", "libxml_wrap.h", "types.c",
- "xmlgenerator.py", "README", "TODO", "drv_libxml2.py"]
+ "xmlgenerator.py", "README", "TODO", "drv_libxml2.py"]
xslt_files = ["libxslt-api.xml", "libxslt-python-api.xml",
"libxslt.c", "libxsl.py", "libxslt_wrap.h",
xslt_files = ["libxslt-api.xml", "libxslt-python-api.xml",
"libxslt.c", "libxsl.py", "libxslt_wrap.h",
- print("failed to find and generate stubs for libxml2, aborting ...")
- print(sys.exc_info()[0], sys.exc_info()[1])
- sys.exit(1)
+ print("failed to find and generate stubs for libxml2, aborting ...")
+ print(sys.exc_info()[0], sys.exc_info()[1])
+ sys.exit(1)
head = open("libxml.py", "r")
generated = open("libxml2class.py", "r")
head = open("libxml.py", "r")
generated = open("libxml2class.py", "r")
if missing("xsltgenerator.py") or missing("libxslt-api.xml"):
print("libxslt stub generator not found, libxslt not built")
else:
if missing("xsltgenerator.py") or missing("libxslt-api.xml"):
print("libxslt stub generator not found, libxslt not built")
else:
- try:
- import xsltgenerator
- except:
- print("failed to generate stubs for libxslt, aborting ...")
- print(sys.exc_info()[0], sys.exc_info()[1])
- else:
- head = open("libxsl.py", "r")
- generated = open("libxsltclass.py", "r")
- result = open("libxslt.py", "w")
- for line in head.readlines():
+ try:
+ import xsltgenerator
+ except:
+ print("failed to generate stubs for libxslt, aborting ...")
+ print(sys.exc_info()[0], sys.exc_info()[1])
+ else:
+ head = open("libxsl.py", "r")
+ generated = open("libxsltclass.py", "r")
+ result = open("libxslt.py", "w")
+ for line in head.readlines():
extens=[Extension('libxml2mod', c_files, include_dirs=includes,
extens=[Extension('libxml2mod', c_files, include_dirs=includes,
if with_xslt == 1:
extens.append(Extension('libxsltmod', xslt_c_files, include_dirs=includes,
if with_xslt == 1:
extens.append(Extension('libxsltmod', xslt_c_files, include_dirs=includes,
setup (name = "libxml2-python",
# On *nix, the version number is created from setup.py.in
# On windows, it is set by configure.js
setup (name = "libxml2-python",
# On *nix, the version number is created from setup.py.in
# On windows, it is set by configure.js
description = descr,
author = "Daniel Veillard",
author_email = "veillard@redhat.com",
description = descr,
author = "Daniel Veillard",
author_email = "veillard@redhat.com",