Update of "api-channels"
Overview
Artifact ID: | e5f01882c5a1c5da5e705078fa9b15915b3790a8 |
---|---|
Page Name: | api-channels |
Date: | 2017-02-20 15:11:53 |
Original User: | mario |
Mimetype: | text/html |
Next | 7b6952519003c54e53807da37fc00720e4c6ef20 |
Content
<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>