#bitfighter IRC Log

Index Search ←Prev date Next date→

IRC Log for 2012-12-12

Timestamps are in GMT/BST.

00:16:32Fordcars Quit (Ping timeout: 245 seconds)
00:55:49Watusimoto Quit (Ping timeout: 264 seconds)
07:06:45kodaws has joined
07:14:44kodaws Quit (Ping timeout: 240 seconds)
07:52:31kodaws has joined
08:40:59kodaws Quit (Read error: Connection reset by peer)
09:06:03watusimoto has joined
09:06:03ChanServ sets mode +o watusimoto
10:39:38sam686 Quit (Ping timeout: 245 seconds)
10:41:18sam686 has joined
10:41:18ChanServ sets mode +v sam686
10:48:18sam686 Quit (Ping timeout: 245 seconds)
10:49:43LordDVG has joined
10:54:59LordDVG Quit (Remote host closed the connection)
11:09:36Martinski has joined
11:11:45Martinskihello guys :)
12:39:56Darrel has joined
13:06:56Darrel_ has joined
13:06:56Darrel Quit (Read error: Connection reset by peer)
13:32:39Darrel_ Quit (Read error: Connection reset by peer)
13:32:56Darrel_ has joined
13:36:28Darrel_ is now known as Darrel
13:49:29Martinskihi
14:22:48Darrel Quit (Read error: Connection reset by peer)
14:53:18watusimotohi
14:53:43watusimotojust fyi -- I will be out most of the evening... so if you don't hear from me, don't feel bad :-)
14:55:48Martinskiwatusimoto here now ?
15:02:08MartinskiI'm having a bit problems with this toastbox
15:02:16Martinskibecause it has different events on which depends the popup itself
15:02:24Martinskiand I want to say when to start the popup
15:41:16Martinskithat's very hard
15:41:25Martinskithe popup shows only on mouseclick
15:41:40Martinskiand I can't understand how to show it when I want in the code ...
15:42:17watusimotosorry, here and there
15:42:32Martinski?
15:42:46watusimotoso you want to know how to trigger it manually?
15:43:39watusimotoThe sample here:
15:43:39watusimotohttp://xoomer.virgilio.it/infinity77/AGW_Docs/toasterbox_module.html
15:43:49watusimotoshows it being triggered with wx.CallLater
15:44:06watusimotoI imagine there must be a wx.Call or some more immediate way to trigger it
15:44:08MartinskiI'm using different sample
15:44:12Martinskisecond
15:44:17MartinskiI'll show you
15:45:21watusimotook, but I think this is just a question of finding the right wx call to launch the thing
15:47:02Martinskihttps://bitbucket.org/driscollis/mousevspython/src/200d057d054e/wxpython_by_example/AGW%20Series/toaster.py
15:47:04Martinskitake a look at this
15:47:12Martinskiin Bind
15:47:25Martinskithe event is a button
15:50:28watusimotoI'd get rid of that; what about calling tb.Play() when you are ready to display the thing?
15:51:04watusimotoyou do your processing of the json, decide you need to popup, create the display, and "play" it
15:53:44MartinskiI'll try
15:53:50Martinskito get the tbPlay out of the class
15:53:56Martinskiand to run it when I want
15:54:01Martinskibut the problem is that
15:54:03Martinskithere are some
15:54:12MartinskiMainLoop()
15:54:17Martinskiand stuff which are very complicated
15:54:30Martinskiand the execution of onButton isn,t very clear
15:54:41watusimotoyou have your main loop which checks the json from time to time
15:54:50Martinskinono
15:54:52MartinskiMainLoop()
15:55:04Martinskiis some kind of part of wx.PySimpleApp()
15:55:18watusimotoah, ok, probably some sort of event listenting thingy?
15:56:15MartinskiI read lots of things about those events
15:56:19Martinskibut it's a total mess :D
15:56:19watusimotook, maybe I see how this works
15:56:27watusimotoapp.MainLoop takes control of everything
15:56:38watusimotoyou set up your listeners, then let mainLoop run
15:56:45watusimotois that more or less correct?
15:56:53MartinskiI think that's correct
15:57:00watusimotook, so you need some sort of timer event
15:57:13watusimotothat you can use to check the json every, say, 5 seconds
15:57:19watusimoto(or whatever)
15:57:29MartinskiI would say some kind of boolean event handler
15:57:32Martinskiif it's true
15:57:34Martinskidisplay something
15:57:37Martinskiif now - don;t popup
15:57:40Martinskidon't*
15:57:46watusimotoright, but you only display something if json changes
15:57:54Martinskiexactly
15:58:04watusimotoso I would see if there is a timer event
15:58:16watusimotowhen that event triggers, you reset the timer, and check the json
15:58:27Martinskihttp://docs.wxwidgets.org/trunk/classwx_timer_event.html
15:58:31Martinskithere is something like that
15:58:36watusimotoif the json has changed, you run the play method on your toaster
15:58:40Martinskibut I can't understand a bit of this :(
15:59:21watusimotoTry using that code as is, with a print statement in the onTimer() method
15:59:34watusimotoevery 10 seconds a message should be printed
16:00:14watusimotowell, add that to your code that has the MainLoop in it
16:00:18Martinskiyou mean, to try the code
16:00:23Martinskiin a different file
16:00:25Martinskijust this one ?
16:00:33watusimotoI'd try it in your existing code
16:00:43watusimotoin either case you'll need a mainloop somewhere
16:00:45Martinskiin the parsing code ?
16:00:48watusimotono
16:01:04Martinskiin the popup code ?
16:01:17watusimotoso the code you showed me before had something that set up an event listener that responded when a button was clicked
16:01:28Martinskiyes
16:01:40Martinskioh, that's c++ code
16:01:40Martinski:D
16:02:01watusimotoI feel like an idiot
16:02:05Martinskime too :D
16:02:28watusimotobut the principle still holds
16:02:38Martinskihttp://wiki.wxpython.org/Timer
16:02:38Martinskihere
16:02:41Martinskithis is the python one
16:02:46watusimotoinstead of a button click listener, you want to have a timer-went-off listener
16:03:00watusimotohttp://www.blog.pythonlibrary.org/2009/08/25/wxpython-using-wx-timers/
16:03:11watusimotoa stand alone prog that uses timers
16:03:12Martinskiok for example
16:03:15Martinski5 seconds passed
16:03:20Martinskiand then the event is triggered
16:03:26Martinskibut I don't want to display the popup
16:03:29watusimotono
16:03:30Martinskibecause there are no new players
16:03:31watusimotoyes
16:03:33watusimotoright
16:03:45watusimotoso the timer goes off after 5 seconds
16:03:52watusimotothen you go and fetch the json
16:03:55watusimotothen you parse it
16:04:16watusimotothen if you want to display the popup, you do it with the play method
16:04:33watusimotothen you reset the timer (if that's needed) and wait for another 5 secs to expire
16:04:38watusimotorepeat
16:05:15Martinskifound this
16:05:17Martinskihttp://www.blog.pythonlibrary.org/2009/08/25/wxpython-using-wx-timers/
16:05:21Martinskiit's similar to my code
16:05:32watusimotoit's also the link I pasted at 05:03 :-)
16:05:41Martinskioh :D:D
16:05:42Martinskisorry ;d
16:05:46watusimotono worries
16:05:57watusimotothat looks like it's at least a slightly relevant example
16:06:27MartinskiI'll try to integrate it in the popup program and change the onButton function with the time function, so for example the popup shows every 5 sec
16:06:36watusimotoyes
16:06:39Martinskiif that works, I'll have to make it just to show if there are changes
16:06:44watusimotoyes
16:06:47watusimotoexactly
16:06:58Martinskiok I am going to try again
16:09:53Martinskido you know what is going to be my Christmas wish ?
16:09:53Martinski:D
16:10:50watusimotosnow?
16:10:54Martinskipopup = wx.PopupWindow()
16:10:58Martinskipopup.trigger()
16:10:58Martinski:D
16:11:04watusimotoha
16:11:20Martinskioh, we have snow now actually :D
16:15:32watusimotoI'm leaving in a couple of minutes for a few hours... any quick questions before I go?
16:15:45Martinskiwhen will you be here :D
16:15:58watusimotoI'm guessing 10 or 11PM tonight
16:16:05watusimotoprobably after your bedtime
16:16:07watusimoto:-)
16:16:12MartinskiI'll wait because
16:16:16Martinskithis is a mustdo
16:16:16Martinski:D
16:16:21Martinskiand do you know if raptor
16:16:22Martinskiwill be here ?
16:16:29watusimotohe won't be
16:16:47watusimotoyou're stuck with just me for a few days
16:16:49Martinskiok, I'll work and try to finish
16:17:08Martinskino problem, you'r enough helpful :)
16:17:20watusimotook; don't wait up too late for me. I'll read the irc logs when I can, so you can leave a msg for me here
16:17:33Martinskiok
16:18:11Martinskibye for now :)
16:28:07watusimotobye
16:32:38watusimoto Quit (Ping timeout: 265 seconds)
16:46:38Martinskithis is super confusing
16:51:05Martinskithe problem is that is uses classes
16:51:15Martinskiand I can't tell it when exactly to popup
16:51:24Martinskithere is no control, because of the mainloop thing ...
17:27:36Watusimoto has joined
17:50:29Watusimoto Quit (Ping timeout: 260 seconds)
17:57:21Martinskiok, I have some progress
17:57:29Martinskiput everything out of classes
17:57:38Martinskiit's now much more simple looking
17:57:48Martinskiand I just have to learn wx.Timer
17:57:50Martinskiand how to use id
17:57:52Martinskiit*
17:59:49Martinskito have a timer which every 5 seconds (for example) gets the info about new players and if there are any, popups the notification
18:35:42Martinskithe problem is I can't understand how Timer works
18:36:03Martinskino information, super complicated and when I try to do timer.Start(1000)
18:36:15Martinskiit doesn't wait 1000 mseconds
18:36:22Martinskijust instantly runs everything ...
19:07:35Watusimoto has joined
19:18:40MartinskiWatusimoto
19:28:59MartinskiI think I am very close
19:29:22Martinskibut I am desperate
19:32:29MartinskiCan't make up with the timer stuff
19:55:45LordDVG has joined
20:01:13Watusimoto Quit (Ping timeout: 255 seconds)
20:18:11CrazyLinuxNerd Quit (Quit: Leaving)
21:14:29LordDVG Quit (Remote host closed the connection)
21:19:47MartinskiWatusimoto I am going to bed now
21:20:19Martinskitomorrow I'll try to write you, maybe will change the tactics ;d
21:20:24Martinski Quit ()
21:28:14koda has joined
23:41:26Watusimoto has joined

Index Search ←Prev date Next date→

These logs were automatically created by BFLogBot on irc.freenode.net.