MCPcopy Create free account
hub / github.com/cztomczak/cefpython / clean_build_directories

Function clean_build_directories

tools/build_distrib.py:183–227  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

181
182
183def clean_build_directories():
184 print("[build_distrib.py] Clean build directories")
185
186 # Delete distrib dir
187 if os.path.exists(DISTRIB_DIR):
188 print("[build_distrib.py] Delete directory: {distrib_dir}/"
189 .format(distrib_dir=os.path.basename(DISTRIB_DIR)))
190 shutil.rmtree(DISTRIB_DIR)
191
192 if not NO_REBUILD:
193 # Delete build_cefpython/ dir
194 if os.path.exists(BUILD_CEFPYTHON):
195 print("[build_distirb.py] Delete directory: {dir}/"
196 .format(dir=os.path.basename(BUILD_CEFPYTHON)))
197 shutil.rmtree(BUILD_CEFPYTHON)
198 # Delete cefpython_binary_*/ dirs
199 delete_cefpython_binary_dir("32bit")
200 delete_cefpython_binary_dir("64bit")
201
202 # Delete cef binaries and libraries dirs
203 if not NO_AUTOMATE:
204 # Delete cef binlib dir only if cef_binary dir exists,
205 # otherwise you will end up with cef binlib directory
206 # deleted and script failing further when calling
207 # automate.py --prebuilt-cef.
208 version = get_cefpython_version()
209 # 32-bit
210 if not MAC:
211 postfix2 = get_cef_postfix2_for_arch("32bit")
212 cef_binary_dir = "cef_binary_{cef_version}_{postfix2}"\
213 .format(cef_version=version["CEF_VERSION"],
214 postfix2=postfix2)
215 if len(glob.glob(cef_binary_dir)) != 1:
216 raise Exception("Directory not found: "+cef_binary_dir)
217 # 64-bit
218 postfix2 = get_cef_postfix2_for_arch("64bit")
219 cef_binary_dir = "cef_binary_{cef_version}_windows64"\
220 .format(cef_version=version["CEF_VERSION"],
221 postfix2=postfix2)
222 if len(glob.glob(cef_binary_dir)) != 1:
223 raise Exception("Directory not found: "+cef_binary_dir)
224
225 # Delete
226 delete_cef_binaries_libraries_dir("32bit")
227 delete_cef_binaries_libraries_dir("64bit")
228
229
230def delete_cefpython_binary_dir(arch):

Callers 1

mainFunction · 0.85

Calls 4

get_cefpython_versionFunction · 0.85

Tested by

no test coverage detected