Skip to content

Commit 0406933

Browse files
committed
Fix image paths
1 parent b61d996 commit 0406933

File tree

1 file changed

+9
-37
lines changed

1 file changed

+9
-37
lines changed

openandroidinstaller/openandroidinstaller.py

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,41 +15,19 @@
1515

1616
import os
1717
import sys
18-
import turtle
1918
import webbrowser
19+
import regex as re
2020
from pathlib import Path
2121
from time import sleep
2222
from typing import Callable, Optional
2323

2424
import flet
25-
from flet import (
26-
AlertDialog,
27-
AppBar,
28-
Banner,
29-
Checkbox,
30-
Column,
31-
Container,
32-
Divider,
33-
ElevatedButton,
34-
FilePicker,
35-
FilePickerResultEvent,
36-
FilledButton,
37-
Icon,
38-
Image,
39-
Page,
40-
ProgressBar,
41-
ProgressRing,
42-
Row,
43-
Text,
44-
TextButton,
45-
TextField,
46-
UserControl,
47-
FloatingActionButton,
48-
VerticalDivider,
49-
colors,
50-
icons,
51-
)
52-
from installer_config import InstallerConfig, Step, _load_config
25+
from flet import (AlertDialog, AppBar, Banner, Checkbox, Column, Container,
26+
Divider, ElevatedButton, FilePicker, FilePickerResultEvent,
27+
FilledButton, Icon, Image, Page, ProgressBar, ProgressRing,
28+
Row, Text, TextButton, TextField, UserControl, FloatingActionButton,
29+
VerticalDivider, colors, icons)
30+
from installer_config import Step, _load_config
5331
from loguru import logger
5432
from tool_utils import call_tool_with_command, search_device
5533
from utils import AppState, get_download_link, image_recovery_works_with_device
@@ -65,9 +43,6 @@
6543
CONFIG_PATH = (
6644
Path(__file__).parent.joinpath(Path(os.sep.join(["assets", "configs"]))).resolve()
6745
)
68-
IMAGE_PATH = (
69-
Path(__file__).parent.joinpath(Path(os.sep.join(["assets", "imgs"]))).resolve()
70-
)
7146
BIN_PATH = Path(__file__).parent.joinpath(Path("bin")).resolve()
7247

7348

@@ -77,7 +52,7 @@ def __init__(self, image: str = "placeholder.png"):
7752
self.right_view = Column(expand=True)
7853
self.left_view = Column(
7954
width=600,
80-
controls=[Image(src=IMAGE_PATH.joinpath(Path(image)))],
55+
controls=[Image(src=f"/assets/imgs/{image}")],
8156
expand=True,
8257
horizontal_alignment="center",
8358
)
@@ -658,11 +633,8 @@ def main(page: Page):
658633
page.horizontal_alignment = "center"
659634

660635
# header
661-
image_path = Path(__file__).parent.joinpath(
662-
Path(os.sep.join(["assets", "logo-192x192.png"]))
663-
)
664636
page.appbar = AppBar(
665-
leading=Image(src=image_path, height=40, width=40, border_radius=40),
637+
leading=Image(src=f"/assets/logo-192x192.png", height=40, width=40, border_radius=40),
666638
leading_width=56,
667639
toolbar_height=72,
668640
elevation=0,

0 commit comments

Comments
 (0)