Lines Matching full:path
45 return os.path.basename(sys.argv[0])
48 return os.path.dirname(sys.argv[0])
53 path = from_path
54 if path == None:
55 path = os.path.realpath(sys.argv[0])
56 path = os.path.dirname(path)
57 D("this script seems to be located in: %s" % path)
60 D("probing "+path)
61 if path == "":
64 file = path + "/" + target_file
66 if os.path.isfile(file):
67 D("found %s in %s" % (target_file, path))
70 if path == "":
73 path = os.path.dirname(path)
78 return os.path.dirname(file)
93 path = "/usr/src/linux-headers-" + version
94 D("probing %s for kernel headers" % (path+"/include"))
95 ret = os.path.isdir( path )
97 D("found kernel headers in: %s" % (path + "/include"))
98 return path
214 def create_file_path(path):
217 parent = os.path.dirname(path)
218 #print "parent: %s <- %s" % (parent, path)
222 path = parent
227 if os.path.isdir(dir):
233 for path in paths:
234 if not os.path.isdir(path):
235 callback(path,args)
237 for root, dirs, files in os.walk(path):
244 r, ext = os.path.splitext(f)
248 def cleanup_dir(path):
251 if not os.path.exists(path):
252 os.mkdir(path)
254 for root, dirs, files in os.walk(path, topdown=False):
259 os.remove(os.path.join(root, name))
261 os.rmdir(os.path.join(root, name))
263 def update_file( path, newdata ):
265 if os.path.exists( path ):
267 f = open( path, "r" )
271 D("update_file: cannot read existing file '%s'" % path)
275 D2("update_file: no change to file '%s'" % path )
281 create_file_path(path)
283 D("update_file: cannot create path to '%s'" % path)
286 f = open( path, "w" )
300 def readFile(self,path):
301 #path = os.path.realpath(path)
302 if os.path.exists(path):
303 self.old_files.add(path)
305 def readDir(self,path):
306 #path = os.path.realpath(path)
307 for root, dirs, files in os.walk(path):
316 #dst = os.path.realpath(dst)
318 if os.path.exists(dst):
351 if not os.path.exists(os.path.dirname(dst)):