]> gerrit.simantics Code Review - simantics/python.git/log
simantics/python.git
7 years agoSupport for output and exceptions without tracebacks 19/319/3
Reino Ruusu [Wed, 1 Feb 2017 19:17:18 +0000 (21:17 +0200)]
Support for output and exceptions without tracebacks

Added a redundant implementation of SCLReportingWriter for backward
compatibility.
Added support for a user-provided Writer object in
executePythonStatement.
Moved instantiation of SCLReportingWriter to Java.
Added support for sys.stdout.flush() in Python.

Change-Id: Icf53ed000844d136b93aa86f7bf41db3559f8748

7 years agoAdd missing PythonCompatible instances. 21/321/1
tkorvola [Thu, 2 Feb 2017 11:01:37 +0000 (13:01 +0200)]
Add missing PythonCompatible instances.

Boolean and Long were missing, also Vectors of them.

Change-Id: I8af943c78924721fb281a66b468f0dfbe530a7a2

7 years agoMind the threads in writeSCL. 18/318/1
tkorvola [Wed, 1 Feb 2017 17:48:01 +0000 (19:48 +0200)]
Mind the threads in writeSCL.

Both JNIEnv and PyThreadState are per thread.  So check that we are
in the main thread before messing with JNIEnv.  Writes from other
threads (possibly created in Python) are just dropped; those seem
difficult to do right.

Also unlock GIL while calling the Java method.

Change-Id: I49a447e22ba4411800445f7149f5bc257a082e4f

7 years agoFixed merge errors. 17/317/1
Reino Ruusu [Wed, 1 Feb 2017 16:02:35 +0000 (18:02 +0200)]
Fixed merge errors.

Change-Id: Ia2c8157c0f81c7b77033a5a2477a4671fcb3ac3f

7 years agoMerge branch 'change/300/2' 16/316/1
Reino Ruusu [Wed, 1 Feb 2017 15:32:43 +0000 (17:32 +0200)]
Merge branch 'change/300/2'

Conflicts:
org.simantics.pythonlink.win32.x86_64/jnipython.dll
org.simantics.pythonlink.win32.x86_64/src/sclpy.c
org.simantics.pythonlink/src/org/simantics/pythonlink/PythonContext.java

Change-Id: I4a07bce4c1f4a0134ad774161ff79821f0d7e018

7 years agoMerge "Macro for Python installation directory." release/1.27.0
Reino Ruusu [Wed, 1 Feb 2017 13:00:21 +0000 (15:00 +0200)]
Merge "Macro for Python installation directory."

7 years agoMavenized Simantics Python bindings projects. 01/301/2
Tuukka Lehtonen [Tue, 31 Jan 2017 12:06:08 +0000 (14:06 +0200)]
Mavenized Simantics Python bindings projects.

mvn package in the root directory now generates an update site
from the org.simantics.pythonlink.feature in
org.simantics.pythonlink.repository/target/repository.

refs #6879

Change-Id: If48854ced06847d138725222106fadc5fb3c50b7

7 years agoPrint exception type name if we can't get a traceback. 00/300/2
Timo Korvola [Mon, 30 Jan 2017 15:58:18 +0000 (17:58 +0200)]
Print exception type name if we can't get a traceback.

Also decref PyErr_Fetch results.

Change-Id: I3e497d6750b08e24a9631c83a2b6e0e3c1502d79

7 years agoAll getters now use GIL as well. 99/299/1
Timo Korvola [Mon, 30 Jan 2017 14:27:13 +0000 (16:27 +0200)]
All getters now use GIL as well.

More macro madness.  Hopefully locking is now OK.

Change-Id: I3f487cc74154574032492b9dd5c4f46b27ee7a4e

7 years agoAll variable setters now use GIL. 98/298/1
Timo Korvola [Mon, 30 Jan 2017 09:13:48 +0000 (11:13 +0200)]
All variable setters now use GIL.

Most setters are now defined by a CPP macro.  It is not pretty and may
well be the ugliest way to do this except for the one it replaces.

Change-Id: I27d36bfef6252f78ee801ebbc022d6fe75a3b49c

7 years agoAdd some PyEval_{Restore,Save}Thread calls. 97/297/1
Timo Korvola [Fri, 27 Jan 2017 14:04:24 +0000 (16:04 +0200)]
Add some PyEval_{Restore,Save}Thread calls.

More are needed, but it is a mess of copy-paste programming.

Change-Id: Ie4dcc7627349cab84c37cb0b6c7275876373e25d

7 years agoUse the executor for all Python C API calls. 96/296/1
Timo Korvola [Fri, 27 Jan 2017 13:44:49 +0000 (15:44 +0200)]
Use the executor for all Python C API calls.

Change-Id: I4330f5aea0bdd4bada6c0fd24798d726df563861

