Changeset 18594 for lang/python
- Timestamp:
- 09/01/08 23:57:49 (4 months ago)
- Files:
-
- 1 modified
-
lang/python/crochet/chat_allsrc.py (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/python/crochet/chat_allsrc.py
r17940 r18594 13 13 import Image 14 14 15 import threading 16 15 import thread 17 16 """ 18 17 画像取得用スレッド 19 18 """ 20 class ImageGet Thread(threading.Thread):19 class ImageGetFrame(wx.Frame): 21 20 def __init__(self,url,callbackFunc,result): 22 threading.Thread.__init__(self)23 21 self.url = url 24 22 self.func = callbackFunc 25 23 self.result = result 24 def start(self): 25 thread.start_new_thread(self.run(), ()) 26 26 27 def run(self): 27 28 import urllib,time … … 30 31 #time.sleep(1) 31 32 self.func(imagePath,self.result) 33 34 32 35 """ 33 36 twitterにhttpRequestを投げるスレッド 34 37 """ 35 class TwDMHttp Thread(threading.Thread):38 class TwDMHttpFrame(wx.Frame): 36 39 def __init__(self,tw,func): 37 threading.Thread.__init__(self)38 40 self.tw = tw 39 41 self.func = func 42 def start(self): 43 thread.start_new_thread(self.run, ()) 40 44 def run(self): 41 45 #ここに通信処理を書く … … 45 49 twitterにhttpRequestを投げるスレッド 46 50 """ 47 class TwReplyHttp Thread(threading.Thread):51 class TwReplyHttpFrame(wx.Frame): 48 52 def __init__(self,tw,func): 49 threading.Thread.__init__(self)50 53 self.tw = tw 51 54 self.func = func 55 def start(self): 56 57 thread.start_new_thread(self.run, ()) 58 52 59 def run(self): 53 60 #ここに通信処理を書く … … 57 64 twitterにhttpRequestを投げるスレッド 58 65 """ 59 class TwHttp Thread(threading.Thread):66 class TwHttpFrame(wx.Frame): 60 67 def __init__(self,tw,func): 61 threading.Thread.__init__(self)62 68 self.tw = tw 63 69 self.func = func 70 def start(self): 71 thread.start_new_thread(self.run, ()) 72 64 73 def run(self): 65 74 #ここに通信処理を書く … … 89 98 90 99 def Reflesh(self): 91 t = TwDMHttp Thread(self.owner.tw,self.RefleshList)92 t. run()100 t = TwDMHttpFrame(self.owner.tw,self.RefleshList) 101 t.start() 93 102 """ 94 103 最近のfriendsの発言一覧を表示するページ … … 193 202 194 203 def Reflesh(self): 195 t = TwHttp Thread(self.owner.tw,self.RefleshList)196 t. run()204 t = TwHttpFrame(self.owner.tw,self.RefleshList) 205 t.start() 197 206 198 207 def RefleshList(self,a): … … 262 271 263 272 def Reflesh(self): 264 t = TwReplyHttp Thread(self.owner.tw,self.RefleshList)265 t. run()273 t = TwReplyHttpFrame(self.owner.tw,self.RefleshList) 274 t.start() 266 275 267 276 … … 308 317 309 318 def __init__(self, parent=None): 319 #from pit import Pit 320 #twUserdata = Pit.get('twitter.com',{'require' : {'user':'','pass':''}}) 310 321 twUserdata = self.loadUserData(".chat/twdata") 311 322 wx.Frame.__init__(self,None, -1, "crochet") … … 391 402 392 403 def OnUpdate(self, event): 404 self.SetStatusBar(u"新着取得中...") 393 405 self.RefleshTw() 394 self.SetNowTime2StatusBar()395 406 396 407 def OnReplyUpdate(self, event): 408 409 self.SetStatusBar(u"Reply取得中") 397 410 self.replyPage.Reflesh() 398 #self.SetNowTime2StatusBar()399 411 400 412 def OnDMUpdate(self, event): 413 414 self.SetStatusBar(u"DM取得中...") 401 415 self.directPage.Reflesh() 402 #self.SetNowTime2StatusBar() 403 416 417 def SetStatusBar(self,str): 418 419 sb = wx.GetApp().GetTopWindow().GetStatusBar() 420 sb.SetStatusText(str) 404 421 def SetNowTime2StatusBar(self): 405 422 #現在時刻を表示 … … 458 475 #print "urlName:"+urlName 459 476 #thread化したいですね 460 t = ImageGet Thread(urlName,self.WebImageCallback,result)461 t. run()477 t = ImageGetFrame(urlName,self.WebImageCallback,result) 478 t.start() 462 479 463 480 def WebImageCallback(self,imageData,result):
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)