Renamed pykl to klayout - because of name clash with the klayout binary, the python module now sits inside 'pymod'

This commit is contained in:
Matthias Koefferlein 2018-06-19 00:50:27 +02:00
parent 2e3f0e0e88
commit 8845d18c74
27 changed files with 82 additions and 79 deletions

3
.gitignore vendored
View File

@ -4,6 +4,9 @@
*.o
*.obj
# Compiled Python files
*.pyc
# Precompiled Headers
*.gch
*.pch

View File

@ -1,5 +1,5 @@
TARGET = cif
TARGET = common
DESTDIR = $$OUT_PWD/../../../../lay_plugins
include($$PWD/../../../lay_plugin.pri)

View File

@ -2141,7 +2141,7 @@ property_setter_func (PyObject *self, PyObject *value, void *closure)
std::map<const gsi::MethodBase *, std::string> PythonModule::m_python_doc;
std::vector<const gsi::ClassBase *> PythonModule::m_classes;
const std::string pymod_name ("pykl");
const std::string pymod_name ("klayout");
PythonModule::PythonModule ()
: mp_mod_def (0)

View File

@ -149,16 +149,16 @@ static PyMethodDef BridgeMethods[] = {
#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC
initbridge_sample ()
initbridge_mod ()
{
PyObject *m;
m = Py_InitModule ("bridge_sample", BridgeMethods);
m = Py_InitModule ("bridge_mod", BridgeMethods);
if (m == NULL) {
return;
}
BridgeError = PyErr_NewException ((char *) "bridge_sample.error", NULL, NULL);
BridgeError = PyErr_NewException ((char *) "bridge_mod.error", NULL, NULL);
Py_INCREF (BridgeError);
PyModule_AddObject (m, "error", BridgeError);
}
@ -169,14 +169,14 @@ static
struct PyModuleDef bridge_module =
{
PyModuleDef_HEAD_INIT,
"bridge_sample",
"bridge_mod",
NULL,
-1,
BridgeMethods
};
PyMODINIT_FUNC
PyInit_bridge_sample ()
PyInit_bridge_mod ()
{
PyObject *m;
@ -185,7 +185,7 @@ PyInit_bridge_sample ()
return NULL;
}
BridgeError = PyErr_NewException ((char *) "bridge_sample.error", NULL, NULL);
BridgeError = PyErr_NewException ((char *) "bridge_mod.error", NULL, NULL);
Py_INCREF (BridgeError);
PyModule_AddObject (m, "error", BridgeError);

View File

@ -29,13 +29,13 @@
}
# That's were we are going to put our Python module to
DESTDIR = $$OUT_PWD/../..
DESTDIR = $$OUT_PWD/..
# We're going to build a library
TEMPLATE = lib
# That's how we name our library
TARGET = bridge_sample
TARGET = bridge_mod
# The only source
SOURCES = \

View File

@ -8,7 +8,7 @@ SOURCES = \
HEADERS += \
LIBS += -lklayout_lay -lklayout_ext
LIBS += -lklayout_lay
# Use this opportunity to provide the __init__.py file
@ -22,9 +22,9 @@ equals(HAVE_QTBINDINGS, "1") {
INIT_PY = $$PWD/../__init__.py.noqt
}
QMAKE_POST_LINK += && $(COPY) $$INIT_PY $$DESTDIR/../pykl/__init__.py
QMAKE_POST_LINK += && $(COPY) $$INIT_PY $$DESTDIR_PYMOD/__init__.py
# INSTALLS needs to be inside a lib or app templates.
init_target.path = $$PREFIX/pykl
init_target.files += $$DESTDIR/../pykl/__init__.py
init_target.path = $$PREFIX/pymod/klayout
init_target.files += $$DESTDIR_PYMOD/__init__.py
INSTALLS += init_target

View File

