Skip to content

Commit

Permalink
Improve get_manifest_timestamp function
Browse files Browse the repository at this point in the history
  • Loading branch information
mathbunnyru committed Jan 14, 2024
1 parent 4d2c81c commit d599a7a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tagging/update_wiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ def update_monthly_wiki_page(

def get_manifest_timestamp(manifest_file: Path) -> str:
file_content = manifest_file.read_text()
pos = file_content.find("Build timestamp: ")
timestamp = file_content[pos + 17 : pos + 37]
TIMESTAMP_PREFIX = "Build timestamp: "
TIMESTAMP_LENGTH = 20
timestamp = file_content[
file_content.find(TIMESTAMP_PREFIX) + len(TIMESTAMP_PREFIX) :
][:TIMESTAMP_LENGTH]
# Should be good enough till year 2100
assert timestamp.startswith("20"), timestamp
assert timestamp.endswith("Z"), timestamp
Expand Down

0 comments on commit d599a7a

Please sign in to comment.