root/branches/gajim_0.2-2/common/thread.py

Revision 196, 1.2 kB (checked in by tab, 4 years ago)

change my mail address

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