home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.7)
-
- from warnings import warnpy3k
- warnpy3k('the dircache module has been removed in Python 3.0', stacklevel = 2)
- del warnpy3k
- import os
- __all__ = [
- 'listdir',
- 'opendir',
- 'annotate',
- 'reset']
- cache = { }
-
- def reset():
- global cache
- cache = { }
-
-
- def listdir(path):
-
- try:
- (cached_mtime, list) = cache[path]
- del cache[path]
- except KeyError:
- cached_mtime = -1
- list = []
-
- mtime = os.stat(path).st_mtime
- if mtime != cached_mtime:
- list = os.listdir(path)
- list.sort()
- cache[path] = (mtime, list)
- return list
-
- opendir = listdir
-
- def annotate(head, list):
- for i in range(len(list)):
- if os.path.isdir(os.path.join(head, list[i])):
- list[i] = list[i] + '/'
- continue
-
-