Created
June 11, 2019 07:19
-
-
Save codeslord/93cba4fb38cea581b2b84fe044f73165 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copying folders | |
self.output_dir = output_dir | |
if output_dir is not None: | |
if not os.path.isdir(output_dir): | |
os.makedirs(output_dir) | |
html_index_path = pkg_resources.resource_filename("droidbot", "resources/index.html") | |
stylesheets_path = pkg_resources.resource_filename("droidbot", "resources/stylesheets") | |
images_path = pkg_resources.resource_filename("droidbot", "resources/images") | |
target_stylesheets_dir = os.path.join(output_dir, "stylesheets") | |
target_images_dir = os.path.join(output_dir, "images") | |
if os.path.exists(target_stylesheets_dir): | |
shutil.rmtree(target_stylesheets_dir) | |
if os.path.exists(target_images_dir): | |
shutil.rmtree(target_images_dir) | |
shutil.copy(html_index_path, output_dir) | |
shutil.copytree(stylesheets_path, target_stylesheets_dir) | |
shutil.copytree(images_path, target_images_dir) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment