Index: st2.py
==================================================================
--- st2.py
+++ st2.py
@@ -3,11 +3,11 @@
# api: python
# type: application
# title: streamtuner2
# description: directory browser for internet radio / audio streams
# depends: gtk, pygtk, xml.dom.minidom, threading, lxml, pyquery, kronos
-# version: 2.0.8
+# version: 2.0.9
# author: mario salzer
# license: public domain
# url: http://freshmeat.net/projects/streamtuner2
# config:
# category: multimedia
@@ -113,11 +113,11 @@
# this represents the main window
# and also contains most application behaviour
main = None
-class StreamTunerTwo(gtk.glade.XML):
+class StreamTunerTwo(gtk.Builder):
# object containers
widgets = {} # non-glade widgets (the manually instantiated ones)
channels = {} # channel modules
@@ -134,11 +134,13 @@
# gtkrc stylesheet
self.load_theme(), gui_startup(0.05)
# instantiate gtk/glade widgets in current object
- gtk.glade.XML.__init__(self, ("st2.glade" if os.path.exists("st2.glade") else conf.share+"/st2.glade")), gui_startup(0.10)
+ gtk.Builder.__init__(self)
+ ui_file = ("st2.xml" if os.path.exists("st2.xml") else conf.share+"/st2.xml");
+ gtk.Builder.add_from_file(self, ui_file), gui_startup(0.10)
# manual gtk operations
self.extensionsCTM.set_submenu(self.extensions) # duplicates Station>Extension menu into stream context menu
# initialize channels
self.channels = {
@@ -170,11 +172,11 @@
except: print("channel .first_show() initialization error")
# bind gtk/glade event names to functions
gui_startup(0.95)
- self.signal_autoconnect({
+ self.connect_signals({
"gtk_main_quit" : self.gtk_main_quit, # close window
# treeviews / notebook
"on_stream_row_activated" : self.on_play_clicked, # double click in a streams list
"on_category_clicked": self.on_category_clicked, # new selection in category list
"on_notebook_channels_switch_page": self.channel_switch, # channel notebook tab changed
@@ -238,18 +240,18 @@
# also looks in self.channels[] for the named channel plugins
def __getattr__(self, name):
if (self.channels.has_key(name)):
return self.channels[name] # like self.shoutcast
else:
- return self.get_widget(name) # or gives an error if neither exists
+ return self.get_object(name) # or gives an error if neither exists
# custom-named widgets are available from .widgets{} not via .get_widget()
def get_widget(self, name):
if self.widgets.has_key(name):
return self.widgets[name]
else:
- return gtk.glade.XML.get_widget(self, name)
+ return gtk.Builder.get_object(self, name)
# returns the currently selected directory/channel object
@@ -517,11 +519,11 @@
# auxiliary window: about dialog
class AboutStreamtuner2:
# about us
def __init__(self):
a = gtk.AboutDialog()
- a.set_version("2.0.8")
+ a.set_version("2.0.9")
a.set_name("streamtuner2")
a.set_license("Public Domain\n\nNo Strings Attached.\nUnrestricted distribution,\nmodification, use.")
a.set_authors(["Mario Salzer \n\nConcept based on streamtuner 0.99.99 from\nJean-Yves Lefort, of which some code remains\nin the Google stations plugin.\n\n\nMyOggRadio plugin based on cooperation\nwith Christian Ehm. "])
a.set_website("http://milki.include-once.org/streamtuner2/")
a.connect("response", lambda a, ok: ( a.hide(), a.destroy() ) )
ADDED st2.xml
Index: st2.xml
==================================================================
--- st2.xml
+++ st2.xml
@@ -0,0 +1,2881 @@
+
+
+
+
+
+
+
+ False
+ 5
+ normal
+
+
+
+ True
+ False
+ 2
+
+
+ True
+ False
+ end
+
+
+ cancel
+ True
+ True
+ True
+ False
+
+
+
+ False
+ False
+ 0
+
+
+
+
+ ok
+ True
+ True
+ True
+ False
+
+
+
+ False
+ False
+ 1
+
+
+
+
+ False
+ True
+ end
+ 0
+
+
+
+
+ True
+ False
+ 3
+ 3
+
+
+ True
+ True
+ ●
+ Fri,Sat 20:00-21:00
+ False
+ False
+ True
+ True
+
+
+ 1
+ 2
+ 1
+ 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ True
+ True
+ 1
+
+
+
+
+
+ timer_cancel
+ timer_ok
+
+
+
+ 565
+ False
+ streamtuner settings
+ center
+ True
+ /usr/share/pixmaps/streamtuner2.png
+
+
+
+ True
+ False
+
+
+ 520
+ 510
+ True
+ True
+ left
+ True
+ 28
+ 28
+ 30
+
+
+ True
+ False
+ 136
+
+
+ 350
+ 471
+ True
+ False
+ 13
+ 2
+
+
+ True
+ False
+ audio/aac
+
+
+ 3
+ 4
+
+
+
+
+ True
+ False
+ audio/x-real
+
+
+ 4
+ 5
+
+
+
+
+ True
+ False
+ audio/*
+
+
+ 5
+ 6
+
+
+
+
+ True
+ False
+ audio/*
+
+
+ 9
+ 10
+
+
+
+
+ True
+ False
+ */*
+
+
+ 6
+ 7
+
+
+
+
+ 200
+ 20
+ True
+ True
+ False
+ False
+ True
+ True
+
+
+ 1
+ 2
+ 3
+ 4
+
+
+
+
+ 200
+ 20
+ True
+ True
+ False
+ False
+ True
+ True
+
+
+ 1
+ 2
+ 4
+ 5
+
+
+
+
+ 200
+ 20
+ True
+ True
+ False
+ False
+ True
+ True
+
+
+ 1
+ 2
+ 5
+ 6
+
+
+
+
+ 200
+ 20
+ True
+ True
+ False
+ False
+ True
+ True
+
+
+ 1
+ 2
+ 6
+ 7
+
+
+
+
+ True
+ False
+ Here %u or %pls return a direct URL to
+the shoutcast link.
+
+And %g or %m3u provide a local .m3u file
+for the audio player, what's usually better.
+
+ True
+
+
+ 1
+ 2
+ 7
+ 8
+
+
+
+
+ True
+ False
+ <b>Recording</b>
+ True
+
+
+ 1
+ 2
+ 8
+ 9
+
+
+
+
+ 200
+ 20
+ True
+ True
+ False
+ False
+ True
+ True
+
+
+ 1
+ 2
+ 9
+ 10
+
+
+
+
+ True
+ False
+
+
+
+ 1
+ 2
+ 10
+ 11
+
+
+
+
+ True
+ False
+ <b>Web Browser</b>
+ True
+
+
+ 1
+ 2
+ 11
+ 12
+
+
+
+
+ True
+ False
+ url/http
+
+
+ 12
+ 13
+
+
+
+
+ 200
+ 20
+ True
+ True
+ False
+ False
+ True
+ True
+
+
+ 1
+ 2
+ 12
+ 13
+
+
+
+
+ 200
+ 20
+ True
+ True
+ False
+ False
+ True
+ True
+
+
+ 1
+ 2
+ 1
+ 2
+
+
+
+
+ True
+ False
+ audio/mp3
+
+
+ 1
+ 2
+
+
+
+
+ 200
+ 20
+ True
+ True
+ False
+ False
+ True
+ True
+
+
+ 1
+ 2
+ 2
+ 3
+
+
+
+
+ True
+ False
+ audio/ogg
+
+
+ 2
+ 3
+
+
+
+
+ True
+ False
+ <b>Format</b>
+ True
+
+
+
+
+ True
+ False
+ <b>Audio Player</b>
+ True
+
+
+ 1
+ 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 25
+ 25
+
+
+
+
+
+
+ True
+ False
+ Player
+
+
+ False
+
+
+
+
+ True
+ False
+
+
+ 340
+ 457
+ True
+ False
+ 12
+ 2
+
+
+ show bookmark star for favourites in stream lists
+ True
+ True
+ False
+ False
+ True
+
+
+ 1
+ 2
+ 1
+ 2
+
+
+
+
+ True
+ False
+
+
+ True
+ True
+ 5
+ ●
+ 4
+ 120
+ out
+ False
+ False
+ True
+ True
+
+
+ True
+ True
+ 0
+
+
+
+
+ True
+ False
+ 6
+ limit stream number per channel / category
+
+
+ True
+ True
+ 1
+
+
+
+
+ 1
+ 2
+
+
+
+
+ retain deleted stations in list
+ True
+ True
+ False
+ False
+ True
+
+
+ 1
+ 2
+ 5
+ 6
+
+
+
+
+ display favicons for individual music stations
+ True
+ True
+ False
+ False
+ True
+
+
+ 1
+ 2
+ 2
+ 3
+
+
+
+
+ load favicon for played stations
+ True
+ True
+ False
+ False
+ True
+
+
+ 1
+ 2
+ 3
+ 4
+
+
+
+
+ update favorites from freshened stream urls
+ True
+ True
+ False
+ False
+ True
+
+
+ 1
+ 2
+ 6
+ 7
+
+
+
+
+ google for homepage URL if missing
+ True
+ True
+ False
+ False
+ True
+
+
+ 1
+ 2
+ 7
+ 8
+
+
+
+
+ True
+ False
+
+
+ True
+ False
+ True
+ ordering of
+channel tabs
+
+
+ True
+ True
+ 0
+
+
+
+
+ True
+ True
+ ●
+ False
+ False
+ True
+ True
+
+
+ True
+ True
+ 1
+
+
+
+
+ 1
+ 2
+ 11
+ 12
+
+
+
+
+ automatically save window state
+ True
+ True
+ False
+ True
+ False
+ True
+
+
+ 1
+ 2
+ 10
+ 11
+
+
+
+
+ 16
+ True
+ False
+ True
+
+
+ True
+ False
+ 11
+ use Gtk+ theme
+(needs restart)
+
+
+ True
+ True
+ 0
+
+
+
+
+ 190
+ 16
+ True
+ False
+
+
+ False
+ False
+ False
+ True
+ True
+
+
+
+
+ False
+ False
+ 1
+
+
+
+
+ 1
+ 2
+ 9
+ 10
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 25
+ 25
+
+
+
+
+ 1
+
+
+
+
+ True
+ False
+ Display
+
+
+ 1
+ False
+
+
+
+
+ True
+ False
+
+
+ 350
+ 450
+ True
+ False
+ 13
+ 2
+
+
+ True
+ False
+ Directories
+
+
+ 1
+ 2
+
+
+
+
+ True
+ False
+ temporary
+files
+
+
+ 1
+ 2
+
+
+
+
+ 200
+ 20
+ True
+ True
+ False
+ False
+ True
+ True
+
+
+ 1
+ 2
+ 1
+ 2
+
+
+
+
+ 200
+ 20
+ True
+ True
+ False
+ False
+ False
+ True
+ True
+
+
+ 1
+ 2
+ 2
+ 3
+
+
+
+
+ True
+ False
+ .config dir
+
+
+ 2
+ 3
+
+
+
+
+ True
+ False
+ 0.10000000149011612
+ You can only influence this by
+setting XDG_CONFIG_HOME to a
+different location.
+
+
+ 1
+ 2
+ 3
+ 4
+
+
+
+
+ True
+ False
+ HTTP proxy
+
+
+ 5
+ 6
+
+
+
+
+ True
+ False
+ 0.10000000149011612
+ 1
+ Start streamtuner2 with <b>http_proxy=</b>
+as environment variable. This will
+get picked up by Python and urllib.
+ True
+
+
+ 1
+ 2
+ 5
+ 6
+
+
+
+
+ reuse temporary .m3u files
+ True
+ True
+ False
+ False
+ True
+
+
+ 1
+ 2
+ 7
+ 8
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 25
+ 25
+
+
+
+
+ 2
+
+
+
+
+ True
+ False
+ System
+
+
+ 2
+ False
+
+
+
+
+ True
+ True
+ never
+
+
+ True
+ False
+ 15
+ queue
+ none
+
+
+ True
+ False
+ 10
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+
+
+
+
+ False
+ Channel
+Plugins
+
+
+ 3
+ False
+
+
+
+
+ 30
+ 70
+
+
+
+
+ save
+ 100
+ 35
+ True
+ True
+ True
+ False
+
+
+
+ 415
+ 600
+
+
+
+
+ cancel
+ 100
+ 35
+ True
+ True
+ True
+ False
+
+
+
+ 300
+ 600
+
+
+
+
+ 490
+ 45
+ True
+ False
+ <b><big><big><big><big><big>Configuration Settings</big></big></big></big></big></b>
+ True
+ True
+
+
+ 30
+ 15
+
+
+
+
+
+
+ False
+ inspect/edit stream data
+ center-on-parent
+ False
+ 0.94999999999999996
+
+
+
+ True
+ False
+ 15
+ 10
+ 2
+ 5
+ 5
+
+
+ True
+ False
+ 0.89999997615814209
+ title
+
+
+ 1
+ 2
+
+
+
+
+ True
+ True
+ ●
+ False
+ False
+ True
+ True
+
+
+ 1
+ 2
+ 1
+ 2
+
+
+
+
+ True
+ True
+ ●
+ False
+ False
+ True
+ True
+
+
+ 1
+ 2
+ 2
+ 3
+
+
+
+
+ True
+ True
+ ●
+ False
+ False
+ True
+ True
+
+
+ 1
+ 2
+ 3
+ 4
+
+
+
+
+ True
+ True
+ ●
+ False
+ False
+ True
+ True
+
+
+ 1
+ 2
+ 4
+ 5
+
+
+
+
+ True
+ True
+ ●
+ False
+ False
+ True
+ True
+
+
+ 1
+ 2
+ 5
+ 6
+
+
+
+
+ True
+ True
+ ●
+ False
+ False
+ True
+ True
+
+
+ 1
+ 2
+ 6
+ 7
+
+
+
+
+ True
+ False
+ 0.89999997615814209
+ playing/desc
+
+
+ 2
+ 3
+
+
+
+
+ True
+ False
+ 0.89999997615814209
+ homepage
+
+
+ 3
+ 4
+
+
+
+
+ True
+ False
+ 0.89999997615814209
+ genre
+
+
+ 4
+ 5
+
+
+
+
+ True
+ False
+ 0.89999997615814209
+ stream url
+
+
+ 5
+ 6
+
+
+
+
+ True
+ False
+ 0.89999997615814209
+ favicon
+
+
+ 6
+ 7
+
+
+
+
+ 40
+ True
+ False
+
+
+ cancel
+ 100
+ 25
+ True
+ True
+ True
+ False
+
+
+
+ 100
+ 10
+
+
+
+
+ ok
+ 100
+ 25
+ True
+ True
+ True
+ False
+
+
+
+ 210
+ 10
+
+
+
+
+ new
+ 50
+ 25
+ True
+ True
+ True
+ False
+
+
+
+ 5
+ 10
+
+
+
+
+ 1
+ 2
+ 9
+ 10
+
+
+
+
+ True
+ False
+ 0.69999998807907104
+ <b>channel</b>
+ True
+
+
+
+
+ True
+ False
+ 0.08999999612569809
+ <b>information</b>
+ True
+
+
+ 1
+ 2
+
+
+
+
+
+ 1
+ 2
+ 8
+ 9
+
+
+
+
+ True
+ False
+ extra info
+
+
+ 8
+ 9
+
+
+
+
+ True
+ False
+ format
+
+
+ 7
+ 8
+
+
+
+
+ True
+ True
+ ●
+ False
+ False
+ True
+ True
+
+
+ 1
+ 2
+ 7
+ 8
+
+
+
+
+
+
+
+
+
+ 500
+ 330
+ False
+ streamtuner2
+ 980
+ 775
+ /usr/share/pixmaps/streamtuner2.png
+ applications-multimedia
+
+
+ streamtuner2
+
+
+
+
+
+ True
+ False
+
+
+ True
+ False
+
+
+ True
+ False
+
+
+
+ False
+ True
+ 0
+
+
+
+
+ True
+ False
+
+
+ True
+ False
+ both
+ 6
+
+
+ True
+ False
+ False
+ play
+ gtk-media-play
+
+
+
+ False
+ True
+
+
+
+
+ True
+ False
+ False
+ record
+ gtk-media-record
+
+
+
+ False
+ True
+
+
+
+
+ True
+ False
+ False
+ station
+ gtk-home
+
+
+
+ False
+ True
+
+
+
+
+ True
+ False
+
+
+ False
+ True
+
+
+
+
+ True
+ False
+ False
+ reload
+ gtk-refresh
+
+
+
+ False
+ True
+
+
+
+
+ True
+ False
+ False
+ stop
+ gtk-cancel
+
+
+
+ False
+ True
+
+
+
+
+ True
+ True
+ 0
+
+
+
+
+ True
+ True
+ ●
+ 10
+ 0.10000000149011612
+ gtk-find
+ False
+ False
+ True
+ True
+
+
+
+
+ False
+ True
+ 20
+ 1
+
+
+
+
+ True
+ True
+ 1
+
+
+
+
+ True
+ True
+ 0
+
+
+
+
+ True
+ False
+ GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK | GDK_BUTTON3_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK | GDK_STRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK | GDK_VISIBILITY_NOTIFY_MASK | GDK_PROXIMITY_IN_MASK | GDK_PROXIMITY_OUT_MASK | GDK_SUBSTRUCTURE_MASK | GDK_SCROLL_MASK
+ 15
+ streamtuner2.png
+
+
+
+ False
+ True
+ 1
+
+
+
+
+ False
+ False
+ 0
+
+
+
+
+ True
+ True
+ True
+ True
+
+
+
+ True
+ True
+
+
+ 150
+ True
+ True
+ automatic
+ automatic
+
+
+ 75
+ True
+ True
+ True
+
+
+
+
+
+ False
+ True
+
+
+
+
+ True
+ True
+ automatic
+ automatic
+
+
+ 200
+ True
+ True
+
+
+
+
+
+
+ True
+ True
+
+
+
+
+
+
+ True
+ False
+
+
+
+ True
+ False
+ gtk-indent
+
+
+ True
+ True
+ 0
+
+
+
+
+ True
+ False
+ bookmarks
+
+
+ True
+ True
+ 1
+
+
+
+
+ False
+
+
+
+
+ True
+ True
+ 1
+
+
+
+
+ True
+ False
+
+
+ True
+ False
+ 2
+ True
+ False
+
+
+ True
+ True
+ 0
+
+
+
+
+ 75
+ False
+ True
+ 0.28000000000000003
+ loading...
+
+
+ False
+ True
+ 1
+
+
+
+
+ 20
+ True
+ False
+ 2
+
+
+ False
+ True
+ 2
+
+
+
+
+ False
+ True
+ 2
+
+
+
+
+
+