| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
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
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520 | +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | <html><head><title>Python: package channels</title>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>channels</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="streamtuner2/channels/__init__.py">/home/mario/projects/streamtuner2/channels/__init__.py</a></font></td></tr></table>
<p><tt># encoding: UTF-8<br>
# api: streamtuner2<br>
# type: class<br>
# category: ui<br>
# title: Channel plugins<br>
# description: Base implementation for channels and feature plugins<br>
# version: 1.7<br>
# license: public domain<br>
# author: mario<br>
# url: <a href="http://fossil.include-once.org/streamtuner2/">http://fossil.include-once.org/streamtuner2/</a><br>
# pack:<br>
# *.py<br>
# config: -<br>
# priority: core<br>
#<br>
# <a href="#GenericChannel">GenericChannel</a> implements the basic GUI functions and defines<br>
# the default channel data structure. It implements fallback logic<br>
# for all other channel implementations. Only `bookmarks` uses it<br>
# directly.<br>
#<br>
# All other plugins don't have a pre-defined Notebook tab in the<br>
# GtkBuilder description. They derive from ChannelPlugins therefore,<br>
# which constructs and registers the required gtk widgets manually.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Package Contents</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a
href="api-channels.bookmarks">bookmarks</a><br>
<a href="channels.cachereset.html">cachereset</a><br>
<a href="channels.configwin.html">configwin</a><br>
<a href="channels.continuous_record.html">continuous_record</a><br>
<a href="channels.delicast.html">delicast</a><br>
<a href="channels.dirble.html">dirble</a><br>
<a href="channels.dnd.html">dnd</a><br>
<a href="channels.exportcat.html">exportcat</a><br>
<a href="channels.favicon.html">favicon</a><br>
<a href="channels.file.html">file</a><br>
<a href="channels.filter_bitrate.html">filter_bitrate</a><br>
<a href="channels.filtermusic.html">filtermusic</a><br>
<a href="channels.global_key.html">global_key</a><br>
<a href="channels.gtk_theme.html">gtk_theme</a><br>
<a href="channels.history.html">history</a><br>
</td><td width="25%" valign=top><a href="channels.housemixes.html">housemixes</a><br>
<a href="channels.internet_radio.html">internet_radio</a><br>
<a href="channels.jamendo.html">jamendo</a><br>
<a href="channels.links.html">links</a><br>
<a href="channels.listenlive.html">listenlive</a><br>
<a href="channels.liveradio.html">liveradio</a><br>
<a href="channels.magnatune.html">magnatune</a><br>
<a href="channels.modarchive.html">modarchive</a><br>
<a href="channels.myoggradio.html">myoggradio</a><br>
<a href="channels.oggicon.html">oggicon</a><br>
<a href="channels.pluginmanager2.html">pluginmanager2</a><br>
<a href="channels.prefstore.html">prefstore</a><br>
<a href="channels.publicradiofan.html">publicradiofan</a><br>
<a href="channels.radiobrowser.html">radiobrowser</a><br>
<a href="channels.radiolist.html">radiolist</a><br>
</td><td width="25%" valign=top><a href="channels.radionet.html">radionet</a><br>
<a href="channels.radionomy.html">radionomy</a><br>
<a href="channels.radiosure.html">radiosure</a><br>
<a href="channels.radiotray.html">radiotray</a><br>
<a href="channels.rcast.html">rcast</a><br>
<a href="channels.reciva.html">reciva</a><br>
<a href="channels.record_stop.html">record_stop</a><br>
<a href="channels.recordflags.html">recordflags</a><br>
<a href="channels.reddit.html">reddit</a><br>
<a href="channels.scripts.html">scripts</a><br>
<a href="channels.search.html">search</a><br>
<a href="channels.shoutcast.html">shoutcast</a><br>
<a href="channels.somafm.html">somafm</a><br>
<a href="channels.specbuttons.html">specbuttons</a><br>
<a href="channels.streamedit.html">streamedit</a><br>
</td><td width="25%" valign=top><a href="channels.streamlicensing.html">streamlicensing</a><br>
<a href="channels.streema.html">streema</a><br>
<a href="channels.surfmusik.html">surfmusik</a><br>
<a href="channels.theme_installer.html">theme_installer</a><br>
<a href="channels.timer.html">timer</a><br>
<a href="channels.tunein.html">tunein</a><br>
<a href="channels.tuner2.html">tuner2</a><br>
<a href="channels.ubuntuusers.html">ubuntuusers</a><br>
<a href="channels.ui_cht.html">ui_cht</a><br>
<a href="channels.useragentswitcher.html">useragentswitcher</a><br>
<a href="channels.version_check.html">version_check</a><br>
<a href="channels.xiph.html">xiph</a><br>
<a href="channels.youtube.html">youtube</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="#FeaturePlugin">FeaturePlugin</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="#GenericChannel">GenericChannel</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="#ChannelPlugin">ChannelPlugin</a>
</font></dt></dl>
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="ChannelPlugin">class <strong>ChannelPlugin</strong></a>(<a href="#GenericChannel">GenericChannel</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt># channel plugin without glade-pre-defined notebook tab<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="#ChannelPlugin">ChannelPlugin</a></dd>
<dd><a href="#GenericChannel">GenericChannel</a></dd>
<dd><a href="#FeaturePlugin">FeaturePlugin</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="ChannelPlugin-gui"><strong>gui</strong></a>(self, parent)</dt></dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>module</strong> = 'abstract'</dl>
<hr>
Methods inherited from <a href="#GenericChannel">GenericChannel</a>:<br>
<dl><dt><a name="ChannelPlugin-__init__"><strong>__init__</strong></a>(self, parent<font color="#909090">=None</font>)</dt><dd><tt># constructor</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-cache"><strong>cache</strong></a>(self)</dt><dd><tt># Read previous channel/stream data, if there's any</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-columns"><strong>columns</strong></a>(self, entries<font color="#909090">=None</font>)</dt><dd><tt># Just wraps uikit.<a href="#ChannelPlugin-columns">columns</a>() to retain liststore, rowmap and pix_entry</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-currentcat"><strong>currentcat</strong></a>(self)</dt><dd><tt># Selected category (current state from Gtk TreeModel)</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-deleted_streams"><strong>deleted_streams</strong></a>(self, new, old)</dt><dd><tt># Finds differences in new/old streamlist, marks deleted with flag</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-display_categories"><strong>display_categories</strong></a>(self)</dt><dd><tt># Refresh category treeview</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-first_show"><strong>first_show</strong></a>(self)</dt><dd><tt># Display .current category, once notebook/channel tab is first opened</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-insert_rows"><strong>insert_rows</strong></a>(self, rows, y<font color="#909090">=None</font>)</dt><dd><tt># Insert/append new station rows - used by importing/drag'n'drop plugins</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-iter_cats"><strong>iter_cats</strong></a>(self, name, model, iter)</dt><dd><tt># Iterate over children to find current category</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-load"><strong>load</strong></a>(self, category, force<font color="#909090">=False</font>, y<font color="#909090">=None</font>)</dt><dd><tt># Called on switching genre/category, or loading a genre for the first time.<br>
# Either fetches new stream data, or displays list from cache.</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-model_iter"><strong>model_iter</strong></a>(self)</dt><dd><tt># Return ListStore <a href="__builtin__.html#object">object</a> and Iterator for currently selected row in gtk.TreeView station list</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-play"><strong>play</strong></a>(self)</dt><dd><tt># Invoke action.<a href="#ChannelPlugin-play">play</a>() for current station.<br>
# Can be overridden to provide channel-specific "play" alternative</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-postprocess"><strong>postprocess</strong></a>(self, streams)</dt><dd><tt># Stream list cleanup - invoked directly after <a href="#ChannelPlugin-reload">reload</a>(),<br>
# callbacks can remove entries, or just update fields.</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-postprocess_filter_homepage"><strong>postprocess_filter_homepage</strong></a>(self, row, channel)</dt><dd><tt># Deduce homepage URLs from title<br>
# by looking for www.xyz.com domain names</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-postprocess_filter_required_fields"><strong>postprocess_filter_required_fields</strong></a>(self, row, channel)</dt><dd><tt># Filter entries without title or url</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-prepare"><strong>prepare</strong></a>(self, streams)</dt><dd><tt># Prepare stream list for display (called immediataly before .<a href="#ChannelPlugin-columns">columns</a>() refreshing)</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-prepare_filter_icons"><strong>prepare_filter_icons</strong></a>(self, row)</dt><dd><tt># state icon: bookmark star, or deleted mark</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-progress"><strong>progress</strong></a>(self, max, i<font color="#909090">=None</font>)</dt><dd><tt># sets updating progress bar for .update_streams or .reload_categores</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-record"><strong>record</strong></a>(self)</dt><dd><tt># Start streamripper/youtube-dl/etc</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-reload"><strong>reload</strong></a>(self)</dt><dd><tt># Reload current station list</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-reload_categories"><strong>reload_categories</strong></a>(self)</dt><dd><tt># Update categories, save, and display</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-reload_if_current"><strong>reload_if_current</strong></a>(self, category)</dt><dd><tt># Update streams pane if currently selected (used by bookmarks.links channel)</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-row"><strong>row</strong></a>(self)</dt><dd><tt># Currently selected entry in stations list, return complete data dict</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-row_icon"><strong>row_icon</strong></a>(self, gtkIcon<font color="#909090">='gtk-about'</font>)</dt><dd><tt># Inject status icon into currently selected row (used by main.bookmark() call)</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-rowno"><strong>rowno</strong></a>(self)</dt><dd><tt># Convert ListStore iter to row number</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-save"><strong>save</strong></a>(self)</dt><dd><tt># Store current streams data</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-select_current"><strong>select_current</strong></a>(self, name)</dt><dd><tt># Traverse category TreeModel to set current, expand parent nodes</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-selected"><strong>selected</strong></a>(self, name<font color="#909090">='url'</font>)</dt><dd><tt># Fetches a single varname from currently selected station entry</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-stations"><strong>stations</strong></a>(self)</dt><dd><tt># Get list of stations in current category</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-str_from_struct"><strong>str_from_struct</strong></a>(self, d)</dt><dd><tt># Retrieve first list value, or key from dict (-- used to get first category on init)</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-switch"><strong>switch</strong></a>(self)</dt></dl>
<dl><dt><a name="ChannelPlugin-update_datamap"><strong>update_datamap</strong></a>(self, search<font color="#909090">='name'</font>, title<font color="#909090">=None</font>)</dt><dd><tt># Create private copy of .datamap and modify entries (title= rewrites)</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-update_streams_partially_done"><strong>update_streams_partially_done</strong></a>(self, entries)</dt><dd><tt># Called occasionally (by some plugins) while updating station list</tt></dd></dl>
<hr>
Data descriptors inherited from <a href="#GenericChannel">GenericChannel</a>:<br>
<dl><dt><strong>current</strong></dt>
</dl>
<hr>
Data and other attributes inherited from <a href="#GenericChannel">GenericChannel</a>:<br>
<dl><dt><strong>audioformat</strong> = 'audio/mpeg'</dl>
<dl><dt><strong>base_url</strong> = ''</dl>
<dl><dt><strong>categories</strong> = []</dl>
<dl><dt><strong>catmap</strong> = {}</dl>
<dl><dt><strong>datamap</strong> = [['', 20, ['state', <type 'str'>, 'pixbuf', {}]], ['Genre', 65, ['genre', <type 'str'>, 't', {}]], ['Station Title', 275, ['title', <type 'str'>, 'text', {'cell-background': 12, 'cell-background-set': 13, 'strikethrough': 11}], ['favicon', <type 'gtk.gdk.Pixbuf'>, 'pixbuf', {}]], ['Now Playing', 185, ['playing', <type 'str'>, 'text', {'strikethrough': 11}]], ['Listeners', 45, ['listeners', <type 'int'>, 't', {'strikethrough': 11}]], ['Bitrate', 35, ['bitrate', <type 'int'>, 't', {}]], ['Homepage', 160, ['homepage', <type 'str'>, 't', {'underline': 10}]], [False, 25, ['url', <type 'str'>, 't', {'strikethrough': 11}]], [False, 20, ['format', <type 'str'>, None, {}]], [False, 0, ['favourite', <type 'bool'>, None, {}]], [False, 0, ['deleted', <type 'bool'>, None, {}]], [False, 0, ['search_col', <type 'str'>, None, {}]], [False, 0, ['search_set', <type 'bool'>, None, {}]]]</dl>
<dl><dt><strong>empty_stub</strong> = [{'bitrate': 0, 'genre': './.', 'homepage': '', 'listeners': 0, 'playing': 'Try Channel<font color="#c040c0">\xe2\x86\x92</font>Reload Categories later..', 'state': 'gtk-dialog-error', 'title': 'No categories found (website error)', 'url': 'none:'}]</dl>
<dl><dt><strong>fixed_size</strong> = [24, 24]</dl>
<dl><dt><strong>gtk_cat</strong> = None</dl>
<dl><dt><strong>gtk_list</strong> = None</dl>
<dl><dt><strong>has_search</strong> = False</dl>
<dl><dt><strong>img_resize</strong> = None</dl>
<dl><dt><strong>listformat</strong> = 'pls'</dl>
<dl><dt><strong>ls</strong> = None</dl>
<dl><dt><strong>meta</strong> = {'config': []}</dl>
<dl><dt><strong>nothing_found</strong> = [{'bitrate': 0, 'genre': './.', 'listeners': 0, 'playing': 'Notice', 'state': 'gtk-no', 'title': 'No contents found on directory server'}]</dl>
<dl><dt><strong>pix_entry</strong> = None</dl>
<dl><dt><strong>placeholder</strong> = [{'bitrate': 0, 'genre': './.', 'homepage': '', 'listeners': 0, 'playing': './.', 'state': 'gtk-info', 'title': 'Subcategory placeholder', 'url': 'none:'}]</dl>
<dl><dt><strong>postprocess_filters</strong> = []</dl>
<dl><dt><strong>prepare_filters</strong> = []</dl>
<dl><dt><strong>progress_state</strong> = 1</dl>
<dl><dt><strong>rowmap</strong> = []</dl>
<dl><dt><strong>rx_www_url</strong> = <_sre.SRE_Pattern object></dl>
<dl><dt><strong>shown</strong> = None</dl>
<dl><dt><strong>streams</strong> = {}</dl>
<dl><dt><strong>titles</strong> = {}</dl>
<hr>
Methods inherited from <a href="#FeaturePlugin">FeaturePlugin</a>:<br>
<dl><dt><a name="ChannelPlugin-init2"><strong>init2</strong></a>(self, parent, *k, **kw)</dt><dd><tt># optionally to be overriden by plugins (run after base __init__)</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-status"><strong>status</strong></a>(self, *args, **kw)</dt><dd><tt># Statusbar stub (defers to parent/main window, if in GUI mode)</tt></dd></dl>
<dl><dt><a name="ChannelPlugin-warn"><strong>warn</strong></a>(self, text, *args, **kw)</dt><dd><tt># Statusbar with highlighting and default icon</tt></dd></dl>
<hr>
Data descriptors inherited from <a href="#FeaturePlugin">FeaturePlugin</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<hr>
Data and other attributes inherited from <a href="#FeaturePlugin">FeaturePlugin</a>:<br>
<dl><dt><strong>parent</strong> = None</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="FeaturePlugin">class <strong>FeaturePlugin</strong></a>(<a
href="#object">__builtin__.object</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt># Base class for plugins (features or channels)<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="FeaturePlugin-__init__"><strong>__init__</strong></a>(self, parent, *k, **kw)</dt><dd><tt># minimum setup for ChannelPlugins and feature hooks</tt></dd></dl>
<dl><dt><a name="FeaturePlugin-init2"><strong>init2</strong></a>(self, parent, *k, **kw)</dt><dd><tt># optionally to be overriden by plugins (run after base __init__)</tt></dd></dl>
<dl><dt><a name="FeaturePlugin-status"><strong>status</strong></a>(self, *args, **kw)</dt><dd><tt># Statusbar stub (defers to parent/main window, if in GUI mode)</tt></dd></dl>
<dl><dt><a name="FeaturePlugin-warn"><strong>warn</strong></a>(self, text, *args, **kw)</dt><dd><tt># Statusbar with highlighting and default icon</tt></dd></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>meta</strong> = {'config': []}</dl>
<dl><dt><strong>module</strong> = ''</dl>
<dl><dt><strong>parent</strong> = None</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="GenericChannel">class <strong>GenericChannel</strong></a>(<a href="#FeaturePlugin">FeaturePlugin</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt># Generic channel module<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="#GenericChannel">GenericChannel</a></dd>
<dd><a href="#FeaturePlugin">FeaturePlugin</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="GenericChannel-__init__"><strong>__init__</strong></a>(self, parent<font color="#909090">=None</font>)</dt><dd><tt># constructor</tt></dd></dl>
<dl><dt><a name="GenericChannel-cache"><strong>cache</strong></a>(self)</dt><dd><tt># Read previous channel/stream data, if there's any</tt></dd></dl>
<dl><dt><a name="GenericChannel-columns"><strong>columns</strong></a>(self, entries<font color="#909090">=None</font>)</dt><dd><tt># Just wraps uikit.<a href="#GenericChannel-columns">columns</a>() to retain liststore, rowmap and pix_entry</tt></dd></dl>
<dl><dt><a name="GenericChannel-currentcat"><strong>currentcat</strong></a>(self)</dt><dd><tt># Selected category (current state from Gtk TreeModel)</tt></dd></dl>
<dl><dt><a name="GenericChannel-deleted_streams"><strong>deleted_streams</strong></a>(self, new, old)</dt><dd><tt># Finds differences in new/old streamlist, marks deleted with flag</tt></dd></dl>
<dl><dt><a name="GenericChannel-display_categories"><strong>display_categories</strong></a>(self)</dt><dd><tt># Refresh category treeview</tt></dd></dl>
<dl><dt><a name="GenericChannel-first_show"><strong>first_show</strong></a>(self)</dt><dd><tt># Display .current category, once notebook/channel tab is first opened</tt></dd></dl>
<dl><dt><a name="GenericChannel-gui"><strong>gui</strong></a>(self, parent)</dt><dd><tt># initialize Gtk widgets / data objects</tt></dd></dl>
<dl><dt><a name="GenericChannel-insert_rows"><strong>insert_rows</strong></a>(self, rows, y<font color="#909090">=None</font>)</dt><dd><tt># Insert/append new station rows - used by importing/drag'n'drop plugins</tt></dd></dl>
<dl><dt><a name="GenericChannel-iter_cats"><strong>iter_cats</strong></a>(self, name, model, iter)</dt><dd><tt># Iterate over children to find current category</tt></dd></dl>
<dl><dt><a name="GenericChannel-load"><strong>load</strong></a>(self, category, force<font color="#909090">=False</font>, y<font color="#909090">=None</font>)</dt><dd><tt># Called on switching genre/category, or loading a genre for the first time.<br>
# Either fetches new stream data, or displays list from cache.</tt></dd></dl>
<dl><dt><a name="GenericChannel-model_iter"><strong>model_iter</strong></a>(self)</dt><dd><tt># Return ListStore <a href="__builtin__.html#object">object</a> and Iterator for currently selected row in gtk.TreeView station list</tt></dd></dl>
<dl><dt><a name="GenericChannel-play"><strong>play</strong></a>(self)</dt><dd><tt># Invoke action.<a href="#GenericChannel-play">play</a>() for current station.<br>
# Can be overridden to provide channel-specific "play" alternative</tt></dd></dl>
<dl><dt><a name="GenericChannel-postprocess"><strong>postprocess</strong></a>(self, streams)</dt><dd><tt># Stream list cleanup - invoked directly after <a href="#GenericChannel-reload">reload</a>(),<br>
# callbacks can remove entries, or just update fields.</tt></dd></dl>
<dl><dt><a name="GenericChannel-postprocess_filter_homepage"><strong>postprocess_filter_homepage</strong></a>(self, row, channel)</dt><dd><tt># Deduce homepage URLs from title<br>
# by looking for www.xyz.com domain names</tt></dd></dl>
<dl><dt><a name="GenericChannel-postprocess_filter_required_fields"><strong>postprocess_filter_required_fields</strong></a>(self, row, channel)</dt><dd><tt># Filter entries without title or url</tt></dd></dl>
<dl><dt><a name="GenericChannel-prepare"><strong>prepare</strong></a>(self, streams)</dt><dd><tt># Prepare stream list for display (called immediataly before .<a href="#GenericChannel-columns">columns</a>() refreshing)</tt></dd></dl>
<dl><dt><a name="GenericChannel-prepare_filter_icons"><strong>prepare_filter_icons</strong></a>(self, row)</dt><dd><tt># state icon: bookmark star, or deleted mark</tt></dd></dl>
<dl><dt><a name="GenericChannel-progress"><strong>progress</strong></a>(self, max, i<font color="#909090">=None</font>)</dt><dd><tt># sets updating progress bar for .update_streams or .reload_categores</tt></dd></dl>
<dl><dt><a name="GenericChannel-record"><strong>record</strong></a>(self)</dt><dd><tt># Start streamripper/youtube-dl/etc</tt></dd></dl>
<dl><dt><a name="GenericChannel-reload"><strong>reload</strong></a>(self)</dt><dd><tt># Reload current station list</tt></dd></dl>
<dl><dt><a name="GenericChannel-reload_categories"><strong>reload_categories</strong></a>(self)</dt><dd><tt># Update categories, save, and display</tt></dd></dl>
<dl><dt><a name="GenericChannel-reload_if_current"><strong>reload_if_current</strong></a>(self, category)</dt><dd><tt># Update streams pane if currently selected (used by bookmarks.links channel)</tt></dd></dl>
<dl><dt><a name="GenericChannel-row"><strong>row</strong></a>(self)</dt><dd><tt># Currently selected entry in stations list, return complete data dict</tt></dd></dl>
<dl><dt><a name="GenericChannel-row_icon"><strong>row_icon</strong></a>(self, gtkIcon<font color="#909090">='gtk-about'</font>)</dt><dd><tt># Inject status icon into currently selected row (used by main.bookmark() call)</tt></dd></dl>
<dl><dt><a name="GenericChannel-rowno"><strong>rowno</strong></a>(self)</dt><dd><tt># Convert ListStore iter to row number</tt></dd></dl>
<dl><dt><a name="GenericChannel-save"><strong>save</strong></a>(self)</dt><dd><tt># Store current streams data</tt></dd></dl>
<dl><dt><a name="GenericChannel-select_current"><strong>select_current</strong></a>(self, name)</dt><dd><tt># Traverse category TreeModel to set current, expand parent nodes</tt></dd></dl>
<dl><dt><a name="GenericChannel-selected"><strong>selected</strong></a>(self, name<font color="#909090">='url'</font>)</dt><dd><tt># Fetches a single varname from currently selected station entry</tt></dd></dl>
<dl><dt><a name="GenericChannel-stations"><strong>stations</strong></a>(self)</dt><dd><tt># Get list of stations in current category</tt></dd></dl>
<dl><dt><a name="GenericChannel-str_from_struct"><strong>str_from_struct</strong></a>(self, d)</dt><dd><tt># Retrieve first list value, or key from dict (-- used to get first category on init)</tt></dd></dl>
<dl><dt><a name="GenericChannel-switch"><strong>switch</strong></a>(self)</dt></dl>
<dl><dt><a name="GenericChannel-update_datamap"><strong>update_datamap</strong></a>(self, search<font color="#909090">='name'</font>, title<font color="#909090">=None</font>)</dt><dd><tt># Create private copy of .datamap and modify entries (title= rewrites)</tt></dd></dl>
<dl><dt><a name="GenericChannel-update_streams_partially_done"><strong>update_streams_partially_done</strong></a>(self, entries)</dt><dd><tt># Called occasionally (by some plugins) while updating station list</tt></dd></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>current</strong></dt>
</dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>audioformat</strong> = 'audio/mpeg'</dl>
<dl><dt><strong>base_url</strong> = ''</dl>
<dl><dt><strong>categories</strong> = []</dl>
<dl><dt><strong>catmap</strong> = {}</dl>
<dl><dt><strong>datamap</strong> = [['', 20, ['state', <type 'str'>, 'pixbuf', {}]], ['Genre', 65, ['genre', <type 'str'>, 't', {}]], ['Station Title', 275, ['title', <type 'str'>, 'text', {'cell-background': 12, 'cell-background-set': 13, 'strikethrough': 11}], ['favicon', <type 'gtk.gdk.Pixbuf'>, 'pixbuf', {}]], ['Now Playing', 185, ['playing', <type 'str'>, 'text', {'strikethrough': 11}]], ['Listeners', 45, ['listeners', <type 'int'>, 't', {'strikethrough': 11}]], ['Bitrate', 35, ['bitrate', <type 'int'>, 't', {}]], ['Homepage', 160, ['homepage', <type 'str'>, 't', {'underline': 10}]], [False, 25, ['url', <type 'str'>, 't', {'strikethrough': 11}]], [False, 20, ['format', <type 'str'>, None, {}]], [False, 0, ['favourite', <type 'bool'>, None, {}]], [False, 0, ['deleted', <type 'bool'>, None, {}]], [False, 0, ['search_col', <type 'str'>, None, {}]], [False, 0, ['search_set', <type 'bool'>, None, {}]]]</dl>
<dl><dt><strong>empty_stub</strong> = [{'bitrate': 0, 'genre': './.', 'homepage': '', 'listeners': 0, 'playing': 'Try Channel<font color="#c040c0">\xe2\x86\x92</font>Reload Categories later..', 'state': 'gtk-dialog-error', 'title': 'No categories found (website error)', 'url': 'none:'}]</dl>
<dl><dt><strong>fixed_size</strong> = [24, 24]</dl>
<dl><dt><strong>gtk_cat</strong> = None</dl>
<dl><dt><strong>gtk_list</strong> = None</dl>
<dl><dt><strong>has_search</strong> = False</dl>
<dl><dt><strong>img_resize</strong> = None</dl>
<dl><dt><strong>listformat</strong> = 'pls'</dl>
<dl><dt><strong>ls</strong> = None</dl>
<dl><dt><strong>meta</strong> = {'config': []}</dl>
<dl><dt><strong>nothing_found</strong> = [{'bitrate': 0, 'genre': './.', 'listeners': 0, 'playing': 'Notice', 'state': 'gtk-no', 'title': 'No contents found on directory server'}]</dl>
<dl><dt><strong>pix_entry</strong> = None</dl>
<dl><dt><strong>placeholder</strong> = [{'bitrate': 0, 'genre': './.', 'homepage': '', 'listeners': 0, 'playing': './.', 'state': 'gtk-info', 'title': 'Subcategory placeholder', 'url': 'none:'}]</dl>
<dl><dt><strong>postprocess_filters</strong> = []</dl>
<dl><dt><strong>prepare_filters</strong> = []</dl>
<dl><dt><strong>progress_state</strong> = 1</dl>
<dl><dt><strong>rowmap</strong> = []</dl>
<dl><dt><strong>rx_www_url</strong> = <_sre.SRE_Pattern object></dl>
<dl><dt><strong>shown</strong> = None</dl>
<dl><dt><strong>streams</strong> = {}</dl>
<dl><dt><strong>titles</strong> = {}</dl>
<hr>
Methods inherited from <a href="#FeaturePlugin">FeaturePlugin</a>:<br>
<dl><dt><a name="GenericChannel-init2"><strong>init2</strong></a>(self, parent, *k, **kw)</dt><dd><tt># optionally to be overriden by plugins (run after base __init__)</tt></dd></dl>
<dl><dt><a name="GenericChannel-status"><strong>status</strong></a>(self, *args, **kw)</dt><dd><tt># Statusbar stub (defers to parent/main window, if in GUI mode)</tt></dd></dl>
<dl><dt><a name="GenericChannel-warn"><strong>warn</strong></a>(self, text, *args, **kw)</dt><dd><tt># Statusbar with highlighting and default icon</tt></dd></dl>
<hr>
Data descriptors inherited from <a href="#FeaturePlugin">FeaturePlugin</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<hr>
Data and other attributes inherited from <a href="#FeaturePlugin">FeaturePlugin</a>:<br>
<dl><dt><strong>module</strong> = ''</dl>
<dl><dt><strong>parent</strong> = None</dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt><a name="-entity_decode"><strong>entity_decode</strong></a>(str)</dt><dd><tt># remove SGML/XML entities</tt></dd></dl>
<dl><dt><a name="-mime_fmt"><strong>mime_fmt</strong></a>(s)</dt><dd><tt># Convert audio format nick/shortnames to mime types, e.g. "OGG" to "audio/ogg"<br>
# (only used by few plugin meanwhile, could be merged with action. module now)</tt></dd></dl>
<dl><dt><a name="-nl"><strong>nl</strong></a>(str)</dt></dl>
<dl><dt><a name="-strip_tags"><strong>strip_tags</strong></a>(s)</dt><dd><tt># Strip html <tags> from string</tt></dd></dl>
<dl><dt><a name="-stub_parent"><strong>stub_parent</strong></a>(object)</dt><dd><tt># WORKAROUND for direct channel module imports,<br>
# eases instantiations without GUI a little,<br>
# reducing module dependencies (conf. / ahttp. / channels. / parent.) would be better</tt></dd></dl>
<dl><dt><a name="-to_int"><strong>to_int</strong></a>(s)</dt><dd><tt># Extracts integer from string</tt></dd></dl>
<dl><dt><a name="-unhtml"><strong>unhtml</strong></a>(str)</dt><dd><tt># Combine html tag, escapes and whitespace cleanup</tt></dd></dl>
<dl><dt><a name="-use_rx"><strong>use_rx</strong></a>(func)</dt><dd><tt># Decorator</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>__all__</strong> = ['FeaturePlugin', 'GenericChannel', 'ChannelPlugin', 'use_rx', 'mime_fmt', 'stub_parent', 'entity_decode', 'strip_tags', 'nl', 'unhtml', 'to_int']</td></tr></table>
|