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

def babiloo-2.0.11::core::dictionary::pystardict::StarDict::__getitem__ (   self,
  k 
)

returns translation for word k from cache or not and then caches

Definition at line 506 of file pystardict.py.

00506                             :
        """
        returns translation for word k from cache or not and then caches
        """
        if isinstance(k, int):
            if len(self._dict_cache) > k:
                k = self._dict_cache.keys()[k]
            else:
                k = self.dict.keys()[k]
        if k in self._dict_cache:
            result = self._dict_cache[k]
        else:
            value = self.dict[k]
            self._dict_cache[k] = value
            result = value
        #print result
        return (k, Definition(result))

    def __len__(self):


Generated by  Doxygen 1.6.0   Back to index