Skip to content

Commit

Permalink
Change filename for the zip file
Browse files Browse the repository at this point in the history
  • Loading branch information
insolor committed Jun 30, 2024
1 parent d918db9 commit addfdc2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

with column1:
df_version: str = st.selectbox(label="DF version", options=sorted(df_version_options, reverse=True))
operating_systems: str = st.selectbox(
operating_system: str = st.selectbox(
label="Operating system/platform",
options=df_version_options[df_version].operating_systems,
)
Expand All @@ -27,7 +27,7 @@
df_variant: str = st.selectbox(label="DF variant", options=df_version_options[df_version].variants)
dict_entry: DictInfoEntry = st.selectbox(label="Language", options=dict_metadata)

hook_info = hook_metadata.hook_info.get((df_version, df_variant, operating_systems))
hook_info = hook_metadata.hook_info.get((df_version, df_variant, operating_system))

if not hook_info:
st.write("Cannot create package for these parameters")
Expand All @@ -41,13 +41,14 @@
with st.status("Building package...", expanded=True) as status:
root_dir = Path(__file__).parent
build_dir = root_dir / "build"
package_path = root_dir / "dfint.zip"
package_name = f"dfint_{df_version}_{df_variant}_{operating_system}_{dict_entry.code}.zip"
package_path = root_dir / package_name
build_package(
package_path=package_path,
build_dir=build_dir,
hook_info=hook_info,
parts=parts,
is_win=operating_systems.startswith("win"),
is_win=operating_system.startswith("win"),
)
status.update(label="Package ready!", state="complete", expanded=False)

Expand Down
2 changes: 1 addition & 1 deletion package_build/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ def get_hook_metadata() -> list[HookInfoEntry]:
@st.cache_data(show_spinner="Getting dict metadata...", ttl=datetime.timedelta(minutes=15))
def get_dict_metadata() -> list[DictInfoEntry]:
data = get_json(dict_metadata_url)
return [DictInfoEntry.model_validate(item) for item in data]
return [DictInfoEntry.model_validate(item) for item in data if item.get("code")]
1 change: 1 addition & 0 deletions package_build/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def dfhooks_name(self) -> str:

class DictInfoEntry(BaseConfiguredModel):
language: str
code: str
csv: str
font: str
encoding: str
Expand Down

0 comments on commit addfdc2

Please sign in to comment.