Check-in [898d5ecf64]
Overview
| Comment: | less debug output |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
898d5ecf64b9d4e6469d47c122a9a317 |
| User & Date: | mario on 2014-05-31 23:32:29 |
| Other Links: | manifest | tags |
Context
|
2014-06-02
| ||
| 01:42 | Allow repainting bookmarks categories after channel init check-in: f17890596d user: mario tags: trunk | |
|
2014-05-31
| ||
| 23:32 | less debug output check-in: 898d5ecf64 user: mario tags: trunk | |
| 23:32 | More recent links, and injecting phase changed to hooks[init] check-in: fc5c5d8ae7 user: mario tags: trunk | |
Changes
Modified channels/_generic.py from [80b2da3d25] to [babd4a0b90].
| ︙ | ︙ | |||
45 46 47 48 49 50 51 |
# generic channel module ---------------------------------------
class GenericChannel(object):
# desc
module = "generic"
title = "GenericChannel"
| | | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# generic channel module ---------------------------------------
class GenericChannel(object):
# desc
module = "generic"
title = "GenericChannel"
homepage = "http://fossil.include-once.org/streamtuner2/"
base_url = ""
listformat = "audio/x-scpls"
audioformat = "audio/mpeg" # fallback value
config = []
has_search = False
# categories
|
| ︙ | ︙ |
Modified channels/shoutcast.py from [1f0bcc3bc0] to [df39e04b9d].
| ︙ | ︙ | |||
59 60 61 62 63 64 65 |
# extracts the category list from shoutcast.com,
# sub-categories are queried per 'AJAX'
def update_categories(self):
html = http.get(self.base_url)
self.categories = []
| | | | | 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# extracts the category list from shoutcast.com,
# sub-categories are queried per 'AJAX'
def update_categories(self):
html = http.get(self.base_url)
self.categories = []
#__print__( dbg.DATA, html )
# <h2>Radio Genres</h2>
rx = re.compile(r'<li((?:\s+id="\d+"\s+class="files")?)><a href="\?action=sub&cat=([\w\s]+)#(\d+)">[\w\s]+</a>', re.S)
sub = []
for uu in rx.findall(html):
#__print__( dbg.DATA, uu )
(main,name,id) = uu
name = urllib.unquote(name)
# main category
if main:
if sub:
self.categories.append(sub)
sub = []
self.categories.append(name)
else:
sub.append(name)
# it's done
#__print__( dbg.PROC, self.categories )
conf.save("cache/categories_shoutcast", self.categories)
pass
# downloads stream list from shoutcast for given category
def update_streams(self, cat, search=""):
|
| ︙ | ︙ |
Modified mygtk.py from [d1f99661a1] to [e851df07e7].
| ︙ | ︙ | |||
130 131 132 133 134 135 136 137 |
# attach cell to column
col.pack_end(rend, expand=cell[3].get("expand",True))
# apply attributes
for attr,val in list(cell[3].items()):
col.add_attribute(rend, attr, val)
# next
datapos += 1
| > < | 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
# attach cell to column
col.pack_end(rend, expand=cell[3].get("expand",True))
# apply attributes
for attr,val in list(cell[3].items()):
col.add_attribute(rend, attr, val)
# next
datapos += 1
#__print__(dbg.INFO, cell, len(cell))
# add column to treeview
widget.append_column(col)
# finalize widget
widget.set_search_column(5) #??
widget.set_search_column(4) #??
widget.set_search_column(3) #??
widget.set_search_column(2) #??
|
| ︙ | ︙ | |||
216 217 218 219 220 221 222 |
# with entries = [main,[sub,sub], title,[...],...]
#
@staticmethod
def tree(widget, entries, title="category", icon=gtk.STOCK_DIRECTORY):
# list types
ls = gtk.TreeStore(str, str)
| | | 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
# with entries = [main,[sub,sub], title,[...],...]
#
@staticmethod
def tree(widget, entries, title="category", icon=gtk.STOCK_DIRECTORY):
# list types
ls = gtk.TreeStore(str, str)
#__print__(dbg.DATA, ".tree", entries)
# add entries
for entry in entries:
if isinstance(entry, (str,unicode)):
main = ls.append(None, [str(entry), icon])
else:
for sub_title in entry:
|
| ︙ | ︙ |