jython-2.5

Python full path import not working across branches in package tree

和自甴很熟 提交于 2019-12-25 03:05:21
问题 I have the following project structure: Project - GUI - ...Modules - Data - Database - ...Modules - Files - ...Modules - Utilities - ...Modules And I am trying to do some imports over package borders, for example: in the file(Module) Project.Database.dbdriver I try to import Project.Utilities.Conversions . If I use a fully specified import like import Project.Utilities.Conversions this fails, it works with import Utilities.Conversions , i.e. I can not specify more off the path than those part

setting import module path in Jython - strange behavior

半世苍凉 提交于 2019-12-21 05:20:05
问题 I'm building Java to Jython bridge class. The task I'm trying to solve is to make Jython to look for python modules in my application working directory (also known as program execution directory). I'm doing so by appending System.getProperty("user.dir") value to the sys.path: pySysState = new PySystemState(); //add working directory into sys.path pySysState.path.append(new PyString(System.getProperty("user.dir"))); log_.info("Jython sys state initialized. sys.path: " + this.pySysState.path);

Monkeyrunner throwing “ShellCommandUnrespo​nsiveException” - any work around?

旧时模样 提交于 2019-12-13 02:31:14
问题 I am facing some issues in device.shell('ping -c 2 192.168.1.1') inside a monkeyrunner script. Its throwing ShellCommandUnrespo‌​nsiveException [main] [com.android.chimpchat.adb.AdbChimpDevice]com.android.ddmlib.ShellCommandUnrespo‌​nsiveException while (count<1000) : device.shell('dmesg -c') print '****swithing OFF wifi in loop NO-',count device.touch(400,155,MonkeyDevice.DOWN_AND_UP) time.sleep(10) print '****switching ON wifi in loop NO-',count device.touch(400,155,MonkeyDevice.DOWN_AND_UP

Jython : Issues executing XSLT

家住魔仙堡 提交于 2019-12-11 15:03:40
问题 Ignoring identation, below Jython code when executed from command line produces, output with self-closing tags(No data), as shown in the picture below from java.io import * import javax.xml from java.io import StringReader, StringWriter from javax.xml.transform import Transformer, TransformerFactory from javax.xml.transform.stream import StreamResult, StreamSource def obtainservicexslts(): print "In obtainservicexslts" print source_xform_xml = """<?xml version='1.0' encoding='UTF-8'?>

How to unittest unittest TestCases

点点圈 提交于 2019-12-10 21:17:22
问题 I have a unittest.TestCase child, which defines several domain specific assert Checks. I would like to run some unittests to unittest this functionality to control that everything work on future updates. class MyBaseTestCase(unittest.TestCase): def setUp(self): ... def tearDown(self): ... def run(self, result): ... def assertSpec(self, condition, message): ... I want to instantiate MyBaseTestCase in other unit test, like this: class TestBase(unittest.TestCase): def test_assertSpec(self): self

IndexError: index out of range: 7

匆匆过客 提交于 2019-12-10 14:34:20
问题 I am working with an Oracle EPM Product called Financial Data Quality Management Enterprise Edition (FDMEE). I have written a Jython script to parse a data file and push it to a custom table within the FDMEE product schema. It works fine when I am pushing a subset of data file. But when I parse the entire data file, it fails with the error IndexError: index out of range: 7. Following is the error message I receive : File "\\vmhodvesip4\D$\SVESI7\Custom\FDMEEApps\BFRVN/data/scripts/event

setting import module path in Jython - strange behavior

人盡茶涼 提交于 2019-12-03 16:21:24
I'm building Java to Jython bridge class. The task I'm trying to solve is to make Jython to look for python modules in my application working directory (also known as program execution directory). I'm doing so by appending System.getProperty("user.dir") value to the sys.path: pySysState = new PySystemState(); //add working directory into sys.path pySysState.path.append(new PyString(System.getProperty("user.dir"))); log_.info("Jython sys state initialized. sys.path: " + this.pySysState.path); I get ImportError exception: python module 'user_module' was not found. sys.path: ['<other jars>\\Lib',

Jython easy_install error

我们两清 提交于 2019-12-02 15:01:30
问题 My purpose to add some python libraries to jython i.e suds package To do this tried to follow the instruction from http://www.jython.org/jythonbook/en/1.0/appendixA.html#setuptools and also checked; How can I install various Python libraries in Jython? Installed Jython 2.5.2 and added JYTHON_HOME=C:\jyhon252 to environment variables and %JYTHON_HOME%\bin to path jython is working fine. As second step tried to install easy_install on top of Jython 2.5.2 got ez_setup.py from; http://peak

Issues understanding how to use Jython

谁都会走 提交于 2019-12-01 08:28:40
I've just started learning Jython, and I'm having some issues with implementation. I've looked through the Demo files that come with Jython 2.5, and I'm still unsure how to implement Jython to get what I want. Currently, I've got Java code executing a Python server as a Process. The Python server in turn starts a second section of Java code as a subprocess. I was originally going to replace the Python server with a Java NIO server, but that's given me no end of grief, and thus why I'm trying Jython. I also want to get all of this into a .jar. I tried making a simple Python file ( print "Hello

Issues understanding how to use Jython

雨燕双飞 提交于 2019-12-01 07:10:29
问题 I've just started learning Jython, and I'm having some issues with implementation. I've looked through the Demo files that come with Jython 2.5, and I'm still unsure how to implement Jython to get what I want. Currently, I've got Java code executing a Python server as a Process. The Python server in turn starts a second section of Java code as a subprocess. I was originally going to replace the Python server with a Java NIO server, but that's given me no end of grief, and thus why I'm trying