From f84a9e53ab3162eff71effbbd12888ca1f918a52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Sun, 6 Feb 2022 22:37:41 +0100 Subject: [PATCH] change handling of license to GenericText --- PyTeX/format/enums.py | 6 ------ PyTeX/format/formatting_config.py | 20 +++++++------------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/PyTeX/format/enums.py b/PyTeX/format/enums.py index 4aa76ce..f4ac1b0 100644 --- a/PyTeX/format/enums.py +++ b/PyTeX/format/enums.py @@ -6,12 +6,6 @@ class NamingScheme(Enum): clean = 1 -class License(Enum): - LPPL = 0 - GPLv3 = 1 - MIT = 2 - - class TeXType(Enum): TeXPackage = 'TeXPackage' TeXClass = 'TeXClass' diff --git a/PyTeX/format/formatting_config.py b/PyTeX/format/formatting_config.py index ad7ecea..edaafd0 100644 --- a/PyTeX/format/formatting_config.py +++ b/PyTeX/format/formatting_config.py @@ -1,5 +1,5 @@ from typing import List, Optional, Union, Any, Tuple -from .enums import NamingScheme, License +from .enums import NamingScheme from .generic_text import GenericText from .formatterif import Config from .git_version_info import GitVersionInfo @@ -28,7 +28,7 @@ class VersionInfo: class FormattingConfig(Config): def __init__(self): self._naming_scheme: Optional[Union[NamingScheme, str]] = None - self._license: Optional[List[License]] = None + self._license: Optional[GenericText] = None self._description: Optional[str] = None self._include_extra_header: Optional[bool] = None @@ -41,7 +41,6 @@ class FormattingConfig(Config): self._extra_header: Optional[GenericText] = None self._author: Optional[str] = None - self._licenses = Optional[List[GenericText]] self._version: Optional[str] = None self._pytex_info_text: Optional[GenericText] = None self._repo_info_text: Optional[GenericText] = None @@ -57,6 +56,9 @@ class FormattingConfig(Config): def from_yaml(cls, yaml): pass + def to_yaml(self) -> str: + pass + @property def naming_scheme(self) -> NamingScheme: if self._naming_scheme is None: @@ -65,9 +67,9 @@ class FormattingConfig(Config): return self._naming_scheme @property - def license(self) -> list: + def license(self) -> GenericText: if self._license is None: - return [] + return GenericText([]) else: return self._license @@ -127,13 +129,6 @@ class FormattingConfig(Config): else: return self._author - @property - def licenses(self) -> GenericText: - if self._licenses is None: - return GenericText([]) - else: - return self._licenses - @property def version(self) -> str: if self._version is None: @@ -148,7 +143,6 @@ class FormattingConfig(Config): else: return self._pytex_info_text - @property def repo_info_text(self) -> GenericText: if self._repo_info_text is None: