Internet radio browser GUI for music/video streams from various directory services.

⌈⌋ ⎇ branch:  streamtuner2


Diff

Differences From Artifact [b9bdcb6542]:

To Artifact [d3d33c0fb0]:


11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31


import re


# Channel Homepage in Toolbar
class ui_cht(object):
    module = __name__

    # Hook toolbar label
    def __init__(self, parent):
        self.label = parent.toolbar_link
        parent.hooks["switch"].append(self.switchy)

    # Update link label
    def switchy(self, meta, *x, **y):
        title = meta.get("title")
        url = meta.get("url")
        domain = re.sub("^.+?//|/.+$", "", url)
        self.label.set_markup("<big><b>{}</b></big>\n<a href='{}'>{}</a>".format(title, url, domain))








|













11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31


import re


# Channel Homepage in Toolbar
class ui_cht(object):
    module = 'ui_cht'

    # Hook toolbar label
    def __init__(self, parent):
        self.label = parent.toolbar_link
        parent.hooks["switch"].append(self.switchy)

    # Update link label
    def switchy(self, meta, *x, **y):
        title = meta.get("title")
        url = meta.get("url")
        domain = re.sub("^.+?//|/.+$", "", url)
        self.label.set_markup("<big><b>{}</b></big>\n<a href='{}'>{}</a>".format(title, url, domain))