#jython IRC Log (v0.9)


IRC Log for 2014-12-02

Timestamps are in GMT/BST.

[0:00] <icecreamcohen> so this isn???t right? http://search.maven.org/#artifactdetails%7Corg.python%7Cjython-standalone%7C2.7-b3%7Cjar
[0:01] <jimbaker> icecreamcohen, sorry we did post it - http://mvnrepository.com/artifact/org.python/jython-standalone
[0:01] <jimbaker> so that search looks right
[0:01] <jimbaker> but that's something we built
[0:02] <icecreamcohen> ah, here???s the error: taskdef A class needed by class org.python.util.JycompileAntTask cannot be found: org/python/apache/tools/ant/taskdefs/MatchingTask
[0:04] <jimbaker> so maybe that's the old ant version problem i mentioned? i'm running a relatively recent ant (1.9.3) but i know earlier ants will not work
[0:04] <icecreamcohen> I???m actually using gradle.
[0:04] <jimbaker> not certain when the cutoff is
[0:04] <icecreamcohen> I don???t see that class in the .jar file that I downloaded
[0:06] <jimbaker> icecreamcohen, you could try looking at this gradle script - https://github.com/rackerlabs/keystone-jvm
[0:06] <jimbaker> i'm not familiar with gradle, but my colleague put this together for our work on running openstack keystone on jython
[0:07] <icecreamcohen> ah, that compiles in a completely different way than mine.
[0:07] * icecreamcohen mine does this:
[0:07] <icecreamcohen> ant.taskdef(name: 'pycompile', classname: 'org.python.util.JycompileAntTask', classpath: configurations.compile.asPath)
[0:07] <icecreamcohen> ant.pycompile(srcDir: 'src/python', destDir: project.pythonOutputDir, includes: "**/*.py")
[0:07] <icecreamcohen> it directly calls the ant task.
[0:07] <icecreamcohen> This looks like it goes through jython itself.
[0:11] <jimbaker> icecreamcohen, yes, it has too
[0:11] <jimbaker> to
[0:11] <icecreamcohen> not before ;p
[0:11] <jimbaker> basically this is task is used to compile the stdlib
[0:11] <icecreamcohen> the ant task worked fine.
[0:11] <icecreamcohen> this *also* works
[0:11] <icecreamcohen> and in 2.7-b3 to boot.
[0:12] <icecreamcohen> jimbaker, you???ve been a tremendous help today.
[0:12] <jimbaker> hmmm, i'm just not seeing the same problem i guess
[0:12] <jimbaker> icecreamcohen, yeah, fun helping you out!
[0:12] <icecreamcohen> well, I???m glad I???m not a burden.
[0:13] <icecreamcohen> I hate asking questions on IRC
[0:19] <icecreamcohen> ok, jimbaker ???I???ll come back and update you on my findings with gettext. Thanks for the help!
[0:19] <jimbaker> icecreamcohen, sounds great!
[0:20] * fwierzbicki (~Adium@99-106-169-5.lightspeed.sntcca.sbcglobal.net) Quit (Quit: Leaving.)
[0:20] * fwierzbicki (~Adium@99-106-169-5.lightspeed.sntcca.sbcglobal.net) has joined #jython
[1:17] * tactevo (~tactevo@c-24-6-253-119.hsd1.ca.comcast.net) Quit (Quit: tactevo)
[2:01] * smaudet (~smaudet@cpe-98-28-40-92.columbus.res.rr.com) has joined #jython
[2:09] * ohumbel (5390f784@gateway/web/freenode/ip. Quit (Ping timeout: 246 seconds)
[2:12] * icecreamcohen (~stevecohe@808.pinadmin.com) Quit (Ping timeout: 252 seconds)
[7:38] * Arfrever (~Arfrever@apache/committer/Arfrever) Quit (Ping timeout: 258 seconds)
[7:46] * ohumbel (5390f784@gateway/web/freenode/ip. has joined #jython
[11:23] * ohumbel (5390f784@gateway/web/freenode/ip. Quit (Ping timeout: 246 seconds)
[12:38] * ohumbel (5390f784@gateway/web/freenode/ip. has joined #jython
[12:59] * smaudet (~smaudet@cpe-98-28-40-92.columbus.res.rr.com) Quit (Ping timeout: 255 seconds)
[13:41] * smaudet (~smaudet@206-51-157-254.nktelco.net) has joined #jython
[13:51] * smaudet (~smaudet@206-51-157-254.nktelco.net) Quit (Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/)
[15:03] * mike_af (~mike_af@unaffiliated/mike-af/x-5454762) has joined #jython
[15:09] * xemdetia (xemdetia@nat/ibm/x-zyofcqxjkxtfynzy) has joined #jython
[15:33] * mike_af (~mike_af@unaffiliated/mike-af/x-5454762) Quit (Quit: Leaving...)
[15:52] * Arfrever (~Arfrever@apache/committer/Arfrever) has joined #jython
[16:30] * jeffg (~jeffg@pdpc/supporter/professional/jeffg) has joined #jython
[16:31] <jeffg> hi, i'm pretty experienced with java but less so with python and jython. i need to import a site module in my jython script but can't seem to find how to tell jython where to look for it. any tips?
[16:33] <jeffg> can i stick it in a jar and add that to my classpath?
[16:45] * siel (~siel@unaffiliated/motley) Quit (Ping timeout: 258 seconds)
[16:59] * siel (~siel@unaffiliated/motley) has joined #jython
[17:03] <agronholm> jeffg: import a site module?
[17:03] <agronholm> what's that mean? site.py?
[17:03] <jeffg> agronholm, i mean a module in /usr/lib/python-2.7/site-packages
[17:04] <jeffg> agronholm, i've just found sys.path and appended that to it. progress, but still not quite there.
[17:04] <agronholm> a module = a single .py file
[17:04] <jeffg> i'm trying: from foo.bar.baz import quux
[17:05] <agronholm> ok, just package foo/bar/baz in a jar and add it to the class path
[17:06] <jeffg> initially i got "ImportError: no module named foo". now after appending to sys.path i get "ImportError: no module named baz"
[17:06] <jeffg> agronholm, if possible i really want to use the module where it lies, since it's installed from an RPM and i want to use updated versions of it as they come online.
[17:07] <agronholm> perhaps I misunderstood your scenario
[17:07] <agronholm> if you installed that thing with pip as normal, it would be directly importable
[17:08] <agronholm> no sys.path manipulation required
[17:09] <jeffg> agronholm, i'm in a client's environment here so need to conform to their conventions. and i don't really know about pip, sorry. not much python experience here.
[17:09] <jeffg> the client has lots of python but no jython
[17:10] <agronholm> oh I see, you're trying to use site-packages from a different python
[17:10] <agronholm> that might be a problem
[17:10] <jeffg> agronholm, yes, from a jython actually. i don't think any of the module needs cpython.
[17:10] <agronholm> it depends on how the packages are laid out from the RPM install
[17:11] <jeffg> also, the jython i'm using (installed from rpm also) is pretty creaky: 2.2.1
[17:11] <agronholm> eww
[17:11] <agronholm> not going to touch that
[17:11] <jeffg> i'd rather use latest, but i'm hitting the "Exception in thread "main" ImportError: No module named site" problem on this server.
[17:12] <agronholm> what jar did you download then?
[17:12] <jeffg> 2.7-b3... just realized that's probably not released, i grabbed it from maven-central
[17:13] <jeffg> grabbing 2.5.3 to try. thanks for helping me notice that :)
[17:15] <jeffg> that one starts up just fine! but i still get the "No module named baz" problem :(
[17:18] <jeffg> agronholm, here's the layout -- just changed the first path element to "foo": http://paste.lisp.org/display/144557
[17:18] <jeffg> so the real message is ImportError: No module named client
[17:19] <jeffg> and i'm doing "from foo.api.client import http"
[17:20] <agronholm> does "from foo import api" work?
[17:21] <jeffg> yes
[17:21] <agronholm> and does api.__file__ give the correct path?
[17:22] <agronholm> are there no __init__.py files in foo/ or foo/api/ ?
[17:24] <jeffg> agronholm, annotated the paste with the whole foo/ tree
[17:25] <agronholm> I don't see an __init__.py in foo/
[17:25] <agronholm> nor in foo/api/
[17:25] <agronholm> so I'm guessing they're namespace packages
[17:25] <jeffg> i think so, yes
[17:25] <agronholm> they require special handling in python <3.2
[17:26] <agronholm> simply adding them to sys.path won't cut it
[17:26] <agronholm> this is why packages should be properly installed
[17:26] <jeffg> works fine in cpython 2.7.5
[17:26] <agronholm> yes because that's the site-packages directory for that python
[17:27] <agronholm> but you're trying to use the site-packages directory from a different python installation
[17:27] <agronholm> (with jython)
[17:27] <agronholm> and jython doesn't know that they're namespace packages because it hasn't been told that this is a site-packages directory
[17:27] <jeffg> sad panda
[17:27] <jeffg> can i somehow tell it that it is one?
[17:28] <agronholm> https://docs.python.org/2.6/library/site.html#site.addsitedir
[17:28] <agronholm> check that out
[17:29] <jeffg> checking, thanks
[17:30] <agronholm> you're probably better off with python 2.7b3 than 2.5.3
[17:30] <agronholm> both have their share of issues but 2.5.3 has more bugs iirc
[17:32] <jeffg> 2.7-b3 blows up on startup with that "no module named site" thing.
[17:34] <jeffg> agronholm, thanks for your help. i'm thinking this is turning into a rabbit-hole so considering other directions for the time being.
[17:34] <agronholm> jeffg: which jar did you download? how are you starting it up?
[17:35] <jeffg> agronholm, http://search.maven.org/remotecontent?filepath=org/python/jython/2.5.3/jython-2.5.3.jar started with "java -jar jython-2.5.3.jar"
[17:36] <jeffg> this is a JSR-223 (javax.scripting) thing i'm working on
[17:37] <agronholm> that jar doesn't contain the standard library
[17:37] <agronholm> go to jython.org and see the download page
[17:37] <agronholm> it should be clear enough what to get
[17:38] <jeffg> maybe jython-standalone?
[17:41] <agronholm> indeed
[17:41] <agronholm> if you want something that can be launched from the command line, you'll want the regular installer
[17:41] <agronholm> but for JSR-223 you'd want the standalone
[17:45] <jeffg> ok, good to know. i'm going to pivot to javascript for the moment, since the api this module exposes is json under the sheets and i really need to show some forward movement.
[17:46] <jeffg> i really wanted to use jython since the client is big on python and that would be good for maintainability, but time is a resource.
[17:49] <agronholm> so you have some big java app and you wanted to give a python interface for it...?
[17:50] * siel (~siel@unaffiliated/motley) Quit (Ping timeout: 272 seconds)
[17:51] * siel (~siel@2605:6400:10:c07c:4231:4321:2341:2031) has joined #jython
[17:51] * siel (~siel@2605:6400:10:c07c:4231:4321:2341:2031) Quit (Changing host)
[17:51] * siel (~siel@unaffiliated/motley) has joined #jython
[18:16] <jeffg> agronholm, actually it's a rather compact java app whose job is to feed a considerably larger java app
[18:52] <agronholm> jeffg: wouldn't it be easier to write it in python then?
[18:52] <agronholm> or does the interface require java?
[19:03] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Quit: Konversation terminated!)
[19:07] * fwierzbicki (~Adium@99-106-169-5.lightspeed.sntcca.sbcglobal.net) Quit (Quit: Leaving.)
[19:34] * fwierzbicki (~Adium@2600:1010:b02f:4e19:d531:4067:f22a:cb20) has joined #jython
[19:35] * siel (~siel@unaffiliated/motley) Quit (Ping timeout: 258 seconds)
[19:36] * fwierzbicki1 (~Adium@188.sub-70-197-10.myvzw.com) has joined #jython
[19:39] * fwierzbicki (~Adium@2600:1010:b02f:4e19:d531:4067:f22a:cb20) Quit (Ping timeout: 258 seconds)
[19:42] * siel (~siel@unaffiliated/motley) has joined #jython
[20:01] * mbooth (~mbooth@redhat/mbooth) Quit (Ping timeout: 250 seconds)
[20:03] * siel (~siel@unaffiliated/motley) Quit (Remote host closed the connection)
[20:15] * mbooth (~mbooth@cpc68386-shef10-2-0-cust10.17-1.cable.virginm.net) has joined #jython
[20:15] * mbooth (~mbooth@cpc68386-shef10-2-0-cust10.17-1.cable.virginm.net) Quit (Changing host)
[20:15] * mbooth (~mbooth@redhat/mbooth) has joined #jython
[20:31] * AndyBotwin (~botwin@ has joined #jython
[20:31] * AndyBotwin (~botwin@ Quit (Changing host)
[20:31] * AndyBotwin (~botwin@unaffiliated/andybotwin) has joined #jython
[21:03] * siel (~siel@unaffiliated/motley) has joined #jython
[21:12] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[21:17] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Read error: Connection reset by peer)
[22:22] * fwierzbicki1 (~Adium@188.sub-70-197-10.myvzw.com) Quit (Quit: Leaving.)
[22:31] * fwierzbicki (~Adium@99-106-169-5.lightspeed.sntcca.sbcglobal.net) has joined #jython
[22:59] * siel (~siel@unaffiliated/motley) Quit (Ping timeout: 258 seconds)
[23:00] * siel (~siel@unaffiliated/motley) has joined #jython
[23:05] * mbooth (~mbooth@redhat/mbooth) Quit (Ping timeout: 244 seconds)
[23:17] * xemdetia (xemdetia@nat/ibm/x-zyofcqxjkxtfynzy) Quit (Ping timeout: 245 seconds)
[23:21] * mbooth (~mbooth@cpc68386-shef10-2-0-cust10.17-1.cable.virginm.net) has joined #jython
[23:21] * mbooth (~mbooth@cpc68386-shef10-2-0-cust10.17-1.cable.virginm.net) Quit (Changing host)
[23:21] * mbooth (~mbooth@redhat/mbooth) has joined #jython
[23:38] * Arfrever (~Arfrever@apache/committer/Arfrever) Quit (Ping timeout: 264 seconds)
[23:59] <paolo> >>> from foobaz.building import Building
[23:59] <paolo> >>> Building()
[23:59] <paolo> org.python.proxies.foobaz.building$Building$0@2d740e2c
[23:59] <paolo> why is printed that stuff to the console?


These logs were automatically created by JythonLogBot_ on irc.freenode.net using a slightly modified version of the Java IRC LogBot (github).