Fixed publisher publish relative path error
This commit is contained in:
parent
96d3ccd8d2
commit
b31c0dd23c
@ -1,10 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- 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
|
:copyright: (c) 2020 sh-edraft.de
|
||||||
:license: MIT, see LICENSE for more details.
|
:license: MIT, see LICENSE for more details.
|
||||||
|
@ -153,10 +153,18 @@ class Publisher(PublisherBase):
|
|||||||
dist_path = dist_path[:len(dist_path) - 1]
|
dist_path = dist_path[:len(dist_path) - 1]
|
||||||
|
|
||||||
for file in self._included_files:
|
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 = ''
|
output_file = ''
|
||||||
if file.startswith('..'):
|
if file.startswith('..'):
|
||||||
output_file = file.replace('..', '', 1)
|
output_file = file.replace('..', '')
|
||||||
|
|
||||||
elif file.startswith('.'):
|
elif file.startswith('.'):
|
||||||
output_file = file.replace('.', '', 1)
|
output_file = file.replace('.', '', 1)
|
||||||
|
25
src/tests/__init__.py
Normal file
25
src/tests/__init__.py
Normal file
@ -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)
|
@ -5,7 +5,7 @@ from sh_edraft.publish.model import Template
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
templates = [
|
templates = [
|
||||||
Template(
|
Template(
|
||||||
'../publish_templates/*_template.txt',
|
'../../publish_templates/*_template.txt',
|
||||||
'*',
|
'*',
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
@ -18,7 +18,7 @@ if __name__ == '__main__':
|
|||||||
Version(2020, 12, 0.1).to_dict()
|
Version(2020, 12, 0.1).to_dict()
|
||||||
),
|
),
|
||||||
Template(
|
Template(
|
||||||
'../publish_templates/*_template.txt',
|
'../../publish_templates/*_template.txt',
|
||||||
'sh_edraft',
|
'sh_edraft',
|
||||||
'common python library',
|
'common python library',
|
||||||
'Library to share common classes and models used at sh-edraft.de',
|
'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.exclude('../tests/')
|
||||||
publisher.include('../LICENSE')
|
publisher.include('../../LICENSE')
|
||||||
publisher.include('../README.md')
|
publisher.include('../../README.md')
|
||||||
|
|
||||||
publisher.create()
|
publisher.create()
|
||||||
publisher.publish()
|
publisher.publish()
|
Loading…
Reference in New Issue
Block a user