def __initiate_values(self): """ Initiate all values. """ self.__text_string = '' self.__field_instruction_string = '' self.__marker = 'mi<mk<inline-fld\n' self.__state = 'before_body' self.__string_obj = field_strings.FieldStrings( run_level=self.__run_level, bug_handler=self.__bug_handler, ) self.__state_dict = { 'before_body': self.__before_body_func, 'in_body': self.__in_body_func, 'field': self.__in_field_func, 'field_instruction': self.__field_instruction_func, } self.__in_body_dict = { 'cw<fd<field_____': self.__found_field_func, } self.__field_dict = { 'cw<fd<field-inst': self.__found_field_instruction_func, 'cw<fd<field_____': self.__found_field_func, 'cw<pf<par-end___': self.__par_in_field_func, 'cw<sc<section___': self.__sec_in_field_func, } self.__field_count = [] # keep track of the brackets self.__field_instruction = [] # field instruction strings self.__symbol = 0 # wheter or not the field is really UTF-8 # (these fields cannot be nested.) self.__field_instruction_string = '' # string that collects field instruction self.__par_in_field = [] # paragraphs in field? self.__sec_in_field = [] # sections in field? self.__field_string = [] # list of field strings
def __initiate_values(self): """ Initiate all values. """ self.__string_obj = field_strings.FieldStrings(bug_handler = self.__bug_handler) self.__state = 'before_body' self.__text_string = '' self.__marker = 'mi<mk<inline-fld\n' self.__state_dict = { 'before_body' : self.__before_body_func, 'body' : self.__body_func, 'bookmark' : self.__bookmark_func, 'toc_index' : self.__toc_index_func, } self.__body_dict = { 'cw<an<book-mk-st' : (self.__found_bookmark_func, 'start'), 'cw<an<book-mk-en' : (self.__found_bookmark_func, 'end'), 'cw<an<toc_______' : (self.__found_toc_index_func, 'toc'), 'cw<an<index-mark' : (self.__found_toc_index_func, 'index'), } ob = 'ob<nu<open-brack.....' cb = 'cb<nu<clos-brack' bk_st = 'cw<an<book-mk-st<nu<true' tx = 'tx<nu<__________<(.*?)' reg_st = ob + bk_st + tx + cb self.__book_start = re.compile(r'%s' % reg_st)