#jython IRC Log


IRC Log for 2014-01-09

Timestamps are in GMT/BST.

[0:08] * arctansusan (~susantan@173-11-98-81-SFBA.hfc.comcastbusiness.net) has joined #jython
[0:22] * arctansusan (~susantan@173-11-98-81-SFBA.hfc.comcastbusiness.net) Quit (Ping timeout: 252 seconds)
[0:23] * arctansusan (~susantan@173-11-98-81-SFBA.hfc.comcastbusiness.net) has joined #jython
[0:46] * enebo (~enebo@c-75-73-8-169.hsd1.mn.comcast.net) has joined #jython
[0:51] * enebo (~enebo@c-75-73-8-169.hsd1.mn.comcast.net) Quit (Client Quit)
[0:53] * arctansusan (~susantan@173-11-98-81-SFBA.hfc.comcastbusiness.net) Quit (Quit: arctansusan)
[0:56] * arctansusan (~susantan@173-11-98-81-SFBA.hfc.comcastbusiness.net) has joined #jython
[1:20] <arctansusan> hi, i have a question. how do I incorporate external python packages in Jython? i.e.: import gspread --> "no module named gspread" I've successfully followed this tutorial, and I understand the factory method: https://wiki.python.org/jython/JythonMonthly/Articles/September2006/1
[1:40] * arctansusan (~susantan@173-11-98-81-SFBA.hfc.comcastbusiness.net) Quit (Ping timeout: 252 seconds)
[2:37] * arctansusan (~susantan@ has joined #jython
[3:24] * lheuer (~Adium@unaffiliated/lheuer) Quit (Quit: Leaving.)
[4:50] * ohumbel_ (~ohumbel@adsl-84-227-97-139.adslplus.ch) has joined #jython
[4:57] * Oti (~ohumbel@adsl-84-227-97-139.adslplus.ch) Quit (*.net *.split)
[5:10] * arctansusan (~susantan@ Quit (Ping timeout: 265 seconds)
[6:11] * ohumbel_ (~ohumbel@adsl-84-227-97-139.adslplus.ch) Quit (Quit: ohumbel_)
[7:29] * lheuer (~Adium@f049202004.adsl.alicedsl.de) has joined #jython
[7:29] * lheuer (~Adium@f049202004.adsl.alicedsl.de) Quit (Changing host)
[7:29] * lheuer (~Adium@unaffiliated/lheuer) has joined #jython
[7:41] * lheuer1 (~Adium@f048237022.adsl.alicedsl.de) has joined #jython
[7:44] * lheuer (~Adium@unaffiliated/lheuer) Quit (Ping timeout: 265 seconds)
[8:25] * lheuer1 is now known as lheuer
[8:25] * lheuer (~Adium@f048237022.adsl.alicedsl.de) Quit (Changing host)
[8:25] * lheuer (~Adium@unaffiliated/lheuer) has joined #jython
[8:42] * ivan` (~ivan@unaffiliated/ivan/x-000001) Quit (Ping timeout: 264 seconds)
[8:45] * ivan` (~ivan@unaffiliated/ivan/x-000001) has joined #jython
[9:16] * oscar_toro (~Thunderbi@80-62-162-242-static.dk.customer.tdc.net) has joined #jython
[9:28] * lheuer (~Adium@unaffiliated/lheuer) Quit (Quit: Leaving.)
[9:31] * lheuer (~Adium@f048237022.adsl.alicedsl.de) has joined #jython
[9:31] * lheuer (~Adium@f048237022.adsl.alicedsl.de) Quit (Changing host)
[9:31] * lheuer (~Adium@unaffiliated/lheuer) has joined #jython
[11:19] * thereisnospoon (~thereisno@113-61-86-28.static.qld.dsl.net.au) Quit (Ping timeout: 252 seconds)
[11:20] * thereisnospoon (~thereisno@113-61-86-28.static.qld.dsl.net.au) has joined #jython
[13:30] <mantovani> http://paste.scsys.co.uk/290360
[13:30] <mantovani> more expert people can help me do a less dumb code ?
[13:30] <mantovani> s/do/write/
[13:54] <topi`> it seems I cannot directly translate builder-style java source into jython - it says "expecting DEDENT" where I have a new line with .doSomething()
[13:55] <topi`> .setTemplate(Templates.reportTemplate)
[13:55] <topi`> SyntaxError: mismatched input '.' expecting DEDENT
[13:55] <topi`> any hints? do I just need to remove all the linefeeds and make this one, huge line?
[13:56] <ohumbel> topi, how about a \ at the end of the line?
[13:56] <agronholm> topi`: can you pastebin the source?
[14:06] <topi`> ohumbel: that's a good suggestion, thanks
[14:06] <topi`> ohumbel: but... then I can't indent the lines at all
[14:07] <topi`> agronholm: http://paste.pound-python.org/show/uUElAQsfAzFVg5tCO7Lv/
[14:08] <topi`> agronholm: I just translated one of dynamicreports' examples into jython
[14:08] <topi`> direct translation, I wish I could avoid defining those getters and setters.. but I guess the bean stuff requires that
[14:09] <agronholm> so which lines are giving you trouble
[14:11] <topi`> argh, this is not going to go well with jython:
[14:11] <topi`> public static final DataTypeBuilders type = new DataTypeBuilders();
[14:11] <topi`> and if I import that class with the * then I'll get "type" into my namespace. not good.
[14:13] <topi`> agronholm: I'm still finding out where the problem lies, I get an error when some piece of code is trying to access the data in that bean defined there..
[14:13] <topi`> see, like this:
[14:13] <topi`> net.sf.dynamicreports.report.exception.DRException: net.sf.dynamicreports.report.exception.DRException: net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : subData
[14:17] <topi`> I guess it's just plain easier to work with the original java source code... and live with the crufty java syntax and types :)
[14:17] <topi`> however, at the prototyping stage, types just get in the way
[14:38] * whg is now known as zz_whg
[14:39] * zz_whg is now known as whg
[14:44] * enebo (~enebo@c-75-73-8-169.hsd1.mn.comcast.net) has joined #jython
[14:50] <grey_> topi`: for getter/setter cleanup, I recommend http://projectlombok.org/
[14:53] <whg> actually, if you're gonna be writing java, you should get to know and love lombok and guava
[14:54] <whg> just assume you'll need them
[15:09] <ohumbel> topi, I am not sure what you mean by 'then I cannot indent at all' - here is a very simple example: http://paste.pound-python.org/show/z9ghPlHRukOHFRRy7CXv/
[15:19] <topi`> does a Bean need to implement java.io.Serializable? how do you achieve that in jython?
[15:20] <topi`> ohumbel: ok, thanks
[15:22] <agronholm> topi`: no
[15:28] <topi`> I have a slight distaste towards java annotations, since effectively they're rewriting the source code, and I cannot see what the transformation is
[15:28] <topi`> contrast that with python decorators, which, while not probably the easiest code to grasp, are pretty transparent
[15:36] <topi`> anyhow, for some odd reason, the java example works, but my jython conversion will throw that error (Error retrieving field value from bean : item
[15:37] <topi`> perhaps I need to check the API of that JRBeanCollectionDataSource method
[15:38] <topi`> it expects java.util.Collection<?> so I guess jython will correctly coerce a python list into such?
[15:42] <topi`> oddly, the data object seems to work
[15:42] <vext01> Did i hear someone say that jython support __new__ now?
[15:43] <ohumbel> mantovani, maybe like this: http://paste.scsys.co.uk/290391
[15:44] <grey_> topi`: @Getter private Object aThing;
[15:44] <grey_> how would you improve this?
[15:46] <grey_> I have had no issues with Data objects, IDEs also show the resultant methods (but not the boilerplate code, which you wanted to get rid of in the first place)
[15:47] <grey_> and if you want to see it, there is delombok
[15:48] <mantovani> ohumbel: ty
[17:11] <jimbaker> vext01, jyhton supports __new__ for python code, it's not something that mixes in readily with java
[17:12] <vext01> thanks for clarifiction
[17:13] <jimbaker> incidentally this is starting to look good for clamp, https://github.com/jythontools/clamp/pull/2/files
[17:14] <jimbaker> so this is building on the metaclass patch i mentioned yesterday - basically it makes the __proxymaker__ stuff disappear by using a metaclass to insert it instead
[17:14] <vext01> i must admit, i have not yet looked into clamp
[17:15] <jimbaker> naturally this is not the only thing we can add to a class definition - think of constants, fields, method decorators, type inference??? :)
[17:16] <jimbaker> vext01, clamp is useful when you want to simply make a python package look like java, including jar packaging. there are other ways to do this, but what are doing is making it seamless - you really don't see python at all from the java side
[17:18] <jimbaker> other ways include embedding a jython runtime, or use jsr 223 scripting, or object factories; but w/ clamp, it really does just look like you're calling java code
[17:48] <grey_> wow
[17:48] <vext01> jimbaker: i may well check that out
[18:26] * Oti (~ohumbel@adsl-84-227-97-139.adslplus.ch) has joined #jython
[18:46] <whg> jimbaker: Have you been following Graham Dumpleton's blog posts about decorators?
[18:46] <jimbaker> whg, i have not
[18:47] <whg> It's about how to make a "universal" decorator that respects the descriptor protocols, can be applied to staticmethods, classmethods, instance methods, or plain ol' functions, and plays nicely with introspection
[18:47] <whg> Man there is a ton of Python introspection machinery
[18:48] <jimbaker> whg, but in briefly scanning http://blog.dscpl.com.au/, i certainly agree with using classes for decorators
[18:48] <whg> I want to go try out his lib in Jython as soon as beta 2 drops
[18:49] <jimbaker> whg, in particular, the clamp magic support that's proposed (https://github.com/jythontools/clamp#supporting-java-annotations) will working by turning java annotations for classes and methods into decorators, by using this sort of approach
[18:50] <jimbaker> i'm glad graham blogged on this subject, since it looks like he has thought through more corner cases than i have at, at this point :)
[18:50] <jimbaker> whg, in particular, everything should always play well with inspect
[18:50] <whg> heh. I guess it was something to do with all the instrumentation for New Relic's products
[18:50] <whg> But yes. I was impressed with the number of weird edge-cases he covered
[18:52] <whg> Also, I'll probably have some time to hack on patois tonight before my user group meeting
[18:52] <whg> So if you have any specifics you'd like to say, add Issues :-)
[18:53] <jimbaker> whg, sounds good! btw, where are you located?
[18:53] <whg> Atlanta
[18:53] <whg> (ish)
[18:53] <jimbaker> cool, i'm in boulder
[18:53] <whg> It's about an hour each way to get to the user group
[18:53] <whg> :-/
[18:53] <whg> Worth it, though
[18:53] <jimbaker> sounds like when i go south to denver
[18:54] <jimbaker> i live just north of boulder; but boulder itself is probably the center of software dev here
[18:55] <jimbaker> (technically i live in exurbia...)
[18:55] <jimbaker> (that's probably why i see cows outside)
[18:57] <whg> sounds familiar
[18:57] <whg> I don't see cows as much as horses, though
[18:57] <whg> (the cows are on the other side of the interstate)
[18:58] <jimbaker> yeah, horses are on different farms than the one across from me. but definitely nearby
[19:59] * oscar_toro (~Thunderbi@80-62-162-242-static.dk.customer.tdc.net) Quit (Quit: oscar_toro)
[20:04] * arctansusan (~susantan@173-11-98-81-SFBA.hfc.comcastbusiness.net) has joined #jython
[20:32] <sinsnare|zzZZzz> jimbaker, how close is boulder to denver? i have family that i want to meet in denver, but want to visit boulder too
[20:33] <jimbaker> sinsnare|zzZZzz, it's less than 1h
[20:33] <jimbaker> maybe 45 min from univ of colorado campus to downtown
[20:34] <jimbaker> if you're a CU student, you get a bus pass included in your tuition & fees - it's very convenient
[20:35] * sinsnare|zzZZzz is now known as sinistersnare
[20:35] <sinistersnare> oh that sounds nice
[20:38] <sinistersnare> well good, I should do some scheduling some time then
[20:41] <sinistersnare> whoops need to go to work...
[20:41] * sinistersnare is now known as sinsnare|away
[21:51] * shashank (~shashank@ has joined #jython
[22:43] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Ping timeout: 252 seconds)
[23:21] * enebo (~enebo@c-75-73-8-169.hsd1.mn.comcast.net) Quit (Quit: enebo)
[23:43] * indratalip (cbb0652a@gateway/web/freenode/ip. Quit (Quit: Page closed)


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