Added first publisher tests, fixed small bugs

This commit is contained in:
2020-11-24 19:53:24 +01:00
parent 45154950ee
commit cd9d4d3c3d
14 changed files with 118 additions and 72 deletions

View File

@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
"""
sh_edraft.publishing.base
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2020 sh-edraft.de
:license: MIT, see LICENSE for more details.
"""
__title__ = 'sh_edraft.publishing.base'
__author__ = 'Sven Heidemann'
__license__ = 'MIT'
__copyright__ = 'Copyright (c) 2020 sh-edraft.de'
__version__ = '2020.12.5'
from collections import namedtuple
# imports:
from .publisher_base import PublisherBase
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major=2020, minor=12, micro=5)

View File

@@ -0,0 +1,32 @@
from abc import abstractmethod
from typing import Optional
from sh_edraft.logging.base.logger_base import LoggerBase
from sh_edraft.publishing.model.template import Template
from sh_edraft.service.base.service_base import ServiceBase
class PublisherBase(ServiceBase):
@abstractmethod
def __init__(self):
ServiceBase.__init__(self)
self._logger: Optional[LoggerBase] = None
self._source_path: Optional[str] = None
self._dist_path: Optional[str] = None
self._settings: Optional[list[Template]] = None
self._included_files: list[str] = []
self._excluded_files: list[str] = []
@property
@abstractmethod
def source_path(self) -> str: pass
@property
@abstractmethod
def dist_path(self) -> str: pass
@abstractmethod
def publish(self) -> str: pass