#jython IRC Log (v0.9)

Index

IRC Log for 2011-05-18

Timestamps are in GMT/BST.

[0:45] * plankton (~kvirc@201-14-52-39.cscgo701.dsl.brasiltelecom.net.br) has joined #jython
[1:08] * plankton (~kvirc@201-14-52-39.cscgo701.dsl.brasiltelecom.net.br) Quit (Quit: KVIrc 4.0.2 Insomnia http://www.kvirc.net/)
[1:58] * lopex (lopex@84-10-213-252.dynamic.chello.pl) Quit ()
[4:09] * pr3d4t0r (~zhenya01@varenka.cime.net) Quit (*.net *.split)
[4:12] * pr3d4t0r (~zhenya01@varenka.cime.net) has joined #jython
[5:22] <fwierzbicki> pjenvey: since you offered hg help - I would have preferred to commit those last 6 commits as one big commit - it was developed in a clone of my local trunk copy - then I merged to my local trunk and pushed.
[5:23] <fwierzbicki> what's the nicest way to take a clone and clean it up into one commit on hg?
[5:24] <fwierzbicki> a link and an RTFM is totally fine BTW :)
[5:50] * Malkil (473be888@gateway/web/freenode/ip.71.59.232.136) Quit (Ping timeout: 252 seconds)
[6:54] * thobe (~Adium@c83-249-235-76.bredband.comhem.se) Quit (Quit: Leaving.)
[7:13] * thobe (~Adium@212-162-171-110.skbbip.com) has joined #jython
[8:32] * shashank (~shashank@c-98-245-87-8.hsd1.co.comcast.net) Quit (Quit: Leaving.)
[10:21] * juneau001 (~juneau@50.44.52.0) Quit (Quit: juneau001)
[10:59] * lopex (531346b2@gateway/web/freenode/ip.83.19.70.178) has joined #jython
[11:19] * juneau001 (~juneau@131.225.24.148) has joined #jython
[11:57] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Ping timeout: 240 seconds)
[12:16] * dreamcode (~alex@193.254.230.253) has joined #jython
[12:17] * dreamcode is now known as Guest20118
[12:19] * KayT3 (~KayT3@63.84.81.41) has joined #jython
[12:30] * chacara (~chacara@201.57.231.226) has joined #jython
[13:10] * cschneid (~cschneid@c-76-120-122-74.hsd1.co.comcast.net) has joined #jython
[13:11] * cschneid (~cschneid@c-76-120-122-74.hsd1.co.comcast.net) Quit (Remote host closed the connection)
[13:54] * aquarius1973 (~aquarius1@87-198-172-217.static.ptr.magnet.ie) has joined #jython
[14:09] * xmikedavis (u147@gateway/web/irccloud.com/x-afoktkcxnnhlmwur) has joined #jython
[14:42] * Guest20118 (~alex@193.254.230.253) Quit (Remote host closed the connection)
[15:31] * lopex (531346b2@gateway/web/freenode/ip.83.19.70.178) Quit ()
[15:37] * fwierzbicki (~frank@99-106-170-105.lightspeed.sntcca.sbcglobal.net) Quit (Quit: Ex-Chat)
[15:44] * fwierzbicki (~frank@99-106-170-105.lightspeed.sntcca.sbcglobal.net) has joined #jython
[15:58] * lopex (lopex@84-10-213-252.dynamic.chello.pl) has joined #jython
[16:02] * aquarius1973 (~aquarius1@87-198-172-217.static.ptr.magnet.ie) Quit (Quit: Leaving)
[16:43] * shashank (~shashank@98.245.87.8) has joined #jython
[17:12] <pjenvey> fwierzbicki - there's a couple ways of pulling that off, I recommend you try mq
[17:13] <pjenvey> it's a bit of a whole new system to learn on top of hg but it's not too difficult, it's basically like an extravagent git stash if you're familliar with that
[17:13] <pjenvey> otherwise there's the histedit extension
[17:13] <pjenvey> http://mercurial.selenic.com/wiki/HisteditExtension
[17:13] <fwierzbicki> pjenvey: I'm not but I need to learn the style - I know lots of people use mq.
[17:14] <fwierzbicki> pjenvey, in bzr land I need to learn pipes which I think is more or less the same thing.
[17:15] <agronholm> mq supports folding of commits
[17:15] <fwierzbicki> agronholm, cool another vote for mq
[17:15] <fwierzbicki> I don't want to have another ugly push like the print_function ones.
[17:15] <fwierzbicki> on the plus side "from __future__ import print_function" mostly works now
[17:16] <agronholm> nice to hear
[17:16] <fwierzbicki> which consumed about a month of my copious spare time
[17:16] <agronholm> you say mostly -- what does not work then?
[17:16] <fwierzbicki> not in the interpreter though - I'm not going in there for a while
[17:17] <fwierzbicki> I think it all works from scripts
[17:18] <fwierzbicki> parsing in interpreted mode has all sorts of ugliness that I want to look at before 2.6 final, but not until a lot of other stuff is fixed.
[17:22] <fwierzbicki> now I plan to go and pick off easy failing tests - tonight I plan to look at test_class.py
[17:33] * thobe (~Adium@212-162-171-110.skbbip.com) Quit (Quit: Leaving.)
[17:42] * raul (~raul@201.12.117.35) has joined #jython
[17:42] * raul is now known as jython-newbie
[17:44] <jython-newbie> I am trying to learn how to use python classes to make objects in Java. Can anyone help me?
[17:46] * jython-newbie (~raul@201.12.117.35) Quit (Client Quit)
[17:46] <agronholm> make objects in Java?
[17:46] * jython-newbie (~raul@201.12.117.35) has joined #jython
[17:47] <jython-newbie> Is anyone there?
[17:47] <agronholm> make objects in Java?
[17:48] <agronholm> jython-newbie: hello, are you not seeing this?
[17:49] <jython-newbie> agronholm: yes
[17:49] <agronholm> then explain please
[17:49] <jython-newbie> can I write my code here?
[17:49] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[17:49] <agronholm> please use a pastebin
[17:49] <jython-newbie> ok. just a minute
[17:50] <jython-newbie> I've writen this code here: http://codepad.org/ntAZoc8O
[17:51] <jython-newbie> My goal is to use the class "Soma" in a program made in Java
[17:51] <agronholm> that only worked in jython 2.2
[17:52] <agronholm> there is no jythonc anymore
[17:52] <agronholm> this gets asked several times a week, I wonder why it's not in a FAQ
[17:52] <jython-newbie> I am using Ubuntu 10.04... how can I change to new jython?
[17:52] <agronholm> download it and run the installer
[17:52] <jython-newbie> I've used the apt-get to download the jython
[17:52] <agronholm> yeah, so?
[17:53] <jython-newbie> another question... what's the new way to do what I am trying?
[17:54] <agronholm> can't do it that way
[17:54] <agronholm> are you running a PythonInterpreter inside a java app?
[17:55] <agronholm> or are you launching your app with Jython?
[17:57] <jimbaker> agronholm, indy will provide support for java integration (and be what clamp was going to be). but 2nd phase project, after we work on performance
[17:57] <agronholm> yeah I know
[18:00] <jython-newbie> agronholm: I'm just trying to create an object in Java using a class written in Jython.
[18:00] <agronholm> this should be in the FAQ but right now there is no FAQ at all anywhere for what I can see
[18:00] <agronholm> err wait
[18:00] <agronholm> jython-newbie: http://wiki.python.org/jython/JythonFaq/EmbeddingJython#How_can_I_use_jython_classes_from_my_java_application.3F
[18:00] <fwierzbicki> jython-newbie, http://www.jython.org/jythonbook/en/1.0/JythonAndJavaIntegration.html#using-jython-within-java-applications
[18:01] <jython-newbie> agronholm: I think I have to jythons installed here. But I can use the 2.2 from any directory, but I don't how to use the jynthonc from 2.5.2
[18:01] <fwierzbicki> jython-newbie, and http://www.jython.org/jythonbook/en/1.0/JythonAndJavaIntegration.html#using-java-within-jython-applications
[18:01] <agronholm> I guess you missed my line "<agronholm> there is no jythonc anymore"
[18:02] <fwierzbicki> oops
[18:02] <agronholm> that was for jython-newbie
[18:03] <jython-newbie> agronholm: So, what's the command line to compile using Jython 2.5.2 ?
[18:03] <jimbaker> it seems to me that we should make it very clear on the wiki that jythonc is only for 2.2, and probably hide that some way
[18:04] <fwierzbicki> jython-newbie, anyway chapter 10 should answer your questions
[18:05] <fwierzbicki> jimbaker, I'd be tempted to name whatever we do with invokedynamic "jythonc" just so we have a specific answer to the question :)
[18:05] <jython-newbie> ok thanks
[18:05] <jimbaker> fwierzbicki, invokedynamic is in fact the answer to many things
[18:05] <agronholm> will invokedynamic allow directly calling python code from java w/o the use of interfaces?
[18:05] <fwierzbicki> jimbaker, indeed
[18:06] <agronholm> or PyObject
[18:06] <jimbaker> agronholm, yes
[18:06] <agronholm> that would require a new class in Java
[18:06] <jimbaker> no object factories required
[18:06] <agronholm> how would that work in practice?
[18:06] <fwierzbicki> agronholm, it is a calling style now supported in Java
[18:07] <agronholm> what does it look like
[18:07] <fwierzbicki> something like: callMethod(object, "foo") -- can't remember the exact details
[18:07] <fwierzbicki> but that would find a "foo" method on the object
[18:08] <fwierzbicki> w/o needing an interface in advance
[18:08] <jimbaker> we will support extending setuptools (aka distribute) such that jars can be created
[18:08] <fwierzbicki> directly supported in Java
[18:08] <jimbaker> the idea is that you will be able to directly describe how you want your python code to be exposed
[18:09] * thobe (~Adium@c83-249-235-76.bredband.comhem.se) has joined #jython
[18:09] <jimbaker> pretty similar to jythonc, but updated to modern usage (use decorators where feasible)
[18:10] <jimbaker> we know we have succeeded when a standard java ide can just work w/ such python-generated packages
[18:12] <agronholm> jimbaker: you mean extending distutils2?
[18:12] <agronholm> or packaging
[18:12] <agronholm> (which is being integrated to cpython 3.3)
[18:12] <jimbaker> agronholm, i can't keep up with the names, but whatever distribute will be called :)
[18:12] <agronholm> distribute != distutils2
[18:12] <agronholm> those two are entirely separate things
[18:13] <agronholm> distribute will be deprecated once distutils2/packaging is production ready
[18:13] <jimbaker> agronholm, sure ;)
[18:14] <jimbaker> at this point, i'm only concerned with making such things possible. then we will figure out the appropriate entry point
[18:15] <fwierzbicki> agronholm, jimbaker even before we make it clean and fancy, I suspect raw invokedynamic use would be cleaner (certainly faster) than the object factory approach - in fact we could probably write up an object factory with invokedynamic insides pretty quickly once we sort things out.
[18:16] <jimbaker> fwierzbicki, agreed
[18:16] <agronholm> how far along is java 7?
[18:16] <fwierzbicki> agronholm, I think it comes out in the fall?
[18:16] <jimbaker> that's my understanding. definitely far along as far as i can tell
[18:17] <fwierzbicki> agronholm, I think the delays are as much organization/etc more so than technical at this point
[18:17] <jimbaker> triaged, now working on perf
[18:17] <jimbaker> fwierzbicki, and fortunately that seems to be settled
[18:17] <fwierzbicki> jimbaker, yeah that seems to be the case.
[18:18] <agronholm> because I think Java 7 was supposed to come out a lot earlier
[18:18] <fwierzbicki> I think saying Jython 2.7 and any 3.x will be Java 7 only is reasonable
[18:18] <fwierzbicki> agronholm, Java 7 is shockingly late
[18:18] <fwierzbicki> years
[18:18] <agronholm> yup
[18:19] <fwierzbicki> but it gave them time to get invokdynamic in and nice :)
[18:20] <fwierzbicki> invokedynamic changes things for us completely
[18:21] <jimbaker> shashank is making good progress. and i've almost completed a design for applying indy to every type of callsite in python code (including names)
[18:22] <jython-newbie> Always that I want to compile an file in jython I have to type "java -jar jython.jar [file_name]" ?? Jython only works inside the directory where it is in?
[18:22] <jimbaker> still need to consider java integration issues, we could get some significant performance increases there too that would mean no longer needing to use expose
[18:32] <jython-newbie> jython doesn't recognize the @java
[18:32] <jython-newbie> in the jython's code
[18:33] <agronholm> jython-newbie: obviously not -- have you been listening to what we've been telling you?
[18:33] * thijstriemstra (~thijs@h183107.upc-h.chello.nl) has left #jython
[18:36] <jython-newbie> I have the file "jython.jar" in the directory /home/raul/jython2.5.2/
[18:36] <jython-newbie> so I put my code there to try to compile it
[18:36] <jython-newbie> *I pasted my code there
[18:37] <agronholm> jython-newbie: tried to compile? how?
[18:38] <jython-newbie> I type: java -jar jython.jar [filename.py]
[18:38] <agronholm> that runs the script
[18:38] <agronholm> why are you still talking about compiling?
[18:39] <jython-newbie> you said that jythonc doesn't exist anymore, but it means that you cannot compile using jython 2.5.2 ?
[18:39] <agronholm> not in a way that is usable directly from Java applications
[18:40] <jython-newbie> because I've read in a tutorial that you have to compile the code first to make the interface between the java code
[18:40] <agronholm> how old is that tutorial?
[18:40] <agronholm> I bet it's for Java 2.2
[18:40] <jython-newbie> so I just need to have the file.py? I don't need the others files such as .class, .java ?
[18:41] <agronholm> have you read the stuff we've linked you to?
[18:41] <agronholm> and those still don't answer your questions?
[18:42] <jython-newbie> I gotta go now. I will read it more carefully later.
[18:42] <jython-newbie> Thanks agronholm
[18:42] * jython-newbie (~raul@201.12.117.35) Quit (Quit: Saindo)
[19:07] * jabley (~jabley@cpc1-farn4-0-0-cust318.6-2.cable.virginmedia.com) has joined #jython
[19:12] * juneau001 (~juneau@131.225.24.148) Quit (Quit: juneau001)
[19:19] * shashank (~shashank@98.245.87.8) Quit (Ping timeout: 258 seconds)
[19:33] * shashank (~shashank@c-98-245-87-8.hsd1.co.comcast.net) has joined #jython
[20:05] * jabley_ (~jabley@cpc1-farn4-0-0-cust318.6-2.cable.virginmedia.com) has joined #jython
[20:05] * jabley (~jabley@cpc1-farn4-0-0-cust318.6-2.cable.virginmedia.com) Quit (Read error: Connection reset by peer)
[20:05] * jabley_ is now known as jabley
[20:55] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Ping timeout: 252 seconds)
[21:04] * KayT3 (~KayT3@63.84.81.41) Quit (Quit: Leaving)
[21:05] * chacara (~chacara@201.57.231.226) Quit (Quit: Leaving)
[21:13] * diminoten (~diminoten@reddit/operator/diminoten) has joined #jython
[21:14] <diminoten> so I've got this python project, right and I want to run it with jython, but I can't get the modules it depends on into the classpath
[21:14] <diminoten> with maven that is, I can get the whole damn thing to work pretty quickly with just executing java -cp /path/to/modules
[21:15] <diminoten> so my question is, if anyone has an opinion on it, how do I put the modules in a place where jython can see them
[21:32] <agronholm> what modules?
[21:32] <agronholm> you aren't confusing modules with distributions?
[21:32] <agronholm> module = single .py file
[21:33] <agronholm> distributions = projects, usually distributed in .tar.gz format
[21:33] <diminoten> really? well regardless, it's not finding anything
[21:33] <agronholm> well which is it?
[21:33] <agronholm> modules or distributions?
[21:33] <agronholm> what are those dependencies?
[21:33] <diminoten> ImportError: No module named ModuleName in <script> at line number 2
[21:34] <agronholm> that gives me no new information
[21:34] <diminoten> it supports my earlier statement
[21:34] <diminoten> that I'm indeed dealing with missing modules
[21:34] <agronholm> but what are your dependencies?
[21:34] <diminoten> for the python project?
[21:35] <agronholm> yes
[21:35] <diminoten> no dependencies
[21:35] <agronholm> eh?
[21:35] <diminoten> what dependencies would you expect?
[21:35] <agronholm> so how are you launching your python app
[21:36] <diminoten> engine.eval(new FileReader("/path/to/file"));
[21:36] <agronholm> do you have that directory in your class path?
[21:36] <diminoten> I've tried so very hard to put it there
[21:36] <agronholm> how?
[21:37] <agronholm> is your code organized in packages?
[21:37] <diminoten> my current attempt is to use the additionalClasspathElements tag in the maven-surefire-plugin
[21:37] <diminoten> this is not successful
[21:37] <agronholm> so did you put it to CLASSPATH?
[21:38] <diminoten> that's what it's suppsoed to do but apparently it's not
[21:38] <agronholm> yes it is
[21:38] <diminoten> like I said earlier, doing a java -cp /path/to/file ClassName
[21:38] <diminoten> works fine
[21:38] <agronholm> but ClassName would be a java class
[21:38] <diminoten> yes
[21:38] <agronholm> so, have you actually tried putting the directory with your modules to CLASSPATH?
[21:38] <diminoten> the env var?
[21:39] <agronholm> what env var?
[21:39] <diminoten> CLASSPATH
[21:39] <agronholm> err, yeah?
[21:39] <diminoten> or is there a python CLASSPATH?
[21:39] <agronholm> well there is JYTHONPATH, but CLASSPATH should work just as well
[21:39] <diminoten> I thought there was a universal classpath
[21:39] <diminoten> yes
[21:39] <diminoten> and it works when I do that
[21:40] <agronholm> so what's the problem?
[21:40] <diminoten> I have to use maven
[21:40] <diminoten> to do it
[21:40] <diminoten> so, since maven is failing miserably
[21:40] <diminoten> I was hoping there was another way to add the directory
[21:40] <agronholm> I've never used Maven, but you can just put the directory in sys.path in your python module
[21:41] <diminoten> it's not a static directory
[21:41] <diminoten> it will change over time
[21:41] <diminoten> or depending on who's building the project
[21:41] <agronholm> sys.path.append(os.basename(__file__))
[21:41] <diminoten> okay
[21:41] <agronholm> of course that fails if you put it in a jar file
[21:41] <diminoten> that's way useful
[21:41] <diminoten> if it's in a jar file this'd be way easier
[21:42] <diminoten> so if we switch to that it'll solve more problems than it causes heh
[21:42] <diminoten> can I do sys.path.append(os.basename(__directory__))?
[21:42] <agronholm> what is __directory__
[21:43] <diminoten> oh, __file__ isn't a variable?
[21:43] <agronholm> __file__ is a magic attribute that contains the full path to the current module
[21:43] <agronholm> but I've never heard of __directory__
[21:43] <diminoten> I made it up
[21:43] <agronholm> eh?
[21:43] <diminoten> I see now though
[21:44] <diminoten> sys.path.append('/path/to/file')
[21:44] <diminoten> will work as well, yes?
[21:44] <agronholm> you just have to append directories or jar files, not modules
[21:44] <diminoten> okay that's fine
[21:45] <diminoten> :D it worked
[21:45] <diminoten> thanks
[21:49] * juneau001 (~juneau@50.44.52.0) has joined #jython
[22:46] * gqlewis (~gqlewis@h246.70.82.166.dynamic.ip.windstream.net) has joined #jython
[22:59] * lopex (lopex@84-10-213-252.dynamic.chello.pl) Quit ()
[23:00] * lopex (lopex@84-10-213-252.dynamic.chello.pl) has joined #jython
[23:26] * kuja_ (~kuja@unaffiliated/kuja) has joined #jython
[23:30] * jimbaker` (~jbaker@c-24-8-39-78.hsd1.co.comcast.net) has joined #jython
[23:31] * juneau001_ (~juneau@50.44.41.7) has joined #jython
[23:32] * gqlewis (~gqlewis@h246.70.82.166.dynamic.ip.windstream.net) Quit (*.net *.split)
[23:32] * kuja (~kuja@unaffiliated/kuja) Quit (*.net *.split)
[23:32] * jimbaker (~jbaker@canonical/jimbaker) Quit (*.net *.split)
[23:33] * gqlewis (~gqlewis@h246.70.82.166.dynamic.ip.windstream.net) has joined #jython
[23:34] * juneau001 (~juneau@50.44.52.0) Quit (Ping timeout: 246 seconds)
[23:34] * juneau001_ is now known as juneau001

Index

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