Update of "api-st2"
Overview
Artifact ID: | 75312491e55daa471aa057c7621c7f5a35482e54 |
---|---|
Page Name: | api-st2 |
Date: | 2017-02-20 15:12:18 |
Original User: | mario |
Mimetype: | text/html |
Next | 9e0c3390baca2bb38fe5d8bb88175b2e9869f894 |
Content
<html><head><title>Python: module st2</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>st2</strong></big></big></font></td ><td align=right valign=bottom ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="streamtuner2/st2.py">/home/mario/projects/streamtuner2/st2.py</a></font></td></tr></table> <p><tt># encoding: UTF-8<br> # api: python<br> # type: application<br> # title: streamtuner2<br> # description: Directory browser for internet radio, audio and video streams<br> # version: 2.2.0<br> # state: stable<br> # author: Mario Salzer <mario@include-once.org><br> # license: Public Domain<br> # url: <a href="http://freshcode.club/projects/streamtuner2">http://freshcode.club/projects/streamtuner2</a><br> # config: <br> # { type: env, name: HTTP_PROXY, description: proxy for HTTP access }<br> # { type: env, name: XDG_CONFIG_HOME, description: relocates user .config subdirectory }<br> # category: sound<br> # depends: pygtk | gi, threading, requests, pyquery, lxml<br> # alias: streamtuner2, main<br> # id: st2<br> # pack: *.py, gtk3.xml.gz, bin, channels/__init__.py, bundle/*.py, CREDITS, help/index.page,<br> # streamtuner2.desktop, README, help/streamtuner2.1=/usr/share/man/man1/,<br> # NEWS=/usr/share/doc/streamtuner2/, icon.png=/usr/share/pixmaps/streamtuner2.png<br> # architecture: all<br> #<br> # Streamtuner2 is a GUI for browsing internet radio directories,<br> # music collections, and video services - grouped by genres or<br> # categories. It runs your preferred audio player or streamripper<br> # for recording.<br> #<br> # It's an independent rewrite of streamtuner1. Being written in<br> # Python, can be more easily extended and fixed. The mix of<br> # JSON APIs, regex or PyQuery extraction simplifies collecting<br> # station lists.<br> #<br> # Primarily radio stations are displayed, some channels however<br> # are music collections. Commercial and sign-up services are not<br> # an objective.</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>Modules</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-action">action</a><br> <a href="api-ahttp">ahttp</a><br> <a href="api-channels">channels</a><br> <a href="https://docs.python.org/3/library/cookielib.html">cookielib</a><br> <a href="https://docs.python.org/3/library/gobject.html">gobject</a><br> </td><td width="25%" valign=top><a href="https://docs.python.org/3/library/gtk.html">gtk</a><br> <a href="https://docs.python.org/3/library/inspect.html">inspect</a><br> <a href="api-logo">logo</a><br> <a href="https://docs.python.org/3/library/os.html">os</a><br> <a href="https://docs.python.org/3/library/pygtk.html">pygtk</a><br> </td><td width="25%" valign=top><a href="re.html">re</a><br> <a href="https://docs.python.org/3/library/sys.html">sys</a><br> <a href="https://docs.python.org/3/library/time.html">time</a><br> <a href="https://docs.python.org/3/library/traceback.html">traceback</a><br> <a href="https://docs.python.org/3/library/urllib.html">urllib</a><br> </td><td width="25%" valign=top><a href="https://docs.python.org/3/library/urllib2.html">urllib2</a><br> <a href="https://docs.python.org/3/library/urlparse.html">urlparse</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="gtk.html#Builder">gtk.Builder</a>(<a href="gobject._gobject.html#GObject">gobject._gobject.GObject</a>) </font></dt><dd> <dl> <dt><font face="helvetica, arial"><a href="#StreamTunerTwo">StreamTunerTwo</a> </font></dt></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="StreamTunerTwo">class <strong>StreamTunerTwo</strong></a>(<a href="gtk.html#Builder">gtk.Builder</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt># This represents the main window, dispatches Gtk events,<br> # and shares most application behaviour with the channel modules.<br> </tt></td></tr> <tr><td> </td> <td width="100%"><dl><dt>Method resolution order:</dt> <dd><a href="#StreamTunerTwo">StreamTunerTwo</a></dd> <dd><a href="gtk.html#Builder">gtk.Builder</a></dd> <dd><a href="gobject._gobject.html#GObject">gobject._gobject.GObject</a></dd> <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="StreamTunerTwo-__getattr__"><strong>__getattr__</strong></a>(self, name)</dt><dd><tt>#-- Shortcut for glade.<a href="#StreamTunerTwo-get_widget">get_widget</a>()<br> # Allows access to widgets as direct attributes instead of using .<a href="#StreamTunerTwo-get_widget">get_widget</a>()<br> # Also looks in self.<strong>channels</strong>[] for the named channel plugins</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt># constructor</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-bookmark"><strong>bookmark</strong></a>(self, widget)</dt><dd><tt># Add current selection to bookmark store</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-channel"><strong>channel</strong></a>(self)</dt><dd><tt># Returns the currently selected directory/channel object (remembered position)</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-channel_switch"><strong>channel_switch</strong></a>(self, notebook, page, page_num<font color="#909090">=0</font>, *args)</dt><dd><tt># Notebook tab has been clicked (receives numeric page_num), but *NOT* yet changed (visually).</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-channel_switch_by_name"><strong>channel_switch_by_name</strong></a>(self, name)</dt><dd><tt># Invoked from the menu instead, uses module name instead of numeric tab id</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-current_channel_gtk"><strong>current_channel_gtk</strong></a>(self)</dt><dd><tt># Returns the currently selected directory/channel object (from gtk)</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-delete_entry"><strong>delete_entry</strong></a>(self, w)</dt><dd><tt># Remove a stream entry</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-get_widget"><strong>get_widget</strong></a>(self, name)</dt><dd><tt># Custom-named widgets are available from .widgets{} not via .<a href="#StreamTunerTwo-get_widget">get_widget</a>()</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-gtk_main_quit"><strong>gtk_main_quit</strong></a>(self, widget, *x)</dt><dd><tt># end application and gtk+ main loop</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-init_app_state"><strong>init_app_state</strong></a>(self)</dt><dd><tt># load application state (widget sizes, selections, etc.)</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-load_plugin_channels"><strong>load_plugin_channels</strong></a>(self)</dt><dd><tt># load plugins from /usr/share/streamtuner2/channels/</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-logo_scale"><strong>logo_scale</strong></a>(self, r<font color="#909090">=1.0</font>, map<font color="#909090">=None</font>)</dt><dd><tt># Redraw logo</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-menu_copy"><strong>menu_copy</strong></a>(self, w)</dt><dd><tt># Save current stream URL into clipboard</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-on_category_clicked"><strong>on_category_clicked</strong></a>(self, widget, event, *more)</dt><dd><tt># Click in category list</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-on_homepage_channel_clicked"><strong>on_homepage_channel_clicked</strong></a>(self, widget, event<font color="#909090">=2</font>)</dt><dd><tt># Browse to channel homepage (@BROKEN: double click on notebook tab)</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-on_homepage_stream_clicked"><strong>on_homepage_stream_clicked</strong></a>(self, widget)</dt><dd><tt># Open stream homepage in web browser</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-on_play_clicked"><strong>on_play_clicked</strong></a>(self, widget, event<font color="#909090">=None</font>, *args)</dt><dd><tt># Play button</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-on_record_clicked"><strong>on_record_clicked</strong></a>(self, widget)</dt><dd><tt># Recording: invoke streamripper for current stream URL</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-on_reload_clicked"><strong>on_reload_clicked</strong></a>(self, widget<font color="#909090">=None</font>, reload<font color="#909090">=1</font>)</dt><dd><tt># Reload stream list in current channel-category</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-row"><strong>row</strong></a>(self)</dt><dd><tt># Channel: row{} dict for current station</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-save_app_state"><strong>save_app_state</strong></a>(self, widget)</dt><dd><tt># store window/widget states (sizes, selections, etc.)</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-save_as"><strong>save_as</strong></a>(self, widget)</dt><dd><tt># Save stream to file (.m3u)</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-selected"><strong>selected</strong></a>(self, name<font color="#909090">='url'</font>)</dt><dd><tt># Channel: fetch single varname from station row{} dict</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-station_context_menu"><strong>station_context_menu</strong></a>(self, treeview, event)</dt><dd><tt># Right clicking a stream/station in the treeview to make context menu pop out.</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-status"><strong>status</strong></a>(self, text<font color="#909090">=None</font>, timeout<font color="#909090">=3</font>, markup<font color="#909090">=False</font>, icon<font color="#909090">=None</font>, *k, **kw)</dt><dd><tt># Shortcut to statusbar and progressbar (receives either a string, or a float).</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-status_clear"><strong>status_clear</strong></a>(self, anyway<font color="#909090">=False</font>)</dt><dd><tt># Clean up after 3 seconds</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-switch_notebook_tabs_position"><strong>switch_notebook_tabs_position</strong></a>(self, w, pos)</dt><dd><tt># Change notebook channel tabs between TOP and LEFT position</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-thread"><strong>thread</strong></a>(self, target, *args, **kwargs)</dt><dd><tt># Run function in separate thread.<br> # Often used in conjunction with uikit.do() for Gtk interactions.</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-update_categories"><strong>update_categories</strong></a>(self, widget)</dt><dd><tt># Reload category tree</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-update_favicons"><strong>update_favicons</strong></a>(self, widget)</dt><dd><tt># Menu invocation: refresh favicons for all stations in current streams category</tt></dd></dl> <dl><dt><a name="StreamTunerTwo-update_title"><strong>update_title</strong></a>(self, *x, **y)</dt><dd><tt># Mirror selected channel tab into main window title</tt></dd></dl> <hr> Data descriptors defined here:<br> <dl><dt><strong>channel_names</strong></dt> </dl> <hr> Data and other attributes defined here:<br> <dl><dt><strong>channels</strong> = {}</dl> <dl><dt><strong>current_channel</strong> = 'bookmarks'</dl> <dl><dt><strong>features</strong> = {}</dl> <dl><dt><strong>hooks</strong> = {'config_load': [], 'config_save': [], 'init': [], 'play': [], 'quit': [<function cleanup_tmp_files>], 'record': [], 'switch': []}</dl> <dl><dt><strong>meta</strong> = {'alias': 'streamtuner2, main', 'api': 'python', 'architecture': 'all', 'author': 'Mario Salzer <mario@include-once.org>', 'category': 'sound', 'config': [{'description': 'proxy for HTTP access', 'name': 'HTTP_PROXY', 'type': 'env', 'value': None}, {'description': 'relocates user .config subdirectory', 'name': 'XDG_CONFIG_HOME', 'type': 'env', 'value': None}], 'depends': 'pygtk | gi, threading, requests, pyquery, lxml', 'description': 'Directory browser for internet radio, audio and video streams', 'doc': 'Streamtuner2 is a GUI for browsing internet radi...ercial and sign-up services are not<font color="#c040c0">\n</font>an objective.', 'encoding': 'UTF-8', ...}</dl> <dl><dt><strong>widgets</strong> = {}</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="-main"><strong>main</strong></a>()</dt><dd><tt># startup procedure</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>PY2</strong> = 1<br> <strong>PY3</strong> = 0<br> <strong>conf</strong> = {u'filter_walledgardens': True, u'radionomy_page...e/mario/.config/streamtuner2', u'history': u'20'}<br> <strong>log</strong> = <config.log_printer object><br> <strong>ui_xml</strong> = u'<?xml version="1.0" encoding="UTF-8"?><font color="#c040c0">\n</font><!-- Gene... </object><font color="#c040c0">\n</font> </child><font color="#c040c0">\n</font> </object><font color="#c040c0">\n</font></interface><font color="#c040c0">\n</font>'</td></tr></table>