Make JCL work with Python 2.6

Ignore-this: 4d3c82c41facd7129e198c84f6bea0c8

darcs-hash:20090630172004-86b55-3b406a1d347855ea362ab33ce0872a7e52608cf3.gz
This commit is contained in:
David Rousselie
2009-06-30 19:20:04 +02:00
parent f1509d66da
commit 24f81d1e90
2 changed files with 8 additions and 9 deletions

View File

@@ -4,18 +4,18 @@
## Login : David Rousselie <dax@happycoders.org> ## Login : David Rousselie <dax@happycoders.org>
## Started on Wed Aug 9 21:37:35 2006 David Rousselie ## Started on Wed Aug 9 21:37:35 2006 David Rousselie
## $Id$ ## $Id$
## ##
## Copyright (C) 2006 David Rousselie ## Copyright (C) 2006 David Rousselie
## This program is free software; you can redistribute it and/or modify ## 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 ## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or ## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version. ## (at your option) any later version.
## ##
## This program is distributed in the hope that it will be useful, ## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of ## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details. ## GNU General Public License for more details.
## ##
## You should have received a copy of the GNU General Public License ## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software ## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@@ -44,8 +44,7 @@ if __name__ == '__main__':
class MyTestProgram(unittest.TestProgram): class MyTestProgram(unittest.TestProgram):
def runTests(self): def runTests(self):
"""run tests but do not exit after""" """run tests but do not exit after"""
if self.testRunner is None: self.testRunner = unittest.TextTestRunner(verbosity=self.verbosity)
self.testRunner = unittest.TextTestRunner(verbosity=self.verbosity)
self.testRunner.run(self.test) self.testRunner.run(self.test)
logger = logging.getLogger() logger = logging.getLogger()

View File

@@ -448,12 +448,12 @@ class AccountManager(object):
elif account_class_name is None: elif account_class_name is None:
self.__logger.error("account_type and account_class_name are None") self.__logger.error("account_type and account_class_name are None")
return None return None
self.__logger.debug("Looking for " + account_class_name) self.__logger.debug("Looking for " + account_class_name + " class")
for _account_class in self.account_classes: for _account_class in self.account_classes:
if _account_class.__name__.lower() == account_class_name.lower(): if _account_class.__name__.lower() == account_class_name.lower():
self.__logger.debug(account_class_name + " found") self.__logger.debug(account_class_name + " class found")
return _account_class return _account_class
self.__logger.debug(account_class_name + " not found") self.__logger.debug(account_class_name + " class not found")
return None return None
def generate_registration_form(self, lang_class, _account_class, bare_from_jid): def generate_registration_form(self, lang_class, _account_class, bare_from_jid):
@@ -709,7 +709,7 @@ class JCLComponent(Component, object):
signal.signal(signal.SIGTERM, signal.default_int_handler) signal.signal(signal.SIGTERM, signal.default_int_handler)
def disable_signals(self): def disable_signals(self):
"""Enable signals""" """Disable signals"""
if self.signals_enabled: if self.signals_enabled:
self.signals_enabled = False self.signals_enabled = False
signal.signal(signal.SIGINT, signal.default_int_handler) signal.signal(signal.SIGINT, signal.default_int_handler)