예제 #1
0
파일: lineinfo.py 프로젝트: haje01/wzdat
 def __getitem__(self, idx):
     if isinstance(idx, types.SliceType):
         return self._slice(idx)
     idx = normalize_idx(idx, self.count)
     if self.count > idx:
         return self.node, self.kind, self.date, self._file
     raise IndexError
예제 #2
0
파일: lineinfo.py 프로젝트: haje01/wzdat
 def __getitem__(self, idx):
     if isinstance(idx, types.SliceType):
         raise NotImplementedError("Not implemented")
     idx = normalize_idx(idx, self.count)
     if self.count > idx:
         return self._nodes[idx], self._kinds[idx], self._dates[idx], \
             self._files[idx]
     raise IndexError
예제 #3
0
파일: lineinfo.py 프로젝트: haje01/wzdat
 def __getitem__(self, idx):
     if isinstance(idx, types.SliceType):
         return self._slice(idx)
     idx = normalize_idx(idx, self.count)
     if self.impls:
         at = 0
         impl = self.impls[at]
         while impl.count <= idx:
             at += 1
             idx -= impl.count
             impl = self.impls[at]
         return impl[idx]
     raise IndexError