Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Markdow to format text content of device configs #149

Merged
merged 4 commits into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openandroidinstaller/installer_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def from_file(cls, path):

def _find_config_file(device_code: str, config_path: Path) -> Optional[Path]:
"""Find the config file which is supported by the given device code."""
for path in config_path.rglob("*.yaml"):
for path in config_path.glob("*.yaml"):
with open(path, "r", encoding="utf-8") as stream:
try:
raw_config = dict(yaml.safe_load(stream))
Expand Down
7 changes: 6 additions & 1 deletion openandroidinstaller/styles.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,9 @@ class Markdown(ft.Markdown):
"""Markdown element to replace the markdown element from flet but is selectable."""

def __init__(self, *args, **kwargs):
super().__init__(selectable=True, *args, **kwargs)
super().__init__(
selectable=True,
on_tap_link=lambda e: self.page.launch_url(e.data),
*args,
**kwargs
)
1 change: 0 additions & 1 deletion openandroidinstaller/views/select_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ def init_visuals(
replacing the firmware of the device with a completely custom ROM.
OpenAndroidInstaller works with the [TWRP recovery project](https://twrp.me/about).""",
on_tap_link=lambda e: self.page.launch_url(e.data),
),
actions=[
TextButton("Close", on_click=self.close_close_explain_images_dlg),
Expand Down
3 changes: 2 additions & 1 deletion openandroidinstaller/views/step_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

from styles import (
Text,
Markdown,
)

from views import BaseView
Expand Down Expand Up @@ -119,7 +120,7 @@ def check_advanced_switch(e):
)
]
self.right_view.controls = [
Text(f"{self.step.content}"),
Markdown(f"{self.step.content}"),
]
# basic view depending on step.type
logger.info(f"Starting step of type {self.step.type}.")
Expand Down