root/branches/gajim_0.6/common/thread.py

Revision 515, 1.2 kB (checked in by nk, 4 years ago)

glade fixes

  • Property svn:keywords set to LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
Line 
1##      common/thread.py
2##
3## Gajim Team:
4##      - Yann Le Boulanger <asterix@lagaule.org>
5##      - Vincent Hanquez <tab@snarc.org>
6##
7##      Copyright (C) 2003-2005 Gajim Team
8##
9## This program is free software; you can redistribute it and/or modify
10## it under the terms of the GNU General Public License as published
11## by the Free Software Foundation; version 2 only.
12##
13## This program is distributed in the hope that it will be useful,
14## but WITHOUT ANY WARRANTY; without even the implied warranty of
15## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16## GNU General Public License for more details.
17##
18
19import threading
20import socket
21import time
22import sys
23from common import i18n
24_ = i18n._
25
26class GajimThread(threading.Thread): 
27        def __init__(self, name = None, queueIn = None, queueOut = None): 
28                self.queueIn = queueIn
29                self.queueOut = queueOut
30                threading.Thread.__init__(self, target = self.run, name = name) 
31        # END __init__
32 
33        def run(self):
34                mod = compile('import plugins.%s' % self.getName(), self.getName(), 'exec')
35                res = eval(mod)
36                mod = compile('plugins.%s.%s.plugin(self.queueIn, self.queueOut)' 
37                % (self.getName(), self.getName()), self.getName(), 'exec')
38                res = eval(mod)
39        # END run
40# END GajimThread
Note: See TracBrowser for help on using the browser.