|
Revision 359, 1.3 kB
(checked in by asterix, 4 years ago)
|
|
update my email adress
update copyright
add missing headers
|
-
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 | |
|---|
| 19 | import threading |
|---|
| 20 | import socket |
|---|
| 21 | import time |
|---|
| 22 | import sys |
|---|
| 23 | from common import i18n |
|---|
| 24 | _ = i18n._ |
|---|
| 25 | |
|---|
| 26 | class 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, \ |
|---|
| 31 | name = name) |
|---|
| 32 | # END __init__ |
|---|
| 33 | |
|---|
| 34 | def run(self): |
|---|
| 35 | mod = compile("import plugins.%s" % self.getName(), \ |
|---|
| 36 | self.getName(), "exec") |
|---|
| 37 | try: |
|---|
| 38 | res = eval(mod) |
|---|
| 39 | mod = compile("plugins.%s.%s.plugin(self.queueIn, self.queueOut)" % (self.getName(),self.getName()), self.getName(), "exec") |
|---|
| 40 | res = eval(mod) |
|---|
| 41 | except: |
|---|
| 42 | print _("plugin %s cannot be launched : ") % self.getName() + \ |
|---|
| 43 | str(sys.exc_info()[1][0:]) |
|---|
| 44 | # END run |
|---|
| 45 | # END GajimThread |
|---|