Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(5)  |  Derive(0)  |  Import(3)
Decorator to register a regex. Example::

    @regex("(https?://.+)\s?")
    def somefunc(user, channel, text, match_obj):
        pass

``match_obj`` is a :py:class:`re.MatchObject`.

:param regex: A :py:class:`re.RegexObject` or a string representing a
              regular expression.

src/l/a/lala-0.3/lala/plugins/log.py   lala(Download)
import logging.handlers
 
from lala.util import command, msg, regex
 
 

src/l/a/lala-0.3/lala/plugins/last.py   lala(Download)
import lala.config
 
from datetime import datetime
from lala.util import command, msg, regex
 

src/l/a/lala-0.3/lala/plugins/httptitle.py   lala(Download)
import logging
import re
import HTMLParser
 
from lala.util import regex, msg

src/l/a/lala-0.3/test/test_util.py   lala(Download)
    def test_regex(self):
        regex = compile(".*")
        r = util.regex(regex)
        r(regex_f)
        lala.pluginmanager.register_regex.assert_called_once_with(regex, regex_f)
        self.assertRaises(TypeError, util.on_join, f)
 
        r = util.regex("foobar")
        self.assertRaises(TypeError, r, f2)
 

src/l/a/lala-0.3/test/test_pluginmanager.py   lala(Download)
    def test_regex(self):
        self.assertEqual(len(pluginmanager._regexes), 0)
 
        regex = compile(".*")
        r = util.regex(regex)
    def test_disabled_regex(self):
        regex = compile("command")
        c = util.regex(regex)
        c(regex_f)
 
    def test_reenabled_regex(self):
        regex = compile("command")
        c = util.regex(regex)
        c(regex_f)