Skip to content

Commit

Permalink
fixed pyinstaller folder path bug
Browse files Browse the repository at this point in the history
  • Loading branch information
hruzgar committed Oct 17, 2023
1 parent f9d5fad commit a934e15
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions exercises/downloader.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from bs4 import BeautifulSoup
from pathlib import Path
import os
import sys
import requests
import shutil
import exercises.element_paths as element_paths
Expand All @@ -25,8 +27,13 @@ def save_page_to_html(exercise_name, exercise_download_dir, cookie=''):

def copy_custom_css_files(assets_dir):
# copies the custom css files to the exercise directory
shutil.copyfile('./custom_css/styles.css', assets_dir.joinpath('styles.css'))
shutil.copyfile('./custom_css/theme-dark.css', assets_dir.joinpath('theme-dark.css'))
if getattr(sys, 'frozen', False):
shutil.copyfile(Path(sys._MEIPASS).joinpath('custom_css').joinpath('styles.css'), assets_dir.joinpath('styles.css'))
shutil.copyfile(Path(sys._MEIPASS).joinpath('custom_css').joinpath('theme-dark.css'), assets_dir.joinpath('theme-dark.css'))
else:
shutil.copyfile(Path(__file__).parent.parent.joinpath('custom_css').joinpath('styles.css'), assets_dir.joinpath('styles.css'))
shutil.copyfile(Path(__file__).parent.parent.joinpath('custom_css').joinpath('theme-dark.css'), assets_dir.joinpath('theme-dark.css'))
# shutil.copyfile(Path().cwd().joinpath('custom_css').joinpath('theme-dark.css'), assets_dir.joinpath('theme-dark.css'))


def remove_base_tag(soup):
Expand Down
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a934e15

Please sign in to comment.