Check-in [9d6c4e81f8]
Overview
Comment: | Catch HTTP errors for reload_categories(). Provide a descriptive .placeholder[] and .empty_stub[] stream list for channels reloading. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
9d6c4e81f8588882fb6a102cfef88c61 |
User & Date: | mario on 2015-04-04 01:48:31 |
Other Links: | manifest | tags |
Context
2015-04-04
| ||
01:50 | Use plain module_list() for config_dialog.add_plugins() instead of traversing main.channels and main.features separately. Uses module= lookup with hardwired "channels." and ".py" retrieval. check-in: 9ed03bc901 user: mario tags: trunk | |
01:48 | Catch HTTP errors for reload_categories(). Provide a descriptive .placeholder[] and .empty_stub[] stream list for channels reloading. check-in: 9d6c4e81f8 user: mario tags: trunk | |
01:46 | Moved back to old `mostPolular` method. check-in: 8996e21a01 user: mario tags: trunk | |
Changes
Modified ahttp.py from [eff6de2cac] to [46b2bffbda].
︙ | |||
61 62 63 64 65 66 67 68 69 70 71 72 73 74 | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | + + + + | # combine headers headers = {} if ajax: headers["X-Requested-With"] = "XMLHttpRequest" if referer: headers["Referer"] = (referer if referer else url) #ifdef BLD_DEBUG #srcout raise Exception("Simulated HTTP error") #endif # read if post: r = session.post(url, params=params, headers=headers, timeout=7.5) else: r = session.get(url, params=params, headers=headers, timeout=9.75) |
︙ |
Modified channels/__init__.py from [98bda28d4c] to [f281706365].
1 2 3 4 5 6 7 8 9 10 11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | - - - - + + + + - | # encoding: UTF-8 # api: streamtuner2 # type: base # category: ui # title: Channel plugins # description: Base implementation for channels and feature plugins # version: 1.1 # license: public domain # author: mario # url: http://fossil.include-once.org/streamtuner2/ # pack: |
︙ | |||
95 96 97 98 99 100 101 102 103 104 105 106 107 108 | 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | + + + + | [False, 0, ["favourite", bool, None, {}], ], [False, 0, ["deleted", bool, None, {}], ], [False, 0, ["search_col", str, None, {}], ], [False, 0, ["search_set", bool, None, {}], ], ] rowmap = [] # [state,genre,title,...] field enumeration still needed separately titles = {} # for easier adapting of column titles in datamap # for empty grouping / categories placeholder = [dict(genre="./.", title="Subcategory placeholder", playing="./.", url="none:", listeners=0, bitrate=0, homepage="", state="gtk-folder")] empty_stub = [dict(genre="./.", title="No categories found (HTTP error)", playing="Try ChannelβReload Categories later..", url="none:", listeners=0, bitrate=0, homepage="", state="gtk-stop")] # regex rx_www_url = re.compile("""(www(\.\w+[\w-]+){2,}|(\w+[\w-]+[ ]?\.)+(com|FM|net|org|de|PL|fr|uk))""", re.I) # constructor def __init__(self, parent=None): |
︙ | |||
193 194 195 196 197 198 199 | 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 | - + + + + - + | row[0] = title # switch stream category, # load data, # update treeview content def load(self, category, force=False): |
︙ | |||
352 353 354 355 356 357 358 | 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 | - + - + + - + + + + - + - + - + + | def reload_if_current(self, category): if self.current == category: self.reload() # display .current category, once notebook/channel tab is first opened def first_show(self): |
︙ |
Modified channels/punkcast.py from [b9d872c733] to [b3964ae39a].
︙ | |||
12 13 14 15 16 17 18 | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | - + | # ytANoskYgMb5W64b51jEuJ6Lq3Rmy2tEUcz1WR1pGGiyiIhMDOlQGHZRQRAQRR4CqJ2eUNvbJcAiEYz45NMtKrdvkc8a1G5M81e1RuiGjDpt1CTASKeQytDxowmmZdLpdDl8+QJLBqTxKSYkc0afbOyz # OD/F/fIynhA0wwChazhIpOuNYCJI6hpxPOHiqk1K8+ldthDumFhXnLUHjEZj9DggKyWfbWywPpXHVqBEOKayXubDyl1qx0f0eh1E6GLaRX7aO8NLJjG9PvNLt0kpuJWeMHPTxnan6V81UWmpYacTVN57 # H9uewu01+OPJDle9AY//O+Dj++9yr3wHUnl8PyCTyzL2PE5aPUgYaFlNPDKigGe7VW6U1iDwcXuXzBbz+K5PThMEvQ6xjJjEAi2Z4Wn1mP03FyR1DaU0jUbnGj81IZXLkckoSpUV7JTB0HF4urvH3IMN # jG6XbGGWemeAkc+hNEE0DtCSmngUCkFSixn321iWyVzGImEIVssllAh5e9kkCDV2T05pD4dMTeWpv6ohwghp6opCOOHh1kfcXZzm8S/bPNs/ZOC4mELj4eYGWiT54Z896qMJ9vws4XBE3lRIBeqmDmk/ # Qmnw+YNNlsur/PrbDqv5NFm7SHMwpNbuMggClmYL5JWkqytErKGPPVQmilhLSpbtBE1nxMFhjedHrymkNUrv3KHTuqLvjWl7MQevL+gNXaqNLlGzSyUvUVuEzMzkWVhZYqd6xPc//o6MBfWrAZcdBxnH # zOcy/F1rsf3yFFmtEcWwOZ2h1R8hP5jATGmRQE+wXz0gjiMWihnO2z1qjS6ZQoF76yuU7DSxFFhJC10phmHIhVT8D1yefHn5PzXrAAAAAElFTkSuQmCC # priority: obsolete |
︙ |
Modified channels/surfmusik.py from [08bed30ea2] to [9e4623f402].
︙ | |||
110 111 112 113 114 115 116 | 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | - + | entries = [] i = 0 max = int(conf.max_streams) is_tv = 0 # placeholder category if cat in ["Genres"]: |
︙ |