Updated docs
This commit is contained in:
@@ -1,26 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
cpl-cli sh-edraft Common Python library CLI
|
||||
cpl-cli CPL CLI
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
sh-edraft Common Python library Command Line Interface
|
||||
CPL Command Line Interface
|
||||
|
||||
:copyright: (c) 2020 - 2023 sh-edraft.de
|
||||
:license: MIT, see LICENSE for more details.
|
||||
|
||||
"""
|
||||
|
||||
__title__ = 'cpl_cli.validators'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2023 sh-edraft.de'
|
||||
__version__ = '2022.12.1'
|
||||
__title__ = "cpl_cli.validators"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de"
|
||||
__version__ = "2023.2.0"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2022', minor='12', micro='1')
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="2023", minor="2", micro="0")
|
||||
|
||||
@@ -8,8 +8,13 @@ from cpl_core.environment import ApplicationEnvironmentABC
|
||||
|
||||
|
||||
class ProjectValidator(ValidatorABC):
|
||||
|
||||
def __init__(self, config: ConfigurationABC, env: ApplicationEnvironmentABC, workspace: WorkspaceSettings, project: ProjectSettings):
|
||||
def __init__(
|
||||
self,
|
||||
config: ConfigurationABC,
|
||||
env: ApplicationEnvironmentABC,
|
||||
workspace: WorkspaceSettings,
|
||||
project: ProjectSettings,
|
||||
):
|
||||
self._config: ConfigurationABC = config
|
||||
self._env: ApplicationEnvironmentABC = env
|
||||
self._workspace: WorkspaceSettings = workspace
|
||||
@@ -26,5 +31,5 @@ class ProjectValidator(ValidatorABC):
|
||||
|
||||
result = self._project is not None or self._workspace is not None
|
||||
if not result:
|
||||
Error.error('The command requires to be run in an CPL project, but a project could not be found.')
|
||||
Error.error("The command requires to be run in an CPL project, but a project could not be found.")
|
||||
return result
|
||||
|
||||
@@ -4,7 +4,6 @@ from cpl_core.configuration.validator_abc import ValidatorABC
|
||||
|
||||
|
||||
class WorkspaceValidator(ValidatorABC):
|
||||
|
||||
def __init__(self, workspace: WorkspaceSettings):
|
||||
self._workspace = workspace
|
||||
|
||||
@@ -13,5 +12,5 @@ class WorkspaceValidator(ValidatorABC):
|
||||
def validate(self) -> bool:
|
||||
result = self._workspace is not None
|
||||
if not result:
|
||||
Error.error('The command requires to be run in an CPL workspace, but a workspace could not be found.')
|
||||
Error.error("The command requires to be run in an CPL workspace, but a workspace could not be found.")
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user