MCPcopy Create free account
hub / github.com/dobin/SuperMega / prepare_project

Function prepare_project

model/project.py:39–62  ·  view source on GitHub ↗
(project_name)

Source from the content-addressed store, hash-verified

37
38
39def prepare_project(project_name):
40 dst = "{}{}/".format(PATH_WEB_PROJECT, project_name)
41
42 logger.info("-[ Prepare and cleanup project: {}".format(project_name))
43
44 if not os.path.exists(dst):
45 os.makedirs(dst)
46
47 # delete all files in dst directory
48 for file in os.listdir(dst):
49 if file == "project.pickle":
50 continue
51 if file.startswith("."):
52 continue
53 if file.endswith(".exe"):
54 # keep all exes except:
55 if file != "main.exe" and not file.endswith(".infected.exe"):
56 continue
57 if file.endswith(".dll"):
58 # keep all dlls except:
59 if not file.endswith(".infected.dll"):
60 continue
61
62 os.remove(dst + file)

Callers 2

startFunction · 0.90
build_projectFunction · 0.90

Calls 1

formatMethod · 0.80

Tested by

no test coverage detected