change handling of license to GenericText

This commit is contained in:
Maximilian Keßler 2022-02-06 22:37:41 +01:00
parent a49c9f7d1b
commit f84a9e53ab
2 changed files with 7 additions and 19 deletions

View file

@ -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'

View file

@ -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: