[x3d-public] X3D python language binding, pyjnius validation

John Carlson yottzumm at gmail.com
Tue Apr 9 06:12:22 PDT 2019


Here’s what the documentation says:

https://pyjnius.readthedocs.io/en/stable/api.html

“If a classpath is set with these functions, it overrides any CLASSPATH environment variable. Multiple options or path entries should be supplied as multiple arguments to the add_ and set_functions. If no classpath is provided and CLASSPATH is not set, the path defaults to ‘.’. This functionality is not available on Android.”

Well, I set CLASSPATH, so there’s likely some problem with how we are setting CLASSPATH?  IDK, I’ve tried a couple of ways.  What we could do is the absolute path to pyjnius in the PYTHONPATH, then append ../../../jars/X3DJSAIL.jar (not fully specified) to it.

Another thing we might try is outputting the CLASSPATH variable from Ant to a configuration file, then reading that file in autoclass.py and X3Dautoclass.py.

What do you think is best?  What’s least confusing?  Why can’t pyjnius work as is documented?

Sent from Mail for Windows 10

From: John Carlson
Sent: Tuesday, April 9, 2019 7:59 AM
To: Brutzman, Donald (Don) (CIV)
Cc: X3D Graphics public mailing list
Subject: RE: X3D python language binding, pyjnius validation

I must be an idiot user.  No luck removing set_classpath.  You would think that by default, pyjnius would grab the CLASSPATH from the environment.

Hmm.

John

Sent from Mail for Windows 10

From: John Carlson
Sent: Tuesday, April 9, 2019 7:50 AM
To: Brutzman, Donald (Don) (CIV)
Cc: X3D Graphics public mailing list
Subject: RE: X3D python language binding, pyjnius validation

How well is setting CLASSPATH environmental variable working for you?   I couldn’t get that to work with pyjnius, I think pyjnius has it’s own internal setting.   That’s what I’ve gotten working. Please examine last few lines of autoclass.py to add your changes to classpath. I haven’t found the perfect solution, but I suggest we grab the CLASSPATH from the environment in autoclass.py and use that value to split and send to jnius_config.set_classpath, if we can spread out an array to arguments to set_classpath.

Here’s what appears possible.  Note that Android users will have to do something different.

https://stackoverflow.com/questions/41353826/how-to-use-my-java-class-in-kivy-app-using-kivy-launcher

Note that setting the classpath in autoclass.py overrides any attempt to set a CLASSPATH external or internal to ant.  I believe that’s mentioned in links off the above one.

Yes, I have tried getting rid of the setting in autoclass.py and X3Dautoclass.py, and can try again setting a external CLASSPATH if you like. Let me know.  Or try to duplicate the problem.  I really don’t like setting the CLASSPATH in python, but it will help idiot users who really want to set their CLASSPATH and we don’t know their system looks like.

I think I’ll try again.

John
Sent from Mail for Windows 10

From: John Carlson
Sent: Tuesday, April 9, 2019 7:28 AM
To: Brutzman, Donald (Don) (CIV)
Cc: X3D Graphics public mailing list
Subject: RE: X3D python language binding, pyjnius validation

I updated X3Dautoclass.py in svn.   Should not have any effect on standard build, if you’ve done it. Changes from autoclass.py should already be there from a previous checkout and build.

John




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20190409/02864573/attachment-0001.html>


More information about the x3d-public mailing list