diff --git a/src/sh_edraft/__init__.py b/src/sh_edraft/__init__.py index 58fb4bac..d64c519d 100644 --- a/src/sh_edraft/__init__.py +++ b/src/sh_edraft/__init__.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- """ -sh_edraft common python library +sh_edraft ~~~~~~~~~~~~~~~~~~~ -Library to share common classes and models used at sh-edraft.de + :copyright: (c) 2020 sh-edraft.de :license: MIT, see LICENSE for more details. diff --git a/src/sh_edraft/publish/publisher.py b/src/sh_edraft/publish/publisher.py index 75c90ce4..f7e5dc7c 100644 --- a/src/sh_edraft/publish/publisher.py +++ b/src/sh_edraft/publish/publisher.py @@ -153,10 +153,18 @@ class Publisher(PublisherBase): dist_path = dist_path[:len(dist_path) - 1] for file in self._included_files: - if file not in self._excluded_files: + is_file_excluded = False + if file in self._excluded_files: + is_file_excluded = True + else: + for excluded in self._excluded_files: + if file.__contains__(excluded): + is_file_excluded = True + + if not is_file_excluded: output_file = '' if file.startswith('..'): - output_file = file.replace('..', '', 1) + output_file = file.replace('..', '') elif file.startswith('.'): output_file = file.replace('.', '', 1) diff --git a/src/tests/__init__.py b/src/tests/__init__.py new file mode 100644 index 00000000..ce54614e --- /dev/null +++ b/src/tests/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +""" +tests +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'tests' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.0.1' + +from collections import namedtuple + +# imports: + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=0.1) diff --git a/src/test.py b/src/tests/publisher.py similarity index 76% rename from src/test.py rename to src/tests/publisher.py index 6bc8e8d0..b12719fc 100644 --- a/src/test.py +++ b/src/tests/publisher.py @@ -5,7 +5,7 @@ from sh_edraft.publish.model import Template if __name__ == '__main__': templates = [ Template( - '../publish_templates/*_template.txt', + '../../publish_templates/*_template.txt', '*', '', '', @@ -18,7 +18,7 @@ if __name__ == '__main__': Version(2020, 12, 0.1).to_dict() ), Template( - '../publish_templates/*_template.txt', + '../../publish_templates/*_template.txt', 'sh_edraft', 'common python library', 'Library to share common classes and models used at sh-edraft.de', @@ -32,11 +32,11 @@ if __name__ == '__main__': ) ] - publisher = Publisher('./', '../dist', templates) + publisher = Publisher('../', '../../dist', templates) - publisher.exclude('./test.py') - publisher.include('../LICENSE') - publisher.include('../README.md') + publisher.exclude('../tests/') + publisher.include('../../LICENSE') + publisher.include('../../README.md') publisher.create() publisher.publish()