Fix paths for assets

main
Micke Nordin 2 years ago
parent 6af864c5d6
commit ee5aff33c1
Signed by: micke
GPG Key ID: 0DA0A7A5708FE257

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Before

Width:  |  Height:  |  Size: 401 B

After

Width:  |  Height:  |  Size: 401 B

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

@ -12,7 +12,7 @@ from vlc import Instance
from Channel import SVT
from ChannelProvider import ChannelProvider
from Utils import MYPATH, make_bitmap_from_file, make_sized_button
from Utils import make_bitmap_from_file, make_sized_button
WIDTH = int(720 / 2)
HEIGHT = int(1440 / 2)
@ -34,6 +34,7 @@ class Cast(wx.Frame):
:param kw:
"""
self.m_mode = 'normal'
self.asset_path: str = '/usr/share/cast'
url = None
if "url" in kw:
self.m_mode = 'single'
@ -116,7 +117,7 @@ class Cast(wx.Frame):
if not self.m_chromecast_thr.is_alive(
) and not self.m_selected_chromecast:
btm = make_bitmap_from_file('{}/assets/Cast.png'.format(MYPATH), wx.Size(24,24))
btm = make_bitmap_from_file('{}/assets/Cast.png'.format(self.asset_path), wx.Size(24,24))
cast_button = wx.BitmapButton(self.m_panel,
-1,
bitmap=btm,

@ -8,7 +8,7 @@ setuptools.setup(
version="0.0.1",
author="Micke Nordin",
author_email="hej@mic.ke",
data_files = [('share/applications', ['data/org.smolnet.cast.desktop']),],
data_files = [('share/applications', ['data/org.smolnet.cast.desktop']),('share/cast/assets', ['data/assets/'])],
description="A Public Service video player.",
long_description=long_description,
long_description_content_type="text/markdown",

@ -15,7 +15,6 @@ from Items import Item
HEIGHT = int(1440 / 2)
BTN_HEIGHT = 40
SIZE = wx.Size(68,100)
MYPATH = path.dirname(path.abspath(__file__))
SCREEN_WIDTH = int(720 / 2)
BASEPATH = path.join(str(environ.get("HOME")), '.config/cast')
DB_FILE_NAME = 'cast.db'
@ -68,11 +67,11 @@ def add_video(video_id: str,
con.commit()
def get_default_logo(providerid: str = 'default') -> wx.Bitmap:
def get_default_logo(providerid: str = 'default', path: str = '/usr/share/cast') -> wx.Bitmap:
if providerid == 'SVT':
return wx.Bitmap('{}/assets/SVT.png'.format(MYPATH))
return wx.Bitmap('{}/assets/SVT.png'.format(path))
else:
return wx.Bitmap('{}/assets/Default.png'.format(MYPATH))
return wx.Bitmap('{}/assets/Default.png'.format(path))
def get_latest(provider_id: str,
@ -236,42 +235,42 @@ def make_bitmap_from_file(path, size: wx.Size = SIZE) -> wx.Bitmap:
return wx.Bitmap(image)
def resolve_svt_channel(svt_id: str) -> dict:
def resolve_svt_channel(svt_id: str, path: str = '/usr/share/cast') -> dict:
channels = {
"ch-barnkanalen": {
"name":
"Barnkanalen",
"thumbnail":
make_bitmap_from_file('{}/assets/Barnkanalen.png'.format(MYPATH))
make_bitmap_from_file('{}/assets/Barnkanalen.png'.format(path))
},
"ch-svt1": {
"name": "SVT 1",
"thumbnail":
make_bitmap_from_file('{}/assets/SVT1.png'.format(MYPATH))
make_bitmap_from_file('{}/assets/SVT1.png'.format(path))
},
"ch-svt2": {
"name": "SVT 2",
"thumbnail":
make_bitmap_from_file('{}/assets/SVT2.png'.format(MYPATH))
make_bitmap_from_file('{}/assets/SVT2.png'.format(path))
},
"ch-svt24": {
"name":
"SVT 24",
"thumbnail":
make_bitmap_from_file('{}/assets/SVT24.png'.format(MYPATH))
make_bitmap_from_file('{}/assets/SVT24.png'.format(path))
},
"ch-kunskapskanalen": {
"name":
"Kunskapskanalen",
"thumbnail":
make_bitmap_from_file(
'{}/assets/Kunskapskanalen.png'.format(MYPATH))
'{}/assets/Kunskapskanalen.png'.format(path))
},
"feed": {
"name": "Senaste program",
"thumbnail":
make_bitmap_from_file('{}/assets/SVT.png'.format(MYPATH))
make_bitmap_from_file('{}/assets/SVT.png'.format(path))
},
}

@ -1,3 +1,3 @@
[DEFAULT]
Depends3: python3-bs4, python3-wxgtk4.0, python3-feedparser, python3-vlc, python3-pychromecast
Debian-Version: 1
Depends3: python3-bs4, python3-wxgtk4.0, python3-wxgtk-media4.0, python3-feedparser, python3-vlc, python3-pychromecast
Debian-Version: 2

Loading…
Cancel
Save