Logo Search packages:      
Sourcecode: calibre version File versions

def calibre::ebooks::rtf2xml::hex_2_utf8::Hex2Utf8::__initiate_values (   self  )  [private]

Required:
    Nothing
Set values, including those for the dictionaries.
The file that contains the maps is broken down into many different
sets. For example, for the Symbol font, there is the standard part for
hexidecimal numbers, and the the part for Microsoft charcters. Read
each part in, and then combine them.

Definition at line 135 of file hex_2_utf8.py.

00135                                :
        """
        Required:
            Nothing
        Set values, including those for the dictionaries.
        The file that contains the maps is broken down into many different
        sets. For example, for the Symbol font, there is the standard part for
        hexidecimal numbers, and the the part for Microsoft charcters. Read
        each part in, and then combine them.
        """
        # the default encoding system, the lower map for characters 0 through
        # 128, and the encoding system for Microsoft characters.
        # New on 2004-05-8: the self.__char_map is not in diretory with other
        # modules
        self.__char_file = cStringIO.StringIO(char_set)
        char_map_obj =  get_char_map.GetCharMap(
                char_file = self.__char_file,
                bug_handler = self.__bug_handler,
                )
        up_128_dict = char_map_obj.get_char_map(map=self.__default_char_map)
        bt_128_dict = char_map_obj.get_char_map(map = 'bottom_128')
        ms_standard_dict = char_map_obj.get_char_map(map = 'ms_standard')
        self.__def_dict = {}
        self.__def_dict.update(up_128_dict)
        self.__def_dict.update(bt_128_dict)
        self.__def_dict.update(ms_standard_dict)
        self.__current_dict = self.__def_dict
        self.__current_dict_name = 'default'
        self.__in_caps = 0
        self.__special_fonts_found = 0
        if self.__symbol:
            symbol_base_dict = char_map_obj.get_char_map(map = 'SYMBOL')
            ms_symbol_dict = char_map_obj.get_char_map(map = 'ms_symbol')
            self.__symbol_dict = {}
            self.__symbol_dict.update(symbol_base_dict)
            self.__symbol_dict.update(ms_symbol_dict)
        if self.__wingdings:
            wingdings_base_dict = char_map_obj.get_char_map(map = 'wingdings')
            ms_wingdings_dict = char_map_obj.get_char_map(map = 'ms_wingdings')
            self.__wingdings_dict = {}
            self.__wingdings_dict.update(wingdings_base_dict)
            self.__wingdings_dict.update(ms_wingdings_dict)
        if self.__dingbats:
            dingbats_base_dict = char_map_obj.get_char_map(map = 'dingbats')
            ms_dingbats_dict = char_map_obj.get_char_map(map = 'ms_dingbats')
            self.__dingbats_dict = {}
            self.__dingbats_dict.update(dingbats_base_dict)
            self.__dingbats_dict.update(ms_dingbats_dict)
        # load dictionary for caps, and make a string for the replacement
        self.__caps_uni_dict = char_map_obj.get_char_map(map='caps_uni')
        # # print self.__caps_uni_dict
        # don't think I'll need this
        ##keys = self.__caps_uni_dict.keys()
        ##self.__caps_uni_replace = '|'.join(keys)
00189         self.__preamble_state_dict = {
            'preamble'      :       self.__preamble_func,
            'body'          :       self.__body_func,
            'mi<mk<body-open_'  :   self.__found_body_func,
            'tx<hx<__________'  :   self.__hex_text_func,
            }
        self.__body_state_dict = {
            'preamble'      :       self.__preamble_for_body_func,
            'body'          :       self.__body_for_body_func,
            }
        self.__in_body_dict = {
            'mi<mk<body-open_'  :   self.__found_body_func,
            'tx<ut<__________'  :   self.__utf_to_caps_func,
            'tx<hx<__________'  :   self.__hex_text_func,
            'tx<mc<__________'  :   self.__hex_text_func,
            'tx<nu<__________'  :   self.__text_func,
            'mi<mk<font______'  :   self.__start_font_func,
            'mi<mk<caps______'  :   self.__start_caps_func,
            'mi<mk<font-end__'  :   self.__end_font_func,
            'mi<mk<caps-end__'  :   self.__end_caps_func,
        }
        self.__caps_list = ['false']
        self.__font_list = ['not-defined']
    def __hex_text_func(self, line):


Generated by  Doxygen 1.6.0   Back to index