]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.2/Lib/dircache.py
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Lib / dircache.py
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Lib/dircache.py b/AppPkg/Applications/Python/Python-2.7.2/Lib/dircache.py
deleted file mode 100644 (file)
index 64135dd..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-"""Read and cache directory listings.\r
-\r
-The listdir() routine returns a sorted list of the files in a directory,\r
-using a cache to avoid reading the directory more often than necessary.\r
-The annotate() routine appends slashes to directories."""\r
-from warnings import warnpy3k\r
-warnpy3k("the dircache module has been removed in Python 3.0", stacklevel=2)\r
-del warnpy3k\r
-\r
-import os\r
-\r
-__all__ = ["listdir", "opendir", "annotate", "reset"]\r
-\r
-cache = {}\r
-\r
-def reset():\r
-    """Reset the cache completely."""\r
-    global cache\r
-    cache = {}\r
-\r
-def listdir(path):\r
-    """List directory contents, using cache."""\r
-    try:\r
-        cached_mtime, list = cache[path]\r
-        del cache[path]\r
-    except KeyError:\r
-        cached_mtime, list = -1, []\r
-    mtime = os.stat(path).st_mtime\r
-    if mtime != cached_mtime:\r
-        list = os.listdir(path)\r
-        list.sort()\r
-    cache[path] = mtime, list\r
-    return list\r
-\r
-opendir = listdir # XXX backward compatibility\r
-\r
-def annotate(head, list):\r
-    """Add '/' suffixes to directories."""\r
-    for i in range(len(list)):\r
-        if os.path.isdir(os.path.join(head, list[i])):\r
-            list[i] = list[i] + '/'\r