#jython IRC Log (v0.9)

Index

IRC Log for 2012-04-19

Timestamps are in GMT/BST.

[0:14] * wmeissner (~wmeissner@ppp59-167-223-31.static.internode.on.net) has joined #jython
[0:14] * shashank1 (~shashank@184-96-142-208.hlrn.qwest.net) has joined #jython
[4:23] * juneau001 (~juneau@50-103-3-12.dklb.il.frontiernet.net) Quit (Quit: juneau001)
[4:57] * jimbaker (~jbaker@c-75-71-80-146.hsd1.co.comcast.net) has joined #jython
[4:57] * jimbaker (~jbaker@c-75-71-80-146.hsd1.co.comcast.net) Quit (Changing host)
[4:57] * jimbaker (~jbaker@canonical/jimbaker) has joined #jython
[6:00] * shashank1 (~shashank@184-96-142-208.hlrn.qwest.net) Quit (Ping timeout: 244 seconds)
[7:25] * seletz (~seletz@85.236.236.50) has joined #jython
[11:06] * juneau001 (~juneau@131.225.24.74) has joined #jython
[11:23] * juneau001 (~juneau@131.225.24.74) Quit (Read error: Connection reset by peer)
[11:29] * juneau001 (~juneau@131.225.24.74) has joined #jython
[11:55] * juneau001 (~juneau@131.225.24.74) Quit (Quit: juneau001)
[11:56] * wmeissner_ (~wmeissner@ppp59-167-223-31.static.internode.on.net) has joined #jython
[11:56] * wmeissner_ (~wmeissner@ppp59-167-223-31.static.internode.on.net) Quit (Client Quit)
[11:58] * wmeissner (~wmeissner@ppp59-167-223-31.static.internode.on.net) Quit (Ping timeout: 252 seconds)
[12:30] * juneau001 (~juneau@131.225.24.74) has joined #jython
[12:32] * wainersm (wainersm@nat/ibm/x-mrpyypwsllwueyyb) has joined #jython
[14:00] * enebo (~enebo@75-168-81-196.mpls.qwest.net) has joined #jython
[15:48] * shashank1 (~shashank@184-96-142-208.hlrn.qwest.net) has joined #jython
[16:38] * shashank1 (~shashank@184-96-142-208.hlrn.qwest.net) Quit (Read error: Operation timed out)
[16:58] * ciziar (~textual@h-184-81.a189.priv.bahnhof.se) has joined #jython
[17:24] * shashank1 (~shashank@ucb-np2-238.colorado.edu) has joined #jython
[17:31] * jimbaker (~jbaker@canonical/jimbaker) Quit (Quit: Ex-Chat)
[17:32] * jimbaker` (~jbaker@c-75-71-80-146.hsd1.co.comcast.net) has joined #jython
[17:34] * jimbaker` (~jbaker@c-75-71-80-146.hsd1.co.comcast.net) Quit (Quit: Coyote finally caught me)
[17:34] * jimbaker (~jbaker@canonical/jimbaker) has joined #jython
[17:34] * seletz (~seletz@85.236.236.50) Quit (Read error: Connection reset by peer)
[17:34] * seletz_ (~seletz@85.236.236.50) has joined #jython
[17:53] * shashank1 (~shashank@ucb-np2-238.colorado.edu) Quit (Ping timeout: 264 seconds)
[19:11] * juneau001 (~juneau@131.225.24.74) Quit (Quit: juneau001)
[19:42] * ciziar (~textual@h-184-81.a189.priv.bahnhof.se) Quit (Quit: Textual IRC Client: http://www.textualapp.com/)
[19:44] * seletz_ (~seletz@85.236.236.50) Quit (Quit: seletz_)
[20:06] * fwierzbicki (~frank@99-106-170-105.lightspeed.sntcca.sbcglobal.net) has joined #jython
[20:38] * shashank1 (~shashank@ucb-np2-199.colorado.edu) has joined #jython
[20:44] * fwierzbicki (~frank@99-106-170-105.lightspeed.sntcca.sbcglobal.net) Quit (Read error: Connection reset by peer)
[20:44] * fwierzbicki_ (~frank@99-106-170-105.lightspeed.sntcca.sbcglobal.net) has joined #jython
[20:49] * fwierzbicki (~frank@99-106-170-105.lightspeed.sntcca.sbcglobal.net) has joined #jython
[20:49] * fwierzbicki_ (~frank@99-106-170-105.lightspeed.sntcca.sbcglobal.net) Quit (Read error: Connection reset by peer)
[21:00] * fwierzbicki_ (~frank@99-106-170-105.lightspeed.sntcca.sbcglobal.net) has joined #jython
[21:00] * fwierzbicki (~frank@99-106-170-105.lightspeed.sntcca.sbcglobal.net) Quit (Read error: Connection reset by peer)
[21:00] * fwierzbicki_ is now known as fwierzbicki
[21:00] * wainersm (wainersm@nat/ibm/x-mrpyypwsllwueyyb) Quit (Quit: Ex-Chat)
[21:16] * fwierzbicki (~frank@99-106-170-105.lightspeed.sntcca.sbcglobal.net) Quit (Quit: fwierzbicki)
[21:23] * fwierzbicki (~frank@99-106-170-105.lightspeed.sntcca.sbcglobal.net) has joined #jython
[21:28] * DeeTah (d33tah@kolos.math.uni.lodz.pl) has joined #jython
[21:28] <DeeTah> anyone by the keyboard?
[21:30] <agronholm> fire away
[21:31] <DeeTah> well
[21:31] <DeeTah> i just installed jython
[21:31] <DeeTah> i can hardly write a hello world in java, i just need to use htmlunit
[21:31] <DeeTah> the point being, i don't even know how to import the package
[21:31] <agronholm> in python?
[21:31] <DeeTah> it's under debian, i installed libhtmlunit-java
[21:31] <agronholm> don't import java packages in jython, it's bad practice
[21:31] <DeeTah> in jython
[21:32] <agronholm> import classes instead
[21:32] <DeeTah> could you please somehow guide me through? :/
[21:33] <DeeTah> the file is most likely /usr/share/maven-repo/net/sourceforge/htmlunit/htmlunit/2.8/htmlunit-2.8.jar
[21:33] <DeeTah> import net.sourceforge.htmlunit fails
[21:33] <agronholm> surely you have SOME idea how that API is supposed to be used?
[21:33] <DeeTah> i have some sample code
[21:33] <agronholm> ok?
[21:34] <DeeTah> i'd just need to be able to try it somehow
[21:34] <agronholm> well you have to import the classes the code uses
[21:34] <agronholm> it works just the same way as in Python
[21:34] <agronholm> and you know how to do that in Python, yes?
[21:35] <DeeTah> well, i know the import keyword
[21:35] <DeeTah> i just thought i need to somehow specify some path
[21:35] <agronholm> may I then assume you are a Python beginner too?
[21:35] <DeeTah> some net.sourceforge.blah.blah.blah
[21:35] <DeeTah> nope, I wrote a few thousand lines already
[21:36] <agronholm> that still counts as a beginner to me...
[21:36] <DeeTah> okay then
[21:36] <agronholm> well I don't know what exactly you should be importing
[21:36] <agronholm> can you link me to that sample code?
[21:36] <agronholm> that jar file needs to be in sys.path, CLASSPATH or JYTHONPATH
[21:36] <DeeTah> sure, hold on
[21:37] <agronholm> so import would work
[21:37] <DeeTah> http://www.qaautomation.net/?p=90
[21:37] <DeeTah> how about this example?
[21:38] <agronholm> well, there you have the import statements at the top
[21:38] <agronholm> right?
[21:38] <agronholm> adapt those to Python
[21:38] <DeeTah> >>> import com.gargoylesoftware.htmlunit.WebClient
[21:38] <DeeTah> Traceback (most recent call last): File "<stdin>", line 1, in <module>
[21:38] <DeeTah> ImportError: No module named gargoylesoftware
[21:39] <DeeTah> you mean "add the .jar to classpath first"?
[21:39] <agronholm> yes
[21:39] <DeeTah> okay, gonna try
[21:39] <agronholm> secondly, you probably don't want to reference that class by its full name all the time
[21:39] <agronholm> so you probably want to do "from com.gargoylesoftware.htmlunit import WebClient"
[21:40] <DeeTah> cute!
[21:40] <DeeTah> it was all about the classpath
[21:40] <DeeTah> thank you, good man :)
[21:40] <agronholm> np
[21:42] <DeeTah> is there any way to add the JAR from inside of the jython code instead of editing the environment variable?
[21:42] <agronholm> yes, add to sys.path
[21:42] <DeeTah> the jar?
[21:42] <agronholm> yes, the full path to the jar
[21:43] <DeeTah> just the path or the file itself?
[21:43] <agronholm> like I just said, the path
[21:44] <DeeTah> doesn't seem to work
[21:44] <agronholm> what exactly are you doing then
[21:45] <DeeTah> awww fuck
[21:45] <DeeTah> sorry
[21:45] <DeeTah> i ran python instead of jython
[21:45] <DeeTah> silly me
[21:46] <DeeTah> though, jython doesn't seem to like me either: pastebin.com/3JM2ivbx
[21:46] <agronholm> you're not adding the path to the jar file
[21:47] <agronholm> you only added the path to the directory containing the jar file
[21:47] <DeeTah> oh
[21:47] <DeeTah> now we understood
[21:47] <DeeTah> another issue though:
[21:47] <DeeTah> java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: org/apache/http/client/CredentialsProvider
[21:47] <agronholm> yes, you need to add that too to sys.path
[21:48] <agronholm> commons-httpclient that is
[21:48] <agronholm> and whatever that needs
[21:48] <agronholm> and so on
[21:49] <DeeTah> oh
[21:49] <DeeTah> worked
[21:49] <DeeTah> thank you so much again
[21:49] <DeeTah> :)
[21:51] * seletz (~seletz@85.236.236.50) has joined #jython
[21:56] * fwierzbicki (~frank@99-106-170-105.lightspeed.sntcca.sbcglobal.net) Quit (Quit: fwierzbicki)
[21:58] <DeeTah> TypeError: No visible constructors for class (com.gargoylesoftware.htmlunit.WebClient)
[21:58] <DeeTah> wth.
[21:59] <agronholm> that is normal for some APIs
[21:59] <agronholm> you have to use it through its static methods, some of which may yield an actual instance
[21:59] <DeeTah> browser = new WebClient();
[21:59] <DeeTah> the original code says it clearly
[21:59] <DeeTah> that it's just a constructor
[22:01] <agronholm> perhaps the sample code is out of date?
[22:01] <agronholm> I can't think of many other reasons for this
[22:01] <DeeTah> well
[22:01] <DeeTah> you might be right
[22:02] <DeeTah> or it's my jar that is outdated
[22:04] <DeeTah> damn
[22:04] <DeeTah> it'd be easier if I just had tab completion
[22:04] <agronholm> why don't you?
[22:04] <DeeTah> well
[22:04] <DeeTah> rlcompletion doesn't seem to work
[22:05] <DeeTah> even the hacked version
[22:05] <agronholm> well, completion works usually fine in pydev
[22:06] <DeeTah> > jython --version
[22:06] <DeeTah> Jython 2.5.1+
[22:06] <DeeTah> perhaps i'm too outdated?
[22:06] <agronholm> yes
[22:06] <agronholm> that too
[22:06] <DeeTah> damnit, it was in the repos! :/
[22:06] <agronholm> that's not what is causing your problem though
[22:06] <DeeTah> okay
[22:06] <DeeTah> dunno what it might be then
[22:07] <agronholm> have you tried looking at the current API docs?
[22:07] <DeeTah> the rlcompletion entry?
[22:07] <agronholm> huh?
[22:07] <DeeTah> OH
[22:07] <agronholm> I have no idea what rlcompletion is
[22:07] <DeeTah> it's the thing i'd normally use under python to get tab completion
[22:08] <agronholm> no, I meant API documentation
[22:08] <agronholm> like, you know, HTML?
[22:09] <DeeTah> of the htmlunit?
[22:09] <DeeTah> it turned out i'm using an outdated version
[22:09] <DeeTah> looking for the latest jar right now
[22:15] * seletz (~seletz@85.236.236.50) Quit (Quit: seletz)
[22:18] * enebo (~enebo@75-168-81-196.mpls.qwest.net) Quit (Quit: enebo)
[22:20] <DeeTah> java.lang.IllegalStateException: java.lang.IllegalStateException: Configuration was not initialized - see log for details
[22:22] <agronholm> well, see the log then
[22:22] <agronholm> you obivously know how to import the class
[22:22] <agronholm> now just read the docs carefully to learn how to use it
[22:23] <DeeTah> does it mean the backtrace by the log?
[22:23] <agronholm> heck if I know
[22:23] <DeeTah> because i have no log file in pwd
[22:27] <DeeTah> damnit, i give up.
[22:27] <agronholm> have you read the user documentation?
[22:27] <DeeTah> i flicked through it
[22:27] <DeeTah> i googled
[22:27] <DeeTah> no help
[22:29] <agronholm> are you using htmlunit 2.9 now?
[22:29] <DeeTah> yup
[22:33] <agronholm> I just tried it
[22:34] <agronholm> works fine
[22:34] <DeeTah> hm
[22:34] <DeeTah> so i dunno what else could I change
[22:34] <DeeTah> how did you test it?
[22:35] <agronholm> http://pastebin.com/chAiQNLb
[22:36] <DeeTah> wtf
[22:36] <DeeTah> works by classpath
[22:36] <DeeTah> or rather
[22:36] <DeeTah> was close to working
[22:37] <DeeTah> # A fatal error has been detected by the Java Runtime Environment:
[22:37] <DeeTah> #
[22:37] <DeeTah> # SIGSEGV (0xb) at pc=0x00000000, pid=8658, tid=3054267248
[22:37] <agronholm> ah, null pointer exception
[22:37] <DeeTah> looks like i'll be updating icedtea soon
[22:37] <DeeTah> and jython, just in case
[22:37] <DeeTah> you jython dev by any chance?
[22:38] <agronholm> yes
[22:38] <DeeTah> thought so ;)
[22:38] <DeeTah> keep up the good work! ^^
[22:38] <agronholm> the latest addition to the team, so I'm nowhere near as knowledgeable as the others
[22:38] <DeeTah> knowledgeable enough to help me out
[22:38] <DeeTah> i got to JRE error, so it's my fault now
[22:41] <DeeTah> (i guess, isn't it?)
[22:41] <agronholm> no idea what causes this
[22:42] <agronholm> I hope you're not using gcj
[22:42] <agronholm> that stuff blows
[22:42] <agronholm> gnu classpath java that is
[22:46] <DeeTah> # Java VM: OpenJDK Client VM (14.0-b16 mixed mode, sharing linux-x86 )
[22:46] <DeeTah> i guess it's not it, right?
[22:46] <agronholm> right
[22:47] <agronholm> heh.
[22:47] <agronholm> penJDK Runtime Environment (IcedTea6 1.11pre) (6b23~pre11-0ubuntu1.11.10.2)
[22:47] <agronholm> OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)
[22:50] * shashank (~shashank@gradual.colorado.edu) Quit (Quit: Ex-Chat)
[23:30] * fwierzbicki (~frank@99-106-170-105.lightspeed.sntcca.sbcglobal.net) has joined #jython
[23:32] * Arfrever (~Arfrever@apache/committer/Arfrever) has joined #jython
[23:55] * fwierzbicki_ (~frank@99-106-170-105.lightspeed.sntcca.sbcglobal.net) has joined #jython
[23:55] * fwierzbicki (~frank@99-106-170-105.lightspeed.sntcca.sbcglobal.net) Quit (Read error: Connection reset by peer)
[23:55] * fwierzbicki_ is now known as fwierzbicki
[23:56] * fwierzbicki_ (~frank@99-106-170-105.lightspeed.sntcca.sbcglobal.net) has joined #jython
[23:56] * fwierzbicki (~frank@99-106-170-105.lightspeed.sntcca.sbcglobal.net) Quit (Read error: Connection reset by peer)
[23:56] * fwierzbicki_ is now known as fwierzbicki

Index

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