Added first publisher tests, fixed small bugs
This commit is contained in:
26
src/sh_edraft/publishing/base/__init__.py
Normal file
26
src/sh_edraft/publishing/base/__init__.py
Normal 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)
|
||||
32
src/sh_edraft/publishing/base/publisher_base.py
Normal file
32
src/sh_edraft/publishing/base/publisher_base.py
Normal 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
|
||||
Reference in New Issue
Block a user