diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2008-10-24 14:31:33 (GMT) |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2008-10-24 14:31:33 (GMT) |
commit | 1a5469b55b8c25f298a1da7adfe234bee0ebe29d (patch) | |
tree | f26a7aa14f0cee89ee7a5dc6d24232f4e01c44e5 | |
parent | ed0b5e3adc45a5127b16e63230edbc918ac54979 (diff) |
make the regexp global so we don't have to compile it each time
-rw-r--r-- | src/server_plugin.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server_plugin.py b/src/server_plugin.py index d055003..e2dcc83 100644 --- a/src/server_plugin.py +++ b/src/server_plugin.py @@ -44,6 +44,7 @@ from telepathy_plugin import TelepathyPlugin _logger = logging.getLogger('s-p-s.server_plugin') +_MUC_JID_RE = re.compile('.*@.*/.*') class ServerPlugin(TelepathyPlugin): """Telepathy-python-based presence server interface @@ -417,9 +418,8 @@ class ServerPlugin(TelepathyPlugin): # This is horribly protocol specific but should, hopefully, do the # job. jid = self._conn.InspectHandles(1, [handle])[0] - reg = re.compile('.*@.*/.*') - if reg.match(jid) is None: + if _MUC_JID_RE.match(jid) is None: _logger.debug('%s (%d) is not channel specific' % (jid, handle)) return False else: |