Lines Matching refs:path
27 def normpath(self, path): argument
28 if path in self.normpathcache:
29 return self.normpathcache[path]
30 newpath = os.path.normpath(path)
31 self.normpathcache[path] = newpath
34 def _callstat(self, path): argument
35 if path in self.statcache:
36 return self.statcache[path]
38 st = os.stat(path)
39 self.statcache[path] = st
42 self.statcache[path] = False
49 def callstat(self, path): argument
50 path = self.normpath(path)
51 self.calllstat(path)
52 return self.statcache[path]
54 def calllstat(self, path): argument
55 path = self.normpath(path)
56 if path in self.lstatcache:
57 return self.lstatcache[path]
60 lst = os.lstat(path)
61 self.lstatcache[path] = lst
63 self.statcache[path] = lst
65 self._callstat(path)
68 self.lstatcache[path] = False
69 self.statcache[path] = False
74 def isfile(self, path): argument
76 st = self.callstat(path)
91 def islink(self, path): argument
93 st = self.calllstat(path)
100 def exists(self, path): argument
102 if self.callstat(path):
106 def lexists(self, path): argument
108 if self.calllstat(path):
112 def stat(self, path): argument
113 return self.callstat(path)
115 def lstat(self, path): argument
116 return self.calllstat(path)
135 if self.isdir(os.path.join(top, name)):
143 new_path = os.path.join(top, name)
152 return (file + os.path.sep).startswith(root)
159 for d in rel_path.split(os.path.sep):
163 if d == os.path.pardir: # '..'
166 start = os.path.dirname(start)
171 (start, have_dir) = self.__realpath(os.path.join(start, d),
184 target = os.path.normpath(os.readlink(file))
186 if not os.path.isabs(target):
187 tdir = os.path.dirname(file)
209 root = os.path.normpath(root)
210 file = os.path.normpath(file)
212 if not root.endswith(os.path.sep):
214 root = root + os.path.sep