diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-14 19:47:20 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-14 19:47:20 +0000 |
commit | 875ae8e38bc3663e5057ca910e7ebe4b2994edb9 (patch) | |
tree | ddd3b3bc4d6f0343bae986aebbf9555c20f8e558 /python/sip/custom | |
parent | cb61a0436524f8ceba31db51ce3f1c5d4afbbb0e (diff) | |
download | tdebindings-875ae8e38bc3663e5057ca910e7ebe4b2994edb9.tar.gz tdebindings-875ae8e38bc3663e5057ca910e7ebe4b2994edb9.zip |
Updated python directory
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1175349 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'python/sip/custom')
-rw-r--r-- | python/sip/custom/custom.c | 60 | ||||
-rw-r--r-- | python/sip/custom/customw.c | 64 | ||||
-rw-r--r-- | python/sip/custom/mkcustom.py | 87 |
3 files changed, 0 insertions, 211 deletions
diff --git a/python/sip/custom/custom.c b/python/sip/custom/custom.c deleted file mode 100644 index e5ec2d25..00000000 --- a/python/sip/custom/custom.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This file is the basis of a custom Python interpreter. Use it for Linux, - * UNIX and Windows (console). You will also need to edit mkcustom.py. - */ - - -#include <Python.h> - - -int main(int argc, char **argv) -{ - /* - * Declare the module initialisation function for each module you want - * to be a builtin in the custom interpreter. The name of the function - * will be the name of the module with "init" prepended. The modules - * must be built as static libraries (using the -k flag to configure.py - * for SIP and PyQt). - */ - - /* The sip module will be builtin. */ - extern void initsip(void); - - /* - * Uncomment these (and in the structure below) to include the PyQt - * modules as builtins. - */ -/* extern void initqt(void);*/ -/* extern void initqtaxcontainer(void);*/ -/* extern void initqtcanvas(void);*/ -/* extern void initqtext(void);*/ -/* extern void initqtgl(void);*/ -/* extern void initqtnetwork(void);*/ -/* extern void initqtsql(void);*/ -/* extern void initqttable(void);*/ -/* extern void initqtui(void);*/ -/* extern void initqtxml(void);*/ - - /* - * This structure specifies the names and initialisation functions of - * the builtin modules. - */ - struct _inittab builtin_modules[] = { - {"sip", initsip}, -/* {"qt", initqt},*/ -/* {"qtaxcontainer", initqtaxcontainer},*/ -/* {"qtcanvas", initqtcanvas},*/ -/* {"qtext", initqtext},*/ -/* {"qtgl", initqtgl},*/ -/* {"qtnetwork", initqtnetwork},*/ -/* {"qtsql", initqtsql},*/ -/* {"qttable", initqttable},*/ -/* {"qtui", initqtui},*/ -/* {"qtxml", initqtxml},*/ - {NULL, NULL} - }; - - PyImport_ExtendInittab(builtin_modules); - - return Py_Main(argc, argv); -} diff --git a/python/sip/custom/customw.c b/python/sip/custom/customw.c deleted file mode 100644 index 58770766..00000000 --- a/python/sip/custom/customw.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * This file is the basis of a custom Python interpreter. Use it for Windows - * (non-console). You will also need to edit mkcustom.py. - */ - - -#define WIN32_LEAN_AND_MEAN -#include <windows.h> - -#include <Python.h> - - -int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, - LPSTR lpCmdLine, int nCmdShow) -{ - /* - * Declare the module initialisation function for each module you want - * to be a builtin in the custom interpreter. The name of the function - * will be the name of the module with "init" prepended. The modules - * must be built as static libraries (using the -k flag to configure.py - * for SIP and PyQt). - */ - - /* The sip module will be builtin. */ - extern void initsip(void); - - /* - * Uncomment these (and in the structure below) to include the PyQt - * modules as builtins. - */ -/* extern void initqt(void);*/ -/* extern void initqtaxcontainer(void);*/ -/* extern void initqtcanvas(void);*/ -/* extern void initqtext(void);*/ -/* extern void initqtgl(void);*/ -/* extern void initqtnetwork(void);*/ -/* extern void initqtsql(void);*/ -/* extern void initqttable(void);*/ -/* extern void initqtui(void);*/ -/* extern void initqtxml(void);*/ - - /* - * This structure specifies the names and initialisation functions of - * the builtin modules. - */ - struct _inittab builtin_modules[] = { - {"sip", initsip}, -/* {"qt", initqt},*/ -/* {"qtaxcontainer", initqtaxcontainer},*/ -/* {"qtcanvas", initqtcanvas},*/ -/* {"qtext", initqtext},*/ -/* {"qtgl", initqtgl},*/ -/* {"qtnetwork", initqtnetwork},*/ -/* {"qtsql", initqtsql},*/ -/* {"qttable", initqttable},*/ -/* {"qtui", initqtui},*/ -/* {"qtxml", initqtxml},*/ - {NULL, NULL} - }; - - PyImport_ExtendInittab(builtin_modules); - - return Py_Main(__argc, __argv); -} diff --git a/python/sip/custom/mkcustom.py b/python/sip/custom/mkcustom.py deleted file mode 100644 index 0e8deabb..00000000 --- a/python/sip/custom/mkcustom.py +++ /dev/null @@ -1,87 +0,0 @@ -"""This Python script uses the SIP build system to create a Makefile for -building a custom Python interpreter. The script doesn't take any command line -flags - just edit it to suit your needs. You will also need to edit custom.c -or customw.c. -""" - - -import sys -import sipconfig - - -# Get the SIP configuration. -cfg = sipconfig.Configuration() - - -# This is the name of the interpreter executable (excluding any platform -# specific extension. -InterpreterName = "custom" - -# Set this to True to create a non-console interpreter on Windows (ie. a custom -# version of pythonw). Make sure you make changes to customw.c rather than -# custom.c. It is ignored on other platforms. -WindowsInterpreter = False - -# Set this to the list of the name of modules to be builtin to the custom -# interpreter. The modules must also be added to custom.c and/or customw.c. -Modules = ["sip"] -#Modules = ["sip", "qt", "qtaxcontainer", "qtcanvas", "qtext", "qtgl", -# "qtnetwork", "qtsql", "qttable", "qtui", "qtxml"] - -# Set this to the name of the directory containing the static modules. -ModuleDirectory = cfg.default_mod_dir - -# Set this to the list of additional libraries to link with the custom -# interpreter. -ExtraLibraries = [] -#ExtraLibraries = ["qassistantclient"] - -# Set this to the list of additional directory names to search for any -# additional libraries. -ExtraLibraryDirectories = [] - -# Set this to the name of the directory containing the Python library. -PythonLibraryDirectory = cfg.py_lib_dir - - -# Make platform specific modifications. -if sys.platform == "linux2": - ExtraLibraries.append("util") - - -# Create a dictionary describing the target and source files to be passed to -# the SIP build system. -build = {} - -if sys.platform == "win32" and WindowsInterpreter: - build["target"] = InterpreterName + "w" - build["sources"] = "customw.c" - console = False -else: - build["target"] = InterpreterName - build["sources"] = "custom.c" - console = True - -# Assume Qt support is required if Qt support was enabled in the sip module. -qt = (cfg.qt_version > 0) - -# Create the Makefile instance. -mf = sipconfig.ProgramMakefile(cfg, build, python=True, console=console, qt=qt) - -# Modify the Makefile according to the values set above. -mf.extra_lib_dirs.extend(ExtraLibraryDirectories) -mf.extra_lib_dirs.append(ModuleDirectory) -mf.extra_lib_dirs.append(PythonLibraryDirectory) - -mf.extra_libs.extend(Modules) - -if sys.platform == "win32": - pylib = "python%u%u" -else: - pylib = "python%u.%u" - -mf.extra_libs.append(pylib % ((cfg.py_version >> 16), ((cfg.py_version >> 8) & 0xff))) -mf.extra_libs.extend(ExtraLibraries) - -# Generate the Makefile itself. -mf.generate() |