Logo Search packages:      
Sourcecode: babiloo version File versions  Download package

def babiloo-2.0.11::core::dictionary::pystardict::_StarDictDict::__init__ (   self,
  dict_prefix,
  container 
)

opens regular or dziped .dict file

Definition at line 349 of file pystardict.py.

00349                                               :
        """
        opens regular or dziped .dict file
        """
        self._container = container

        dict_filename = '%s.dict' % dict_prefix
        dict_filename_dz = '%s.dz' % dict_filename

        try:
            self._file = open(dict_filename, 'rb')
        except IOError:
            try:
                self._file = gzip.open(dict_filename_dz, 'rb')
            except IOError:
                raise Exception('.dict file does not exists')

    def __getitem__(self, word):


Generated by  Doxygen 1.6.0   Back to index