#jython IRC Log (v0.9)

Index

IRC Log for 2010-06-11

Timestamps are in GMT/BST.

[0:07] * jabley (~jabley@fl-64-45-218-122.dyn.embarqhsd.net) has joined #jython
[0:14] * jabley (~jabley@fl-64-45-218-122.dyn.embarqhsd.net) Quit (Ping timeout: 260 seconds)
[0:37] * pr3d4t0r is now known as pr3d4k4t
[0:59] * projectmoon (~projectmo@c-68-49-168-233.hsd1.va.comcast.net) has joined #jython
[0:59] <projectmoon> so i'm trying to figure out how implement custom event properties
[1:00] <projectmoon> it kind of randomly works in one of my other classes, but the behavior is not being replicated in the class i am currently working on
[1:00] <projectmoon> is there some magic that must be done in order to trigger it?
[1:06] <agronholm_> how are you doing it?
[1:06] <projectmoon> well the class where it works has the standard addXListener
[1:06] <projectmoon> and said listener takes events that extend EventObject
[1:06] <projectmoon> so it attaches the event methods as properties to said class
[1:06] <projectmoon> same methodology elsewhere but it doesn't seem to like the magic
[1:07] <projectmoon> at the moment i'm trying to dig through the jython source to see how it detects event properties
[1:07] <agronholm_> are you doing it in Java or Python code
[1:07] <projectmoon> these are java classes that get used python side
[1:07] <agronholm_> event properties are not such a great idea anyway
[1:08] <agronholm_> jython-swingutils implements a better approach
[1:08] <agronholm_> http://www.bitbucket.org/agronholm/jython-swingutils/src/tip/swingutils/events.py
[1:10] <agronholm_> once you assign a function to an event property, you can't un-assign it
[1:10] <agronholm_> and you can't add more than one listener that way
[1:10] <projectmoon> i was aware of the second, but not the first
[1:10] <projectmoon> half of this is to figure out how to do it
[1:11] <projectmoon> i'm assuming the way that this jython-swingutils works is by passing event listening method names into the addEventListener method?
[1:11] <projectmoon> along with the target object and the listener type
[1:12] <agronholm_> event names actually, it figures out the add* and remove* method names automatically
[1:13] <agronholm_> I had a more magical version of addEventListener before, which even figured out the necessary event interface class automatically from the class hiearchy, but it was horribly slow
[1:15] <projectmoon> well, the good news is i'm an idiot
[1:15] <projectmoon> the event properties weren't working because i forgot to extend the EventListener interface
[1:16] <projectmoon> i will look into the link though
[1:17] <projectmoon> it is likely that event properties won't cut it later
[1:17] <projectmoon> particularly if you can't unassign them
[1:17] <projectmoon> not so much multiple listeners though
[1:17] <projectmoon> although i can see both being factors
[1:17] <projectmoon> thank you
[1:19] * lopex (lopex@chello089076044027.chello.pl) has joined #jython
[1:20] <projectmoon> agronholm_: it looks like i am able to change and remove the functions on event properties
[1:22] <agronholm_> how?
[1:22] <projectmoon> just by assigning a new function to it
[1:22] <projectmoon> or setting it to None
[1:22] <agronholm_> does that really disable it?
[1:22] <agronholm_> are you sure?
[1:22] <projectmoon> what do you mean by disable?
[1:23] <projectmoon> stop the event?
[1:23] <agronholm_> make it not fire on event
[1:23] <projectmoon> setting it to None will throw an exception if it the function is called
[1:23] <projectmoon> so, sort of? :)
[1:23] <agronholm_> well, that's not a very good solution :P
[1:24] <projectmoon> other idea would be to have an empty function
[1:24] <projectmoon> or provide a hook to remove the listener that it creates in the background
[1:25] <projectmoon> although
[1:25] <projectmoon> i find it kind o funny because the add*Listener method doesn't actually do anything
[1:25] <projectmoon> so it's probably not as simple as removing all listeners java side
[1:25] <agronholm_> huh?
[1:26] <projectmoon> well my first guess would be that jython uses reflection to call the add*Listener behind the scenes
[1:26] <projectmoon> but apparently it doesn't do that
[1:26] <projectmoon> since the current implementation for my add method is blank
[1:26] <projectmoon> well, actually it would have to
[1:26] <projectmoon> just not for the functiona
[1:26] <projectmoon> s
[1:26] <agronholm_> add*Listener certainly does something
[1:26] <projectmoon> not my current implementation of it
[1:27] <projectmoon> :)
[1:27] <agronholm_> I'm not talking about your code, I wouldn't know what's in it
[1:27] <projectmoon> actually is what it probably does is create the listener and then pass it to the proper add*Listener
[1:27] <projectmoon> i'm not actually calling events at the moment
[1:27] <projectmoon> in an event-driven fashion
[1:27] <projectmoon> just directly
[1:28] <projectmoon> so what would happen in my code is the function pointers would be created but they would never get called since my add*Listener doesn't do anything yet
[1:29] <agronholm_> I'm not sure that the proxy generator cares if you override add*Listener
[1:29] <agronholm_> the whole event property thing is too much magic
[1:30] <projectmoon> heheh
[1:30] <projectmoon> well i'm not really overriding any add*Listener
[1:30] <projectmoon> there isn't anything to override
[1:30] <projectmoon> just adding that method to my code
[1:30] <agronholm_> so what exactly do you want now
[1:31] <projectmoon> hmm, oh my question has been answered for some time
[1:31] <projectmoon> at this point i'm just speculating on how the whole thing works
[1:31] <projectmoon> because i have an annoying need to know how everything works
[1:32] <projectmoon> :)
[1:43] <projectmoon> in other news, you can also apparently add more than one event handler to an event property by calling its append method
[1:43] <agronholm_> I see
[1:44] <agronholm_> this wasn't documented anywhere...
[1:44] <agronholm_> did you test that it works?
[1:44] <projectmoon> still only testing direct calls
[1:44] <agronholm_> bleh
[1:44] <projectmoon> but, don't see why it wouldn't work in actual real event handling
[1:44] <projectmoon> time to break out the swing
[1:47] <projectmoon> yup
[1:47] <projectmoon> works as expected
[1:47] <agronholm_> can you remove them?
[1:48] <projectmoon> there is a clear() method
[1:48] <projectmoon> doesn't look like there's a method to remove individual ones
[1:48] <agronholm_> what about del?
[1:49] <agronholm_> hm
[1:49] <agronholm_> no way to specify which one to delete...
[1:49] <projectmoon> or is there?
[1:49] <projectmoon> let's see
[1:49] <projectmoon> http://pastebin.com/PsPFZs8m
[1:49] <projectmoon> that's the simple swing test
[1:49] <projectmoon> modified code yoinked from some stack overflow page
[1:50] <agronholm_> .show() is deprecated
[1:50] <agronholm_> .visible = True is the proper method
[1:50] <projectmoon> like i said, yoinked from some stack overflow article
[1:50] <agronholm_> just sayin'
[1:50] <projectmoon> the event properties are actually CompoundCallable objects
[1:51] <projectmoon> you'd think that would be iterable but nope
[1:51] <projectmoon> so if you call the function it actually calls them all in successio
[1:51] <projectmoon> n
[1:51] <projectmoon> CompoundCallable does not support item deletion
[1:52] <agronholm_> damn, I really need to finish my thesis
[1:52] <agronholm_> gone =>
[1:53] <projectmoon> heh
[1:57] <projectmoon> http://jython.svn.sourceforge.net/viewvc/jython/trunk/jython/src/org/python/core/PyCompoundCallable.java?revision=5739&view=markup
[1:57] <projectmoon> doesn't look like it would be hard to add a few extra methods to it to support iteration and picking of individual callables
[1:57] <projectmoon> (code is way at the bottom of the changelgo)
[1:57] <projectmoon> changelog*
[2:42] <snappy> Ooh, jython users.
[2:44] <projectmoon> *wiggles fingers mysteriously*
[2:47] * agronholm_ (agronholm@nblzone-211-17.nblnetworks.fi) Quit (Read error: Connection reset by peer)
[2:48] * agronholm_ (agronholm@nblzone-211-17.nblnetworks.fi) has joined #jython
[2:52] * clajo04_ (~clajo04_@pool-74-108-95-175.nycmny.fios.verizon.net) Quit (Quit: clajo04_)
[2:54] * lopex (lopex@chello089076044027.chello.pl) Quit ()
[3:04] * r0bby (~wakawaka@guifications/user/r0bby) Quit (Read error: Connection reset by peer)
[3:04] * projectmoon (~projectmo@c-68-49-168-233.hsd1.va.comcast.net) Quit (Quit: Leaving.)
[3:06] * projectmoon (~projectmo@c-68-49-168-233.hsd1.va.comcast.net) has joined #jython
[3:16] * projectmoon (~projectmo@c-68-49-168-233.hsd1.va.comcast.net) Quit (Quit: Leaving.)
[3:17] * projectmoon (~projectmo@c-68-49-168-233.hsd1.va.comcast.net) has joined #jython
[3:27] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[3:39] * clajo04_ (~clajo04_@pool-74-108-95-175.nycmny.fios.verizon.net) has joined #jython
[3:45] * plankton (~peretto@187-17-17-100.wln.net.br) has joined #jython
[3:48] * plankton (~peretto@187-17-17-100.wln.net.br) Quit ()
[4:35] * mattbrandt (~evilmarti@c-71-56-218-237.hsd1.co.comcast.net) has joined #jython
[4:38] * lucian (~lucian@188-222-55-189.zone13.bethere.co.uk) Quit (Quit: Leaving...)
[4:42] * projectmoon (~projectmo@c-68-49-168-233.hsd1.va.comcast.net) Quit (Quit: Leaving.)
[4:47] * mattbrandt (~evilmarti@c-71-56-218-237.hsd1.co.comcast.net) Quit (Quit: mattbrandt)
[4:47] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Read error: Connection reset by peer)
[4:47] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[4:59] * jabley (~jabley@fl-64-45-218-122.dyn.embarqhsd.net) has joined #jython
[5:05] * ttmrichter (~ttmrichte@59.172.39.49) has joined #jython
[6:27] * Kami_ (~kami@kamislo.broker.freenet6.net) Quit (Ping timeout: 272 seconds)
[6:49] * pigletto (~quassel@109.243.218.37) has joined #jython
[7:48] * pigletto (~quassel@109.243.218.37) Quit (Remote host closed the connection)
[8:00] * jabley_ (~jabley@fl-64-45-218-122.dyn.embarqhsd.net) has joined #jython
[8:01] * jabley__ (~jabley@fl-64-45-218-122.dyn.embarqhsd.net) has joined #jython
[8:01] * jabley (~jabley@fl-64-45-218-122.dyn.embarqhsd.net) Quit (Ping timeout: 248 seconds)
[8:01] * jabley__ is now known as jabley
[8:04] * jabley_ (~jabley@fl-64-45-218-122.dyn.embarqhsd.net) Quit (Ping timeout: 240 seconds)
[8:06] * jabley (~jabley@fl-64-45-218-122.dyn.embarqhsd.net) Quit (Ping timeout: 260 seconds)
[8:12] * jabley (~jabley@fl-64-45-218-122.dyn.embarqhsd.net) has joined #jython
[8:17] * pigletto (~quassel@188.33.60.200) has joined #jython
[8:25] * jabley (~jabley@fl-64-45-218-122.dyn.embarqhsd.net) Quit (Quit: jabley)
[8:47] * thobe (~Adium@c83-249-252-237.bredband.comhem.se) Quit (Quit: Leaving.)
[9:01] * Oti (~ohumbel@adsl-89-217-71-124.adslplus.ch) Quit (Quit: Oti)
[09:04] == thobe [~Adium@212-162-171-110.skbbip.com] has joined #jython
[09:15] == robbyoconnor [~wakawaka@guifications/user/r0bby] has quit [Ping timeout: 245 seconds]
[09:44] == Oti [~5390f2dc@gateway/web/freenode/ip.83.144.242.220] has joined #jython
[12:53] == pigletto_ [~quassel@109.243.142.70] has joined #jython
[12:54] == jabley [~jabley@fl-64-45-218-122.dyn.embarqhsd.net] has joined #jython
[12:54] == pigletto [~quassel@188.33.60.200] has quit [Ping timeout: 260 seconds]
[13:03] == jabley [~jabley@fl-64-45-218-122.dyn.embarqhsd.net] has quit [Quit: jabley]
[13:38] == clajo04_ [~clajo04_@pool-74-108-95-175.nycmny.fios.verizon.net] has quit [Quit: clajo04_]
[13:46] == lucian [~lucian@188-222-55-189.zone13.bethere.co.uk] has joined #jython
[13:47] == pigletto_ [~quassel@109.243.142.70] has quit [Remote host closed the connection]
[13:52] == clajo04_ [~clajo04_@pool-74-108-95-175.nycmny.fios.verizon.net] has joined #jython
[14:20] == ttmrichter [~ttmrichte@59.172.39.49] has quit [Ping timeout: 260 seconds]
[14:25] == lheuer [~heuer@unaffiliated/lheuer] has joined #jython
[14:28] == clajo05 [~clajo04_@pool-74-108-95-175.nycmny.fios.verizon.net] has joined #jython
[14:28] == clajo04_ [~clajo04_@pool-74-108-95-175.nycmny.fios.verizon.net] has quit [Ping timeout: 240 seconds]
[14:28] == clajo05 has changed nick to clajo04_
[14:28] == clajo04_ [~clajo04_@pool-74-108-95-175.nycmny.fios.verizon.net] has quit [Client Quit]
[14:28] == ttmrichter [~ttmrichte@111.172.29.86] has joined #jython
[14:38] == juneau001 [~juneau@pool-72-69-199-164.chi01.dsl-w.verizon.net] has joined #jython
[14:48] == juneau001 [~juneau@pool-72-69-199-164.chi01.dsl-w.verizon.net] has quit [Quit: Take care...]
[14:57] == clajo04_ [~clajo04_@pool-74-108-95-175.nycmny.fios.verizon.net] has joined #jython
[15:07] == lucian_ [~lucian@188-222-55-189.zone13.bethere.co.uk] has joined #jython
[15:09] == lucian [~lucian@188-222-55-189.zone13.bethere.co.uk] has quit [Read error: Operation timed out]
[15:20] == lucian_ has changed nick to lucian
[15:59] == projectmoon [41cf3382@gateway/web/freenode/ip.65.207.51.130] has joined #jython
[16:47] == skay [~skay@pat1.orbitz.net] has joined #jython
[17:00] == stakkars [~tismer@82.113.119.243] has quit [Ping timeout: 265 seconds]
[17:13] == ttmrichter [~ttmrichte@111.172.29.86] has quit [Ping timeout: 240 seconds]
[17:32] == Oti [~5390f2dc@gateway/web/freenode/ip.83.144.242.220] has quit [Quit: Page closed]
[17:34] == lheuer [~heuer@unaffiliated/lheuer] has quit [Quit: Closing Time]
[18:02] == JythonLogBot [~PircBot@adsl-62-167-122-47.adslplus.ch] has joined #jython
[18:02] -JythonLogBot:#jython- this channel is logged at http://jython.extreme.st/irclogs/
[18:02] == Oti [~ohumbel@adsl-62-167-122-47.adslplus.ch] has joined #jython
[18:03] == stakkars [~tismer@82.113.121.34] has joined #jython
[18:02] * Oti (~ohumbel@adsl-62-167-122-47.adslplus.ch) has joined #jython
[18:03] * stakkars (~tismer@82.113.121.34) has joined #jython
[18:05] * thobe (~Adium@212-162-171-110.skbbip.com) Quit (Quit: Leaving.)
[18:24] * Oti (~ohumbel@adsl-62-167-122-47.adslplus.ch) Quit (Quit: Oti)
[19:58] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[20:02] * r0bby (~wakawaka@guifications/user/r0bby) has joined #jython
[20:06] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Ping timeout: 245 seconds)
[20:25] * r0bby is now known as robbyoconnor
[21:23] * Tordmor (~felix@e180002068.adsl.alicedsl.de) has joined #jython
[21:39] * Tordmor (~felix@e180002068.adsl.alicedsl.de) Quit (Quit: Ex-Chat)
[21:48] * thobe (~Adium@c83-249-252-237.bredband.comhem.se) has joined #jython
[21:57] * verterok (~ggonzalez@unaffiliated/verterok) Quit (Quit: leaving)
[21:59] * jbrendel (ae8fcb1e@gateway/web/freenode/ip.174.143.203.30) has joined #jython
[22:01] <jbrendel> Hello! I'm trying to dynamically import some classes. I can either write eval("from foo import blah") or use __import__. Both works just fine when I'm doing this with Python modules. But when I try to do this with some Java classes then it does not work. Nothing gets imported.
[22:01] <jbrendel> Is there any way to dynamically import Java classes in my Jython program?
[22:02] * lopex (lopex@chello089076044027.chello.pl) has joined #jython
[22:05] * jbrendel (ae8fcb1e@gateway/web/freenode/ip.174.143.203.30) Quit (Quit: Page closed)
[22:23] <agronholm_> uhm, you are dynamically trying to import java classes from java code?
[22:26] * skay (~skay@pat1.orbitz.net) Quit (Quit: skay)
[22:38] <agronholm_> ah, doh
[22:57] * projectmoon (41cf3382@gateway/web/freenode/ip.65.207.51.130) Quit (Quit: Page closed)
[23:13] * Oti (~ohumbel@adsl-62-167-122-47.adslplus.ch) has left #jython

Index

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