Rename support fields to align with eol fields (#338)
Companion PR of https://github.com/endoflife-date/endoflife.date/pull/4931.
This commit is contained in:
@@ -40,7 +40,7 @@ with releasedata.ProductData("aws-lambda") as product_data:
|
||||
block_function_update = dates.parse_date(block_function_update_str) if block_function_update_str else None
|
||||
|
||||
release = product_data.get_release(identifier)
|
||||
# if no date is available, use True for supported runtimes and False for deprecated ones
|
||||
release.set_support(deprecation_date if deprecation_date else is_supported_table)
|
||||
# if no date is available, use False for supported runtimes and True for deprecated ones
|
||||
release.set_eoas(deprecation_date if deprecation_date else not is_supported_table)
|
||||
# if no date is available, use False for supported runtimes and True for deprecated ones
|
||||
release.set_eol(block_function_update if block_function_update else not is_supported_table)
|
||||
|
||||
@@ -37,14 +37,14 @@ class ProductRelease:
|
||||
|
||||
return datetime.strptime(self.data["releaseDate"], "%Y-%m-%d").replace(tzinfo=timezone.utc)
|
||||
|
||||
def set_support(self, new_value: datetime | bool) -> None:
|
||||
self.set_field("support", new_value)
|
||||
def set_eoas(self, new_value: datetime | bool) -> None:
|
||||
self.set_field("eoas", new_value)
|
||||
|
||||
def set_eol(self, new_value: datetime | bool) -> None:
|
||||
self.set_field("eol", new_value)
|
||||
|
||||
def set_extended_support(self, new_value: datetime | bool) -> None:
|
||||
self.set_field("extendedSupport", new_value)
|
||||
def set_eoes(self, new_value: datetime | bool) -> None:
|
||||
self.set_field("eoes", new_value)
|
||||
|
||||
def set_field(self, field: str, new_value: any) -> None:
|
||||
new_value = new_value.strftime("%Y-%m-%d") if isinstance(new_value, datetime) else new_value
|
||||
|
||||
@@ -58,7 +58,7 @@ https://beautiful-soup-4.readthedocs.io/en/latest/index.html?highlight=selector#
|
||||
METHOD = "release_table"
|
||||
SUPPORTED_TYPES = ["date", "string", "range"]
|
||||
DATE_TYPES = ["date"]
|
||||
DATE_FIELDS = ["releaseDate", "lts", "support", "eol", "extendedSupport"]
|
||||
DATE_FIELDS = ["releaseDate", "lts", "eoas", "eol", "eoes"]
|
||||
DEFAULT_REGEX = r"^(?P<value>.+)$"
|
||||
DEFAULT_TEMPLATE = "{{value}}"
|
||||
DEFAULT_RELEASE_REGEX = r"^v?(?P<value>\d+(\.\d+)*)$"
|
||||
|
||||
Reference in New Issue
Block a user