Skip to content

Commit

Permalink
Rotation to generation info
Browse files Browse the repository at this point in the history
* Removed locked mode.

* Rotation to generation info.
  • Loading branch information
iwatkot authored Dec 29, 2024
1 parent c6df40c commit 1aa2778
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 39 deletions.
1 change: 1 addition & 0 deletions maps4fs/generator/texture.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ def info_sequence(self) -> dict[str, Any]:
"bbox",
"map_height",
"map_width",
"rotation",
"minimum_x",
"minimum_y",
"maximum_x",
Expand Down
22 changes: 0 additions & 22 deletions webui/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
STREAMLIT_COMMUNITY_VALUE = "streamlit"
PUBLIC_HOSTNAME_KEY = "PUBLIC_HOSTNAME"
PUBLIC_HOSTNAME_VALUE = "maps4fs"
PUBLIC_PASSWORD_KEY = "PUBLIC_PASSWORD"

DOCS_DIRECTORY = os.path.join(WORKING_DIRECTORY, "docs")
MD_FILES = {
Expand Down Expand Up @@ -78,27 +77,6 @@ def is_public() -> bool:
return os.environ.get(PUBLIC_HOSTNAME_KEY) == PUBLIC_HOSTNAME_VALUE


def public_password_is_correct(password: str) -> bool:
"""Check if the public password is correct.
Arguments:
password (str): The password to check.
Returns:
bool: True if the password is correct, False otherwise.
"""
return password == os.environ.get(PUBLIC_PASSWORD_KEY)


def public_password_is_set() -> bool:
"""Check if the public password is set.
Returns:
bool: True if the public password is set, False otherwise.
"""
return PUBLIC_PASSWORD_KEY in os.environ


def remove_with_delay_without_blocking(
file_path: str,
logger: mfs.Logger,
Expand Down
17 changes: 0 additions & 17 deletions webui/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,6 @@ def __init__(self):
self.logger = mfs.Logger(level="INFO", to_file=False)

self.public = config.is_public()
self.locked = False
if self.public and config.public_password_is_set():
# Maintainance mode is enabled.
self.locked = True
st.warning("The app is in maintenance mode, enter the password or get back later.")

password = st.text_input("Password", type="password", key="password")

if st.button("Enter", key="enter_btn"):
if not config.public_password_is_correct(password):
return
else:
self.locked = False

if self.locked:
return

self.logger.debug("The application launched on a public server: %s", self.public)

self.left_column, self.right_column = st.columns(2, gap="large")
Expand Down

0 comments on commit 1aa2778

Please sign in to comment.