-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from ryanvilbrandt/0.3.4
0.3.4
- Loading branch information
Showing
6 changed files
with
91 additions
and
16 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from src.scripts.build_site import find_project_root, delete_output_file_space | ||
from src.scripts.build_site import delete_output_file_space | ||
from utils import find_project_root | ||
|
||
find_project_root() | ||
delete_output_file_space() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import os | ||
from typing import Set | ||
|
||
from build_site import read_info, get_extra_comics_list, get_extra_comic_info, get_option | ||
from utils import find_project_root, str_to_list | ||
|
||
|
||
def get_requirements(theme: str) -> Set[str]: | ||
requirements_path = f"your_content/themes/{theme}/scripts/requirements.txt" | ||
if os.path.exists(requirements_path): | ||
with open(requirements_path) as f: | ||
return set(str_to_list(f.read().replace("\r", ""), delimiter="\n")) | ||
return set() | ||
|
||
|
||
def main(): | ||
find_project_root() | ||
comic_info = read_info("your_content/comic_info.ini") | ||
theme = get_option(comic_info, "Comic Settings", "Theme", default="default") | ||
requirements = get_requirements(theme) | ||
print(requirements) | ||
# Build any extra comics that may be needed | ||
for extra_comic in get_extra_comics_list(comic_info): | ||
print(extra_comic) | ||
extra_comic_info = get_extra_comic_info(extra_comic, comic_info) | ||
theme = get_option(extra_comic_info, "Comic Settings", "Theme") | ||
if theme: | ||
requirements.update(get_requirements(theme)) | ||
print(requirements) | ||
with open("src/scripts/requirements_hooks.txt", "w") as f: | ||
f.write("\n".join(requirements)) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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