Home | History | Annotate | Download | only in tools

Lines Matching full:path

40 def find_dir_of(path):
41 '''return the directory name of 'path', or "." if there is none'''
43 if len(path) > 1 and path[-1] == '/':
44 path = path[:-1]
47 d = os.path.dirname(path)
59 path = from_path
60 if path == None:
61 path = find_dir_of(sys.argv[0])
62 D("this script seems to be located in: %s" % path)
65 if path == "":
66 path = "."
68 file = path + "/" + target_file
71 if os.path.isfile(file):
72 D("found %s in %s" % (target_file, path))
75 if path == ".":
78 path = os.path.dirname(path)
80 path = ""
82 path = "../" + path
83 file = path + target_file
86 if os.path.isfile(file):
87 D("found %s in %s" % (target_file, path))
97 # note that we can't use find_file_from_upwards() since we can't use os.path.abspath
99 # function will return the real path instead, which later creates problems when
104 return os.path.dirname(file)
119 path = "/usr/src/linux-headers-" + version
120 D("probing %s for kernel headers" % (path+"/include"))
121 ret = os.path.isdir( path )
123 D("found kernel headers in: %s" % (path + "/include"))
124 return path
268 def create_file_path(path):
271 parent = os.path.dirname(path)
275 path = parent
280 if os.path.isdir(dir):
286 for path in paths:
287 if not os.path.isdir(path):
288 callback(path,args)
290 for root, dirs, files in os.walk(path):
297 r, ext = os.path.splitext(f)
301 def cleanup_dir(path):
304 if not os.path.exists(path):
305 os.mkdir(path)
307 for root, dirs, files in os.walk(path, topdown=False):
312 os.remove(os.path.join(root, name))
314 os.rmdir(os.path.join(root, name))