change handling of license to GenericText
This commit is contained in:
parent
a49c9f7d1b
commit
f84a9e53ab
2 changed files with 7 additions and 19 deletions
|
@ -6,12 +6,6 @@ class NamingScheme(Enum):
|
||||||
clean = 1
|
clean = 1
|
||||||
|
|
||||||
|
|
||||||
class License(Enum):
|
|
||||||
LPPL = 0
|
|
||||||
GPLv3 = 1
|
|
||||||
MIT = 2
|
|
||||||
|
|
||||||
|
|
||||||
class TeXType(Enum):
|
class TeXType(Enum):
|
||||||
TeXPackage = 'TeXPackage'
|
TeXPackage = 'TeXPackage'
|
||||||
TeXClass = 'TeXClass'
|
TeXClass = 'TeXClass'
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from typing import List, Optional, Union, Any, Tuple
|
from typing import List, Optional, Union, Any, Tuple
|
||||||
from .enums import NamingScheme, License
|
from .enums import NamingScheme
|
||||||
from .generic_text import GenericText
|
from .generic_text import GenericText
|
||||||
from .formatterif import Config
|
from .formatterif import Config
|
||||||
from .git_version_info import GitVersionInfo
|
from .git_version_info import GitVersionInfo
|
||||||
|
@ -28,7 +28,7 @@ class VersionInfo:
|
||||||
class FormattingConfig(Config):
|
class FormattingConfig(Config):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._naming_scheme: Optional[Union[NamingScheme, str]] = None
|
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._description: Optional[str] = None
|
||||||
|
|
||||||
self._include_extra_header: Optional[bool] = None
|
self._include_extra_header: Optional[bool] = None
|
||||||
|
@ -41,7 +41,6 @@ class FormattingConfig(Config):
|
||||||
|
|
||||||
self._extra_header: Optional[GenericText] = None
|
self._extra_header: Optional[GenericText] = None
|
||||||
self._author: Optional[str] = None
|
self._author: Optional[str] = None
|
||||||
self._licenses = Optional[List[GenericText]]
|
|
||||||
self._version: Optional[str] = None
|
self._version: Optional[str] = None
|
||||||
self._pytex_info_text: Optional[GenericText] = None
|
self._pytex_info_text: Optional[GenericText] = None
|
||||||
self._repo_info_text: Optional[GenericText] = None
|
self._repo_info_text: Optional[GenericText] = None
|
||||||
|
@ -57,6 +56,9 @@ class FormattingConfig(Config):
|
||||||
def from_yaml(cls, yaml):
|
def from_yaml(cls, yaml):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def to_yaml(self) -> str:
|
||||||
|
pass
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def naming_scheme(self) -> NamingScheme:
|
def naming_scheme(self) -> NamingScheme:
|
||||||
if self._naming_scheme is None:
|
if self._naming_scheme is None:
|
||||||
|
@ -65,9 +67,9 @@ class FormattingConfig(Config):
|
||||||
return self._naming_scheme
|
return self._naming_scheme
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def license(self) -> list:
|
def license(self) -> GenericText:
|
||||||
if self._license is None:
|
if self._license is None:
|
||||||
return []
|
return GenericText([])
|
||||||
else:
|
else:
|
||||||
return self._license
|
return self._license
|
||||||
|
|
||||||
|
@ -127,13 +129,6 @@ class FormattingConfig(Config):
|
||||||
else:
|
else:
|
||||||
return self._author
|
return self._author
|
||||||
|
|
||||||
@property
|
|
||||||
def licenses(self) -> GenericText:
|
|
||||||
if self._licenses is None:
|
|
||||||
return GenericText([])
|
|
||||||
else:
|
|
||||||
return self._licenses
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def version(self) -> str:
|
def version(self) -> str:
|
||||||
if self._version is None:
|
if self._version is None:
|
||||||
|
@ -148,7 +143,6 @@ class FormattingConfig(Config):
|
||||||
else:
|
else:
|
||||||
return self._pytex_info_text
|
return self._pytex_info_text
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def repo_info_text(self) -> GenericText:
|
def repo_info_text(self) -> GenericText:
|
||||||
if self._repo_info_text is None:
|
if self._repo_info_text is None:
|
||||||
|
|
Loading…
Reference in a new issue