Merge branch 'testing'

This commit is contained in:
Valentin Lorentz 2010-12-22 18:12:28 +01:00
commit 83aca7c651
8 changed files with 47 additions and 15 deletions

View File

@ -39,7 +39,7 @@ msgstr "\"|\" avec rien ne le suivant. Je ne peux évidtemment pas faire un pipe
#: callbacks.py:515 #: callbacks.py:515
msgid "%s is not a valid %s." msgid "%s is not a valid %s."
msgstr "%s n'est pas un %s valide." msgstr "%s n'est pas du type '%s'."
#: callbacks.py:517 #: callbacks.py:517
msgid "That's not a valid %s." msgid "That's not a valid %s."

View File

@ -1,7 +1,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Supybot-fr\n" "Project-Id-Version: Supybot-fr\n"
"POT-Creation-Date: 2010-10-16 12:34+CEST\n" "POT-Creation-Date: 2010-12-12 15:02+CET\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: Valentin Lorentz <progval@gmail.com>\n" "Last-Translator: Valentin Lorentz <progval@gmail.com>\n"
"Language-Team: Supybot-fr <progval@gmail.com>\n" "Language-Team: Supybot-fr <progval@gmail.com>\n"
@ -13,6 +13,14 @@ msgstr ""
"X-Poedit-Country: France\n" "X-Poedit-Country: France\n"
"X-Poedit-SourceCharset: ASCII\n" "X-Poedit-SourceCharset: ASCII\n"
#: plugin.py:103
msgid "configuration variable"
msgstr "variable de configuration"
#: plugin.py:109
msgid "settable configuration variable"
msgstr "variable de configuration modifiable"
#: plugin.py:136 #: plugin.py:136
msgid "" msgid ""
"<group>\n" "<group>\n"

View File

@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2010-10-16 12:34+CEST\n" "POT-Creation-Date: 2010-12-12 15:02+CET\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -15,6 +15,14 @@ msgstr ""
"Generated-By: pygettext.py 1.5\n" "Generated-By: pygettext.py 1.5\n"
#: plugin.py:103
msgid "configuration variable"
msgstr ""
#: plugin.py:109
msgid "settable configuration variable"
msgstr ""
#: plugin.py:136 #: plugin.py:136
#, docstring #, docstring
msgid "" msgid ""

View File

@ -100,13 +100,13 @@ def getConfigVar(irc, msg, args, state):
state.args.append(group) state.args.append(group)
del args[0] del args[0]
except registry.InvalidRegistryName, e: except registry.InvalidRegistryName, e:
state.errorInvalid('configuration variable', str(e)) state.errorInvalid(_('configuration variable'), str(e))
addConverter('configVar', getConfigVar) addConverter('configVar', getConfigVar)
def getSettableConfigVar(irc, msg, args, state): def getSettableConfigVar(irc, msg, args, state):
getConfigVar(irc, msg, args, state) getConfigVar(irc, msg, args, state)
if not hasattr(state.args[-1], 'set'): if not hasattr(state.args[-1], 'set'):
state.errorInvalid('settable configuration variable', state.errorInvalid(_('settable configuration variable'),
state.args[-1]._name) state.args[-1]._name)
addConverter('settableConfigVar', getSettableConfigVar) addConverter('settableConfigVar', getSettableConfigVar)

View File

@ -34,7 +34,7 @@ import dynamicScope
import supybot.utils as utils import supybot.utils as utils
__builtins__['format'] = utils.str.format (__builtins__ if isinstance(__builtins__, dict) else __builtins__.__dict__)['format'] = utils.str.format
class Author(object): class Author(object):
def __init__(self, name=None, nick=None, email=None, **kwargs): def __init__(self, name=None, nick=None, email=None, **kwargs):

View File

@ -37,6 +37,12 @@ from __future__ import division
import time import time
import select import select
import socket import socket
try:
import ssl
SSLError = ssl.SSLError
except:
class SSLError(Exception):
pass
import supybot.log as log import supybot.log as log
import supybot.conf as conf import supybot.conf as conf
@ -61,10 +67,11 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
self.writeCheckTime = None self.writeCheckTime = None
self.nextReconnectTime = None self.nextReconnectTime = None
self.resetDelay() self.resetDelay()
# Only connect to non-SSL servers if self.networkGroup.get('ssl').value and not globals().has_key('ssl'):
if self.networkGroup.get('ssl').value:
drivers.log.error('The Socket driver can not connect to SSL ' drivers.log.error('The Socket driver can not connect to SSL '
'servers. Try the Twisted driver instead.') 'servers for your Python version. Try the '
'Twisted driver instead, or install a Python'
'version that supports SSL (2.6 and greater).')
else: else:
self.connect() self.connect()
@ -139,6 +146,12 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
self.irc.feedMsg(msg) self.irc.feedMsg(msg)
except socket.timeout: except socket.timeout:
pass pass
except SSLError, e:
if e.args[0] == 'The read operation timed out':
pass
else:
self._handleSocketError(e)
return
except socket.error, e: except socket.error, e:
self._handleSocketError(e) self._handleSocketError(e)
return return
@ -175,6 +188,9 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
try: try:
self.conn.connect(server) self.conn.connect(server)
self.conn.settimeout(conf.supybot.drivers.poll()) self.conn.settimeout(conf.supybot.drivers.poll())
if getattr(conf.supybot.networks, self.irc.network).ssl():
assert globals().has_key('ssl')
self.conn = ssl.wrap_socket(self.conn)
self.connected = True self.connected = True
self.resetDelay() self.resetDelay()
except socket.error, e: except socket.error, e:

View File

@ -47,6 +47,6 @@ class DynamicScope(object):
def __setattr__(self, name, value): def __setattr__(self, name, value):
self._getLocals(name)[name] = value self._getLocals(name)[name] = value
__builtins__['dynamic'] = DynamicScope() (__builtins__ if isinstance(__builtins__, dict) else __builtins__.__dict__)['dynamic'] = DynamicScope()
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:

View File

@ -54,14 +54,14 @@ def force(x):
return x() return x()
else: else:
return x return x
__builtins__['force'] = force (__builtins__ if isinstance(__builtins__, dict) else __builtins__.__dict__)['force'] = force
if sys.version_info < (2, 4, 0): if sys.version_info < (2, 4, 0):
def reversed(L): def reversed(L):
"""Iterates through a sequence in reverse.""" """Iterates through a sequence in reverse."""
for i in xrange(len(L) - 1, -1, -1): for i in xrange(len(L) - 1, -1, -1):
yield L[i] yield L[i]
__builtins__['reversed'] = reversed (__builtins__ if isinstance(__builtins__, dict) else __builtins__.__dict__)['reversed'] = reversed
def sorted(iterable, cmp=None, key=None, reversed=False): def sorted(iterable, cmp=None, key=None, reversed=False):
L = list(iterable) L = list(iterable)
@ -74,7 +74,7 @@ if sys.version_info < (2, 4, 0):
L.reverse() L.reverse()
return L return L
__builtins__['sorted'] = sorted (__builtins__ if isinstance(__builtins__, dict) else __builtins__.__dict__)['sorted'] = sorted
import operator import operator
def itemgetter(i): def itemgetter(i):
@ -86,8 +86,8 @@ if sys.version_info < (2, 4, 0):
operator.attrgetter = attrgetter operator.attrgetter = attrgetter
import sets import sets
__builtins__['set'] = sets.Set (__builtins__ if isinstance(__builtins__, dict) else __builtins__.__dict__)['set'] = sets.Set
__builtins__['frozenset'] = sets.ImmutableSet (__builtins__ if isinstance(__builtins__, dict) else __builtins__.__dict__)['frozenset'] = sets.ImmutableSet
import socket import socket
# Some socket modules don't have sslerror, so we'll just make it an error. # Some socket modules don't have sslerror, so we'll just make it an error.