def _groupTokenizer(self, string):
        string = cStringIO.StringIO(string)
        lex = shlex.shlex(string, posix=True)
        lex.escape = ""
        lex.wordchars = (
            "abcdfeghijklmnopqrstuvwxyz"
            "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
            "0123456789_.-:[]?*+^$," )
        valid = lex.wordchars + "()"

        while True:
            try:
                token = lex.get_token()
            except __HOLE__, ex:
                raise xmlrpc.Fault(1, "Invalid expression: %s" % ex)

            if token is lex.eof:
                break

            if len(token) == 1 and token not in valid:
                raise xmlrpc.Fault(1, "Unexpected character: %s" % token)

            yield token
dataset/ETHPy150Open marineam/nagcat/python/nagcat/nagios_api.py/NagiosXMLRPC._groupTokenizer