Logo Search packages:      
Sourcecode: calibre version File versions

def calibre::ebooks::rtf2xml::styles::Styles::__in_individual_style_func (   self,
  line 
) [private]

Required:
    line
Returns:
    nothing
Logic:
    Check if the token marks the end of the individual style. (Action
    is the value of the state dictionary, and the only key that will
    match in this function is the end of the individual style.)
    If the end of the individual style is not found, check if the line
    is a control word. If it is, extract the relelvant info and look
    up this info in the tokens dictionary. I want to change
    abbreviated names for longer, more readable ones.
    Write an error message if no key is found for the info.
    If the line is text, add the text to a text string. The text
    string will be the name of the style.
    

Definition at line 266 of file styles.py.

00266                                               :
        """
        Required:
            line
        Returns:
            nothing
        Logic:
            Check if the token marks the end of the individual style. (Action
            is the value of the state dictionary, and the only key that will
            match in this function is the end of the individual style.)
            If the end of the individual style is not found, check if the line
            is a control word. If it is, extract the relelvant info and look
            up this info in the tokens dictionary. I want to change
            abbreviated names for longer, more readable ones.
            Write an error message if no key is found for the info.
            If the line is text, add the text to a text string. The text
            string will be the name of the style.
            """
        action = self.__state_dict.get(self.__token_info)
        if action:
            action(line)
        # have to parse border lines with external module
        elif line[0:5] == 'cw<bd':
            border_dict = self.__border_obj.parse_border(line)
            keys = border_dict.keys()
            for key in keys:
                self.__enter_dict_entry(key, border_dict[key])
        elif self.__token_info in self.__tabs_list:
            action = self.__tabs_dict.get(self.__token_info)
            if action != None:
                action(line)
        elif line[0:2] == 'cw':
            #cw<pf<widow-cntl<nu<true
            info = line[6:16]
            att = self.__token_dict.get(info)
            if att == None :
                if info not in self.__ignore_list:
                    if self.__run_level > 3:
                        msg = 'no value for key %s\n' % info
                        raise self.__bug_handler, msg
            else:
                value = line[20:-1]
                self.__enter_dict_entry(att, value)
        elif line[0:2] == 'tx':
            self.__text_string += line[17:-1]
    def __tab_stop_func(self, line):


Generated by  Doxygen 1.6.0   Back to index