Skip to content

Commit

Permalink
feat: Add version & GitHub icon to app and bump version to release 1
Browse files Browse the repository at this point in the history
  • Loading branch information
LordFckHelmchen committed Jun 20, 2022
1 parent 19bdbb5 commit afefbca
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "wrath-and-glory-space-hulk-generator"
version = "0.9.0"
version = "1.0.0"
description = "Generates Space Hulks based on the tables provided in the Redacted Records rulebook of Cubicle 7"
authors = ["LordFckHelmchen <[email protected]>"]
license = "GPLv3"
Expand Down
17 changes: 16 additions & 1 deletion streamlit_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from typing import Dict

import streamlit as st
import toml
from pydantic import NonNegativeInt

from src.app.layout_file_creator import create_download_file
Expand Down Expand Up @@ -44,7 +45,7 @@ def create_new_hulk_and_layout():
def create_new_layout_if_hulk_is_created() -> None:
if is_space_hulk_created():
st.session_state[LAYOUT_KEY] = SpaceHulkLayouter().create_layout(st.session_state[SPACE_HULK_KEY],
engine=st.session_state[LAYOUT_ENGINE_KEY])
engine=st.session_state[LAYOUT_ENGINE_KEY])
update_metrics()


Expand Down Expand Up @@ -94,7 +95,21 @@ def get_index_of_current_edge_type() -> NonNegativeInt:
SpaceHulkLayouter.DEFAULT_GRAPH_PROPERTIES["graph_attr"]["splines"]))


@st.cache
def get_app_version() -> str:
with open("pyproject.toml", "r") as pyproject_toml_file:
pyproject_toml = toml.load(pyproject_toml_file)
try:
return pyproject_toml["tool"]["poetry"]["version"]
except KeyError:
return ""


st.title("Wrath & Glory Space Hulk Generator")
metadata_cols = st.columns(2)
metadata_cols[0].write(
"[![Star](https://img.shields.io/github/stars/LordFckHelmchen/wrath-and-glory-space-hulk-generator.svg?logo=github&style=social)](https://gitHub.com/LordFckHelmchen/wrath-and-glory-space-hulk-generator)")
metadata_cols[1].write(f"v{get_app_version()}")

for title, file in HELP_DATA.items():
with st.expander(title):
Expand Down

0 comments on commit afefbca

Please sign in to comment.