<s> from . functions import Textile <EOL> class TextileFactory ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , restricted = False , lite = False , sanitize = False , <EOL> noimage = None , auto_link = False , get_sizes = False , <EOL> head_offset = <NUM_LIT:0> , html_type = '<STR_LIT>' ) : <EOL> self . class_parms = { } <EOL> self . method_parms = { } <EOL> if lite and not restricted : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> if restricted : <EOL> self . class_parms [ '<STR_LIT>' ] = True <EOL> self . class_parms [ '<STR_LIT>' ] = lite <EOL> self . method_parms [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> if noimage is None : <EOL> if restricted : <EOL> noimage = True <EOL> else : <EOL> noimage = False <EOL> self . class_parms [ '<STR_LIT>' ] = noimage <EOL> self . method_parms [ '<STR_LIT>' ] = sanitize <EOL> self . class_parms [ '<STR_LIT>' ] = auto_link <EOL> self . class_parms [ '<STR_LIT>' ] = get_sizes <EOL> if int ( head_offset ) not in list ( range ( <NUM_LIT:0> , <NUM_LIT:6> ) ) : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> else : <EOL> self . method_parms [ '<STR_LIT>' ] = head_offset <EOL> if html_type not in [ '<STR_LIT:html>' , '<STR_LIT>' ] : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> else : <EOL> self . method_parms [ '<STR_LIT>' ] = html_type <EOL> def process ( self , text ) : <EOL> return Textile ( ** self . class_parms ) . textile ( text , ** self . method_parms ) </s>
