#NEWLINE# def tokenize( s , channel = None ) : #NEWLINE# #INDENT# 'A utility function to create a Tokenizer and tokenize a string.' #NEWLINE# pipe = False #NEWLINE# brackets = '' #NEWLINE# nested = conf . supybot . commands . nested #NEWLINE# if nested ( ) : #NEWLINE# #INDENT# brackets = conf . get ( nested . brackets , channel ) #NEWLINE# if conf . get ( nested . pipeSyntax , channel ) : #NEWLINE# #INDENT# pipe = True #NEWLINE# #UNINDENT# #UNINDENT# quotes = conf . get ( conf . supybot . commands . quotes , channel ) #NEWLINE# try : #NEWLINE# #INDENT# ret = Tokenizer ( brackets = brackets , pipe = pipe , quotes = quotes ) . tokenize ( s ) #NEWLINE# return ret #NEWLINE# #UNINDENT# except ValueError as e : #NEWLINE# #INDENT# raise SyntaxError ( str ( e ) )