@ -1,7 +1,7 @@
DESTDIR = $$OUT_PWD/..
LIBDIR = $$OUT_PWD/../..
DESTDIR_PYMOD = $$LIBDIR/pykl
DESTDIR_PYMOD = $$DESTDIR/klayout
TEMPLATE = lib
@ -26,7 +26,7 @@ win32 {
# because the library is called xyx0.dll.
CONFIG += skip_target_version_ext
lib_target.path = $$PREFIX/pykl
lib_target.path = $$PREFIX/klayout
lib_target.files += $$DESTDIR_PYMOD/$${TARGET}.dll
INSTALLS = lib_target
@ -34,7 +34,7 @@ win32 {
QMAKE_POST_LINK += $(MKDIR) $$DESTDIR_PYMOD && $(COPY) $(DESTDIR)$(TARGET) $$DESTDIR_PYMOD/$${TARGET}.so
lib_target.path = $$PREFIX/pykl
lib_target.path = $$PREFIX/klayout
lib_target.files += $$DESTDIR_PYMOD/$${TARGET}.so
INSTALLS = lib_target

View File

@ -1,7 +1,7 @@
DESTDIR_UT = $$OUT_PWD/../..
TARGET = bd_tests
TARGET = pymod_tests
include($$PWD/../../klayout.pri)
include($$PWD/../../lib_ut.pri)
@ -11,10 +11,10 @@ SOURCES = \
DEFINES += \
PYTHON=$$PYTHON \
PYTHONPATH=$$DESTDIR_UT
PYTHONPATH=$$DESTDIR_UT/pymod
INCLUDEPATH += $$BD_INC $$DB_INC $$TL_INC $$GSI_INC
DEPENDPATH += $$BD_INC $$DB_INC $$TL_INC $$GSI_INC
INCLUDEPATH += $$DB_INC $$TL_INC $$GSI_INC
DEPENDPATH += $$DB_INC $$TL_INC $$GSI_INC
LIBS += -L$$DESTDIR_UT -lklayout_bd -lklayout_db -lklayout_tl -lklayout_gsi
LIBS += -L$$DESTDIR_UT -lklayout_db -lklayout_tl -lklayout_gsi

View File

@ -355,6 +355,20 @@ main_cont (int &argc, char **argv)
pya::PythonInterpreter::initialize ();
gsi::initialize_external ();
// NOTE: we need an application object, but we don't call parse_cmd. This makes the object
// behave neutral as far as possible.
lay::GuiApplication app (argc, argv);
app.init_app ();
app.ruby_interpreter ().push_console (&console);
app.python_interpreter ().push_console (&console);
app.autorun ();
#if QT_VERSION < 0x050000
QTextCodec::setCodecForTr (QTextCodec::codecForName ("utf8"));
#endif
// Search and initialize plugin unit tests
QStringList name_filters;
@ -395,20 +409,6 @@ main_cont (int &argc, char **argv)
throw tl::Exception ("No test libraries found - make sure, the *.ut files are next to the ut_runner executable.");
}
// NOTE: we need an application object, but we don't call parse_cmd. This makes the object
// behave neutral as far as possible.
lay::GuiApplication app (argc, argv);
app.init_app ();
app.ruby_interpreter ().push_console (&console);
app.python_interpreter ().push_console (&console);
app.autorun ();
#if QT_VERSION < 0x050000
QTextCodec::setCodecForTr (QTextCodec::codecForName ("utf8"));
#endif
bool editable = false, non_editable = false;
bool gsi_coverage = false;
std::vector<std::string> class_names;

View File

@ -1,8 +1,8 @@
INCLUDEPATH += $$TL_INC $$GSI_INC $$DB_INC $$RDB_INC $$LYM_INC $$LAYBASIC_INC $$LAY_INC $$ANT_INC $$IMG_INC $$EDT_INC $$EXT_INC $$LIB_INC $$RBA_INC $$PYA_INC $$VERSION_INC
DEPENDPATH += $$TL_INC $$GSI_INC $$DB_INC $$RDB_INC $$LYM_INC $$LAYBASIC_INC $$LAY_INC $$ANT_INC $$IMG_INC $$EDT_INC $$EXT_INC $$LIB_INC $$RBA_INC $$PYA_INC $$VERSION_INC
INCLUDEPATH += $$TL_INC $$GSI_INC $$DB_INC $$RDB_INC $$LYM_INC $$LAYBASIC_INC $$LAY_INC $$ANT_INC $$IMG_INC $$EDT_INC $$LIB_INC $$RBA_INC $$PYA_INC $$VERSION_INC
DEPENDPATH += $$TL_INC $$GSI_INC $$DB_INC $$RDB_INC $$LYM_INC $$LAYBASIC_INC $$LAY_INC $$ANT_INC $$IMG_INC $$EDT_INC $$LIB_INC $$RBA_INC $$PYA_INC $$VERSION_INC
LIBS += $$PYTHONLIBFILE $$RUBYLIBFILE -L$$DESTDIR -lklayout_tl -lklayout_gsi -lklayout_db -lklayout_rdb -lklayout_lym -lklayout_laybasic -lklayout_lay -lklayout_ant -lklayout_img -lklayout_edt -lklayout_ext -lklayout_lib
LIBS += $$PYTHONLIBFILE $$RUBYLIBFILE -L$$DESTDIR -lklayout_tl -lklayout_gsi -lklayout_db -lklayout_rdb -lklayout_lym -lklayout_laybasic -lklayout_lay -lklayout_ant -lklayout_img -lklayout_edt -lklayout_lib
# Note: this accounts for UI-generated headers placed into the output folders in
# shadow builds:

View File

@ -16,8 +16,8 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import pykl.db as db
import bridge_sample as bridge
import klayout.db as db
import bridge_mod as bridge
import unittest
import sys

View File

@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import pykl.QtCore as QtCore
import klayout.QtCore as QtCore
import unittest
import sys

View File

@ -16,8 +16,8 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import pykl.QtCore as QtCore
import pykl.QtDesigner as QtDesigner
import klayout.QtCore as QtCore
import klayout.QtDesigner as QtDesigner
import unittest
import sys

View File

@ -16,8 +16,8 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import pykl.QtCore
import pykl.QtGui as QtGui
import klayout.QtCore
import klayout.QtGui as QtGui
import unittest
import sys

View File

@ -16,10 +16,10 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import pykl.QtCore as QtCore
import pykl.QtGui as QtGui
import pykl.QtWidgets as QtWidgets
import pykl.QtMultimedia as QtMultimedia
import klayout.QtCore as QtCore
import klayout.QtGui as QtGui
import klayout.QtWidgets as QtWidgets
import klayout.QtMultimedia as QtMultimedia
import unittest
import sys

View File

@ -16,8 +16,8 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import pykl.QtCore as QtCore
import pykl.QtNetwork as QtNetwork
import klayout.QtCore as QtCore
import klayout.QtNetwork as QtNetwork
import unittest
import sys

View File

@ -16,10 +16,10 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import pykl.QtCore as QtCore
import pykl.QtGui as QtGui
import pykl.QtWidgets as QtWidgets
import pykl.QtPrintSupport as QtPrintSupport
import klayout.QtCore as QtCore
import klayout.QtGui as QtGui
import klayout.QtWidgets as QtWidgets
import klayout.QtPrintSupport as QtPrintSupport
import unittest
import sys

View File

@ -16,8 +16,8 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import pykl.QtCore as QtCore
import pykl.QtSql as QtSql
import klayout.QtCore as QtCore
import klayout.QtSql as QtSql
import unittest
import sys

View File

@ -16,10 +16,10 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import pykl.QtCore as QtCore
import pykl.QtGui as QtGui
import pykl.QtWidgets as QtWidgets
import pykl.QtSvg as QtSvg
import klayout.QtCore as QtCore
import klayout.QtGui as QtGui
import klayout.QtWidgets as QtWidgets
import klayout.QtSvg as QtSvg
import unittest
import sys

View File

@ -16,9 +16,9 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import pykl.QtCore as QtCore
import pykl.QtGui as QtGui
import pykl.QtWidgets as QtWidgets
import klayout.QtCore as QtCore
import klayout.QtGui as QtGui
import klayout.QtWidgets as QtWidgets
import unittest
import sys

View File

@ -16,8 +16,8 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import pykl.QtCore as QtCore
import pykl.QtXml as QtXml
import klayout.QtCore as QtCore
import klayout.QtXml as QtXml
import unittest
import sys

View File

@ -16,8 +16,8 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import pykl.QtCore as QtCore
import pykl.QtXmlPatterns as QtXmlPatterns
import klayout.QtCore as QtCore
import klayout.QtXmlPatterns as QtXmlPatterns
import unittest
import sys

View File

@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import pykl.db as db
import klayout.db as db
import unittest
import sys

View File

@ -16,11 +16,11 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import pykl.QtCore
import pykl.QtGui
if not "QApplication" in pykl.QtGui.__all__:
import pykl.QtWidgets # Qt5
import pykl.lay as lay
import klayout.QtCore
import klayout.QtGui
if not "QApplication" in klayout.QtGui.__all__:
import klayout.QtWidgets # Qt5
import klayout.lay as lay
import unittest
import sys

View File

@ -16,8 +16,8 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import pykl.db as db
import pykl.lay as lay
import klayout.db as db
import klayout.lay as lay
import unittest
import sys

View File

@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import pykl.rdb as rdb
import klayout.rdb as rdb
import unittest
import sys

View File

@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import pykl.tl as tl
import klayout.tl as tl
import unittest
import sys