Skip to content
Snippets Groups Projects
thread.py 1.21 KiB
Newer Older
Vincent Hanquez's avatar
Vincent Hanquez committed
##	common/thread.py
##
## Gajim Team:
Yann Leboulanger's avatar
Yann Leboulanger committed
## 	- Yann Le Boulanger <asterix@lagaule.org>
Vincent Hanquez's avatar
Vincent Hanquez committed
## 	- Vincent Hanquez <tab@snarc.org>
Vincent Hanquez's avatar
Vincent Hanquez committed
##
Yann Leboulanger's avatar
Yann Leboulanger committed
##	Copyright (C) 2003-2005 Gajim Team
Vincent Hanquez's avatar
Vincent Hanquez committed
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published
## by the Free Software Foundation; version 2 only.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##

import threading
import socket
import time
Vincent Hanquez's avatar
Vincent Hanquez committed
class GajimThread(threading.Thread): 
	def __init__(self, name = None, queueIn = None, queueOut = None): 
		self.queueIn = queueIn
		self.queueOut = queueOut
nkour's avatar
nkour committed
		threading.Thread.__init__(self, target = self.run, name = name) 
Vincent Hanquez's avatar
Vincent Hanquez committed
	# END __init__
 
	def run(self):
nkour's avatar
nkour committed
		mod = compile('import plugins.%s' % self.getName(), self.getName(), 'exec')
		res = eval(mod)
nkour's avatar
nkour committed
		mod = compile('plugins.%s.%s.plugin(self.queueIn, self.queueOut)' 
		% (self.getName(), self.getName()), self.getName(), 'exec')
		res = eval(mod)
Vincent Hanquez's avatar
Vincent Hanquez committed
	# END run
# END GajimThread