7 years agoMacro for Python installation directory. 95/295/1
Timo Korvola [Thu, 26 Jan 2017 13:41:23 +0000 (15:41 +0200)]
Macro for Python installation directory.

Change-Id: I0b33d3f237075b8788a565209306527e84b05268

7 years agoPython tweaks
Reino Ruusu [Wed, 25 Jan 2017 16:51:02 +0000 (18:51 +0200)]
Python tweaks

- Changed the way context modules are created
- Allow Python to produce SCL console output

Change-Id: I41e8b876d55db8815959ebc90487c3e481f4604b

7 years agoGet Python traceback output in the messages of exceptions from the pythonlink feature.
tuorjr [Thu, 1 Dec 2016 16:31:57 +0000 (16:31 +0000)]
Get Python traceback output in the messages of exceptions from the pythonlink feature.

git-svn-id: https://www.simantics.org/svn/simantics-incubator/reino@1703 e36c2e66-7d30-0410-bdb2-d9e1f5a6d952

7 years agoRemoved unnecessary python3.dll dependency.
tuorjr [Tue, 1 Nov 2016 15:19:38 +0000 (15:19 +0000)]
Removed unnecessary python3.dll dependency.

git-svn-id: https://www.simantics.org/svn/simantics-incubator/reino@1700 e36c2e66-7d30-0410-bdb2-d9e1f5a6d952

7 years agoDeleted error logs from JVM crashes.
tuorjr [Wed, 12 Oct 2016 11:52:49 +0000 (11:52 +0000)]
Deleted error logs from JVM crashes.

git-svn-id: https://www.simantics.org/svn/simantics-incubator/reino@1696 e36c2e66-7d30-0410-bdb2-d9e1f5a6d952

7 years agoAddition of null value check to getPythonObject()
tuorjr [Tue, 11 Oct 2016 10:56:12 +0000 (10:56 +0000)]
Addition of null value check to getPythonObject()
Test with new databoard SCL functionality

git-svn-id: https://www.simantics.org/svn/simantics-incubator/reino@1695 e36c2e66-7d30-0410-bdb2-d9e1f5a6d952

7 years agoAdded support for dynamically typed data access and a Variable interface.
tuorjr [Tue, 4 Oct 2016 16:22:17 +0000 (16:22 +0000)]
Added support for dynamically typed data access and a Variable interface.
Note: Proper function of the Variable interface depends on enhancement #6738.

git-svn-id: https://www.simantics.org/svn/simantics-incubator/reino@1694 e36c2e66-7d30-0410-bdb2-d9e1f5a6d952

7 years agoAdded C source code for the DLL and a CDT project aspect for compiling it.
tuorjr [Wed, 28 Sep 2016 10:16:20 +0000 (10:16 +0000)]
Added C source code for the DLL and a CDT project aspect for compiling it.

git-svn-id: https://www.simantics.org/svn/simantics-incubator/reino@1693 e36c2e66-7d30-0410-bdb2-d9e1f5a6d952

7 years agoSome changes to Python.scl.
tuorjr [Wed, 28 Sep 2016 10:14:22 +0000 (10:14 +0000)]
Some changes to Python.scl.

git-svn-id: https://www.simantics.org/svn/simantics-incubator/reino@1692 e36c2e66-7d30-0410-bdb2-d9e1f5a6d952

7 years agoAdded lauchers for test cases.
tuorjr [Mon, 26 Sep 2016 15:55:11 +0000 (15:55 +0000)]
Added lauchers for test cases.

git-svn-id: https://www.simantics.org/svn/simantics-incubator/reino@1691 e36c2e66-7d30-0410-bdb2-d9e1f5a6d952

7 years agoSome fixes to Python integration.
tuorjr [Mon, 26 Sep 2016 15:44:59 +0000 (15:44 +0000)]
Some fixes to Python integration.

git-svn-id: https://www.simantics.org/svn/simantics-incubator/reino@1690 e36c2e66-7d30-0410-bdb2-d9e1f5a6d952

7 years agoInitial commit of Python Integration feature.
tuorjr [Mon, 26 Sep 2016 15:33:15 +0000 (15:33 +0000)]
Initial commit of Python Integration feature.

git-svn-id: https://www.simantics.org/svn/simantics-incubator/reino@1689 e36c2e66-7d30-0410-bdb2-d9e1f5a6d952

9 years agogit-svn-id: https://www.simantics.org/svn/simantics-incubator/reino@1627 e36c2e66...
tuorjr [Tue, 24 Nov 2015 10:25:22 +0000 (10:25 +0000)]
git-svn-id: https://www.simantics.org/svn/simantics-incubator/reino@1627 e36c2e66-7d30-0410-bdb2-d9e1f5a6d952