From da516c96bd0255e7d9f9149e034ab31367b6377c Mon Sep 17 00:00:00 2001 From: ge Date: Fri, 30 Sep 2022 01:23:56 +0300 Subject: [PATCH] change project structure --- Makefile.jinja2 => rsw/Makefile.jinja2 | 0 rsw.py => rsw/__init__.py | 7 +++++-- 2 files changed, 5 insertions(+), 2 deletions(-) rename Makefile.jinja2 => rsw/Makefile.jinja2 (100%) rename rsw.py => rsw/__init__.py (98%) diff --git a/Makefile.jinja2 b/rsw/Makefile.jinja2 similarity index 100% rename from Makefile.jinja2 rename to rsw/Makefile.jinja2 diff --git a/rsw.py b/rsw/__init__.py similarity index 98% rename from rsw.py rename to rsw/__init__.py index 8f18b58..fa4c50a 100644 --- a/rsw.py +++ b/rsw/__init__.py @@ -43,13 +43,14 @@ This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. """ -__version__ = '0.1.0' +__version__ = '0.1.1' import os import sys import shutil import datetime import logging +import importlib.resources import toml import jinja2 @@ -350,7 +351,7 @@ def build(config: dict): write_to_file(html_file_path, html_page) # Copy additional files to build_dir - log.info("Copy static files from '{}' and '{}' to '{}'".format( + log.info("Copying static files from '{}' and '{}' to '{}'".format( config['dirs']['static_dir'], config['dirs']['content_dir'], config['dirs']['build_dir'])) @@ -377,6 +378,8 @@ def init(dirname: str = '.', no_makefile: bool = False): # Make Makefile if not no_makefile: makefile = render_template('Makefile.jinja2', + templates_dir = os.path.dirname( + importlib.resources.path('rsw', 'Makefile.jinja2')), content_dir = DEFAULT_CONFIG['dirs']['content_dir'], static_dir = DEFAULT_CONFIG['dirs']['static_dir'], build_dir = DEFAULT_CONFIG['dirs']['build_dir'],