home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
-
- class GetCharMap:
-
- def __init__(self, bug_handler, char_file):
- self._GetCharMap__char_file = char_file
- self._GetCharMap__bug_handler = bug_handler
-
-
- def get_char_map(self, map):
- if map == 'ansicpg0':
- map = 'ansicpg1250'
-
- found_map = 0
- map_dict = { }
- self._GetCharMap__char_file.seek(0)
- for line in self._GetCharMap__char_file.readlines():
- if not line.strip():
- continue
-
- begin_element = '<%s>' % map
- end_element = '</%s>' % map
- if not found_map:
- if begin_element in line:
- found_map = 1
-
- begin_element in line
- if end_element in line:
- break
-
- fields = line.split(':')
- fields[1].replace('\\colon', ':')
- map_dict[fields[1]] = fields[3]
-
- if not found_map:
- msg = 'no map found\n'
- msg += 'map is "%s"\n' % (map,)
- raise self._GetCharMap__bug_handler, msg
- found_map
- return map_dict
-
-
-