Logo Search packages:      
Sourcecode: calibre version File versions

def calibre::ebooks::rtf2xml::paragraph_def::ParagraphDef::__write_para_def_beg (   self  )  [private]

Requires:
    nothing
Returns:
    nothing
Logic:
    Print out the beginning of the pargraph definition tag, and the markers
    that let me know when I have reached this tag. (These markers are
    used for later parsing.)

Definition at line 627 of file paragraph_def.py.

00627                                   :
        """
        Requires:
            nothing
        Returns:
            nothing
        Logic:
            Print out the beginning of the pargraph definition tag, and the markers
            that let me know when I have reached this tag. (These markers are
            used for later parsing.)
        """
        self.__get_num_of_style()
        table = self.__att_val_dict.get('in-table')
        if table:
            # del self.__att_val_dict['in-table']
            self.__write_obj.write('mi<mk<in-table__\n')
        else:
            self.__write_obj.write('mi<mk<not-in-tbl\n')
        left_indent = self.__att_val_dict.get('left-indent')
        if left_indent:
            self.__write_obj.write('mi<mk<left_inden<%s\n' % left_indent)
        is_list =  self.__att_val_dict.get('list-id')
        if is_list:
            self.__write_obj.write('mi<mk<list-id___<%s\n' % is_list)
        else:
            self.__write_obj.write('mi<mk<no-list___\n')
        self.__write_obj.write('mi<mk<style-name<%s\n' % self.__att_val_dict['name'])
        self.__write_obj.write(self.__start_marker)
        self.__write_obj.write('mi<tg<open-att__<paragraph-definition')
        self.__write_obj.write('<name>%s' % self.__att_val_dict['name'])
        self.__write_obj.write('<style-number>%s' % self.__att_val_dict['style-num'])
        tabs_list = ['tabs-left', 'tabs-right', 'tabs-decimal', 'tabs-center',
            'tabs-bar', 'tabs']
        """
        for tab_item in tabs_list:
            if self.__att_val_dict[tab_item] != '':
                the_value = self.__att_val_dict[tab_item]
                the_value = the_value[:-1]
                self.__write_obj.write('<%s>%s' % (tab_item, the_value))
        """
        if self.__att_val_dict['tabs'] != '':
            the_value = self.__att_val_dict['tabs']
            # the_value = the_value[:-1]
            self.__write_obj.write('<%s>%s' % ('tabs', the_value))
        keys = self.__att_val_dict.keys()
        keys.sort()
        for key in keys:
            if key != 'name' and key !='style-num' and key != 'in-table'\
              and key not in tabs_list:
                self.__write_obj.write('<%s>%s' % (key, self.__att_val_dict[key]))
        self.__write_obj.write('\n')
        self.__write_obj.write(self.__start2_marker)
        if 'font-style' in keys:
            face = self.__att_val_dict['font-style']
            self.__write_obj.write('mi<mk<font______<%s\n' % face)
        if 'caps' in keys:
            value = self.__att_val_dict['caps']
            self.__write_obj.write('mi<mk<caps______<%s\n' % value)
    def __empty_table_element_func(self, line):


Generated by  Doxygen 1.6.0   Back to index