MCPcopy Create free account
hub / github.com/aff3ct/aff3ct / getFileNames

Function getFileNames

scripts/update_refs_headers.py:39–66  ·  view source on GitHub ↗
(currentPath, fileNames)

Source from the content-addressed store, hash-verified

37# =================================================================== FUNCTIONS
38
39def getFileNames(currentPath, fileNames):
40 if os.path.isdir(currentPath):
41 if not os.path.exists(currentPath.replace(args.refsPath, args.resultsPath)):
42 os.makedirs(currentPath.replace(args.refsPath, args.resultsPath))
43
44 files = os.listdir(currentPath)
45 for f in files:
46 if "~" in f:
47 continue
48 newCurrentPath = currentPath + "/" + f
49 if os.path.isdir(newCurrentPath):
50 if args.recursiveScan:
51 getFileNames(newCurrentPath, fileNames)
52 else:
53 getFileNames(newCurrentPath, fileNames)
54 elif os.path.isfile(currentPath):
55 if pathlib.Path(currentPath).suffix in extensions:
56 if args.refsPath == currentPath:
57 basename = os.path.basename(args.refsPath)
58 dirname = args.refsPath.replace(basename, '')
59 args.refsPath = dirname
60 fileNames.append(basename)
61 else:
62 shortenPath = currentPath.replace(args.refsPath + "/", "")
63 shortenPath = shortenPath.replace(args.refsPath, "")
64 fileNames.append(shortenPath)
65 else:
66 print("# (WW) The path '", currentPath, "' does not exist.")
67
68
69def setBackOldParameters(ref, new):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected