Index: config.py ================================================================== --- config.py +++ config.py @@ -24,10 +24,11 @@ import sys import json import gzip import platform import re +import zlib import zipfile import inspect import pkgutil # find_executable() is only needed by channels/configwin @@ -279,13 +280,15 @@ # Retrieve content from install path or pyzip archive (alias for pkgutil.get_data) # -def get_data(fn, decode=False): +def get_data(fn, decode=False, z=False): try: bin = pkgutil.get_data("config", fn) + if z: + bin = zlib.decompress(bin) if decode: return bin.decode("utf-8") else: return str(bin) except: DELETED gtk3.xml Index: gtk3.xml ================================================================== --- gtk3.xml +++ gtk3.xml @@ -1,3218 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 565 - False - streamtuner settings - center - True - /usr/share/pixmaps/streamtuner2.png - - - - True - False - 0 - none - - - 500 - True - False - - - 520 - True - True - True - - - True - True - - - True - False - 15 - none - - - True - False - - - True - False - 0 - <b>Audio player</b> association. - True - - - True - True - 0 - - - - - True - True - - - 540 - 200 - True - True - 5 - config_play - False - True - 0 - 8 - both - - - - - - 10 - 125 - Format - True - - - - - - 2 - 0 - - - - - - - 5 - 300 - Application - - - - 3 - - - - - - - - 2 - 1 - - - - - - - - - True - True - 1 - - - - - True - False - 0 - True - - - True - True - 2 - - - - - - - - True - False - 0 - <b>Recording</b> applications. - True - - - True - True - 4 - - - - - 540 - 100 - True - True - 5 - config_record - False - True - 0 - 8 - both - - - - - - 10 - 125 - Format - True - - - - - - 2 - 0 - - - - - - - 10 - 300 - Application - - - - 3 - - - - - - - - 2 - 1 - - - - - - - True - True - 5 - - - - - True - True - 0.019999999552965164 - 0.49000000953674316 - Use <a href="http://fossil.include-once.org/streamtuner2/wiki?name=player">placeholders</a> such as <b>%pls</b> for Shoutcast playlists, -or pass <b>%m3u</b> for players that expect mp3 playlist files, -and <b>%srv</b> to use direct streaming URLs. - True - True - - - True - True - 5 - 6 - - - - - - - - - - - - - - True - False - Player - - - False - - - - - True - True - - - True - False - 15 - none - - - True - False - - - True - False - 0.019999999552965164 - 9 - Display - - - - - - - True - True - 0 - - - - - Display favicons for individual music stations. - True - True - False - 0 - True - - - True - True - 1 - - - - - Load favicon for played stations. - True - True - False - 0 - True - - - True - True - 2 - - - - - Show bookmark star for favourites in stream lists. - True - True - False - 0 - True - - - True - True - 3 - - - - - Save window state, sizes and selections automatically. - True - True - False - 0 - True - - - True - True - 5 - 4 - - - - - - - - - - - - - - True - False - - - True - True - 8 - - - - - True - False - 0.019999999552965164 - 9 - Station loading - - - - - - - True - True - 9 - - - - - Prefer HTML traversing (PyQuery) over regex text matching. - True - True - False - 0 - top - True - - - True - True - 10 - - - - - True - False - 0 - <small>Most plugins intellegently fall back, but sometimes overriding -the website extraction method can fix some station list update errors.</small> - True - - - True - True - 11 - - - - - True - False - - - True - True - 5 - - 5 - 500 - out - False - False - - - False - False - 0 - - - - - True - False - 0 - 6 - Limit stream number per channel / category. -<small>Some plugins use custom overrides.</small> - True - end - - - True - True - 1 - - - - - False - False - 5 - 12 - - - - - - - - Retain deleted stations in list. - True - True - False - 0 - True - - - True - True - 14 - - - - - Update favorites from freshened stream URLs. - True - True - False - 0 - True - - - True - True - 15 - - - - - Google missing station homepages. - True - True - False - 0 - True - - - True - True - 16 - - - - - - - - - - - - - - True - False - - - True - True - 20 - - - - - True - False - 0.019999999552965164 - 9 - System - - - - - - - True - True - 21 - - - - - - - - - - - True - False - - - True - False - 0 - Temporary files directory - - - False - True - 0 - - - - - 200 - 20 - True - True - - gtk-save-as - False - False - - - False - False - 1 - - - - - True - True - 5 - 24 - - - - - - - - Keep and reuse temporary .m3u files for played stations. - True - True - False - 0.5 - True - - - True - True - 5 - 26 - - - - - - - - True - False - - - True - False - 0 - Config directory. -<small>This is determined by XDG_CONFIG_HOME.</small> - True - - - False - True - 0 - - - - - 200 - 20 - True - True - False - - 20 - gtk-home - False - False - - - False - True - 1 - - - - - True - False - 3 - 28 - - - - - - - - Enable _debug messages (on the console). - True - True - False - True - 0.5 - True - - - True - True - 5 - 30 - - - - - - - - - - - - 1 - - - - - True - False - Options - - - 1 - False - - - - - True - True - never - - - True - False - 15 - queue - none - - - True - False - 10 - - - True - False - 0.05000000074505806 - <b>Channels</b> show up as tabs. While <b>feature</b> <i>plugins</i> add menu entries -or internal functions. Changes take effect after restarting streamtuner2. - True - - - True - True - 0 - - - - - - - - True - False - - - False - True - 2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - - - - - False - Channel -Plugins - - - 3 - False - - - - - True - True - 0 - - - - - True - False - - - True - False - - - True - True - 0 - - - - - cancel - 100 - 35 - True - True - True - - - - False - True - 1 - - - - - save - 100 - 35 - True - True - True - - - - True - True - 2 - - - - - False - True - 1 - - - - - - - True - False - <big><b>Configuration Settings</b></big> - True - - - - - - - True - False - gtk-harddisk - - - True - False - gtk-add - - - 325 - False - 0.94999999999999996 - 5 - station search - center-on-parent - True - dialog - center - - - - - True - False - 2 - - - True - False - end - - - False - False - end - 0 - - - - - True - False - 20 - - - True - False - <b><big>search</big></b> - True - - - True - True - 0 - - - - - - - - True - False - - - True - False - 10 - for - - - True - True - 0 - - - - - True - True - True - True - A single word to search for in all stations. - - True - False - False - - - True - True - 1 - - - - - True - False - - - True - True - 2 - - - - - True - True - 2 - - - - - True - False - - - True - False - 10 - 10 - in - - - True - True - 0 - - - - - all channels - True - True - False - 0.5 - True - True - - - True - True - 1 - - - - - just current - True - True - False - 0.5 - True - True - search_dialog_all - - - True - True - 2 - - - - - True - True - 3 - - - - - - - - True - False - 20 - - - Cache _find - True - False - False - Start searching for above search term in the currently loaded station lists. Doesn't find *new* information, just looks through the known data. - image1 - half - True - - - - - True - True - 0 - - - - - Server _search - True - False - True - True - True - True - True - Instead of doing a cache search, go through the search functions on the directory service homepages. (UNIMPLEMENTED) - image2 - True - - - - True - True - 1 - - - - - True - True - 5 - - - - - True - True - 1 - - - - - - - True - False - - - True - False - Play - True - - - - - - True - False - Record - True - - - - - - True - False - Bookmark - True - - - - - - True - False - Extensions - True - - - True - False - - - - - - - True - False - Save - True - - - - - - True - False - Edit / Details - True - - - - - - True - False - Station homepage - True - - - - - - False - 5 - normal - - - - - True - False - 2 - - - True - False - end - - - cancel - True - True - True - - - - False - False - 0 - - - - - ok - True - True - True - - - - False - False - 1 - - - - - False - True - end - 0 - - - - - True - False - 3 - 3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - - Fri,Sat 20:00-21:00 - False - False - - - 1 - 2 - 1 - 2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - 1 - - - - - - timer_cancel - timer_ok - - - - False - - - True - False - - - True - False - http://sourceforge.net/projects/streamtuner2/forums/forum/1173108 - - - True - True - 0 - - - - - True - False - http://fossil.include-once.org/streamtuner2/ - - - True - True - 1 - - - - - True - False - http://milki.include-once.org/streamtuner2/ - - - True - True - 2 - - - - - - - False - 0.94999999999999996 - 5 - inspect/edit stream data - center-on-parent - True - True - - - - True - False - 15 - 10 - 2 - 5 - 5 - - - - - - True - False - Radio station name. - 0.89999997615814209 - title - - - 1 - 2 - - - - - True - True - - False - False - - - 1 - 2 - 1 - 2 - - - - - True - True - - False - False - - - 1 - 2 - 2 - 3 - - - - - True - True - - False - False - - - 1 - 2 - 3 - 4 - - - - - True - True - - False - False - - - 1 - 2 - 4 - 5 - - - - - True - True - - False - False - - - 1 - 2 - 5 - 6 - - - - - True - True - - False - False - - - 1 - 2 - 6 - 7 - - - - - True - False - Either the last playing song, or a general description of the station. - 0.89999997615814209 - playing/desc - - - 2 - 3 - - - - - True - False - 0.89999997615814209 - homepage - - - 3 - 4 - - - - - True - False - 0.89999997615814209 - genre - - - 4 - 5 - - - - - True - False - PLS or M3U link. - 0.89999997615814209 - stream url - - - 5 - 6 - - - - - True - False - Homepage icon for station. Points to a local cache file. - 0.89999997615814209 - favicon - - - 6 - 7 - - - - - 40 - True - False - - - cancel - 100 - 25 - True - True - True - - - - 100 - 10 - - - - - ok - 100 - 25 - True - True - True - Save changes. - - - - 210 - 10 - - - - - new - 50 - 25 - True - True - True - - - - 5 - 10 - - - - - 1 - 2 - 9 - 10 - - - - - True - False - 0.69999998807907104 - <b>channel</b> - True - - - - - True - False - 0.08999999612569809 - <b>information</b> - True - - - 1 - 2 - - - - - True - True - - False - False - - - 1 - 2 - 8 - 9 - - - - - True - False - You can add extra information here, if you want. Useful for searching later. But take care that it gets reset on channel reloading. - extra info - - - 8 - 9 - - - - - True - False - Audio file format MIME type. - format - - - 7 - 8 - - - - - True - True - - False - False - - - 1 - 2 - 7 - 8 - - - - - - - 500 - 330 - False - streamtuner2 - 980 - 775 - /usr/share/pixmaps/streamtuner2.png - applications-multimedia - - - - True - False - - - True - False - - - True - False - - - True - False - - - True - False - _Station - True - - - True - False - - - True - False - bookmark - True - - - - - - - - gtk-save-as - True - False - True - True - - - - - - - - gtk-edit - True - False - True - True - - - - - - - - - True - False - Extensions - True - - - True - False - - - - - - - True - False - - - - - gtk-quit - True - False - True - True - - - - - - - - - - - gtk-edit - True - False - True - True - - - True - False - - - gtk-copy - True - False - True - True - - - - - - gtk-delete - True - False - True - True - - - - - - - - gtk-find - True - False - True - True - - - - - - - True - False - - - - - True - False - _Toolbar - True - - - True - False - - - gtk-revert-to-saved - True - False - True - True - - - - - True - False - - - - - True - False - Only Symbols - True - - - - - - True - False - With Text - True - - - - - - True - False - - - - - True - False - Small - True - - - - - - True - False - Medium - True - - - - - - True - False - Large - True - - - - - - - - - - True - False - Channel tab position - True - - - True - False - - - True - False - Top - True - - - - - - True - False - Left - True - - - - - - True - False - Bottom - True - - - - - - True - False - Right - True - - - - - - - - - - True - False - Save states - True - - - - - - gtk-properties - True - False - True - True - - - - - - - - - - - True - False - _Channel - True - - - True - False - - - True - False - Homepage of directory service - True - - - - - - True - False - Reload - True - - - - - - - True - False - this will take a few minutes - Update favicons... - True - - - - - - True - False - Reload Category Tree - True - - - - - - True - False - - - - - - - - - gtk-help - True - False - True - True - - - True - False - - - True - False - documentation - True - - - - - - True - False - online forum - True - - - - - - True - False - wiki/fossil/bugs - True - - - - - - gtk-about - True - False - True - True - - - - - - - - - - False - True - 0 - - - - - True - False - - - True - False - both - 6 - - - True - False - play - gtk-media-play - - - - False - True - - - - - True - False - record - gtk-media-record - - - - False - True - - - - - True - False - station - gtk-home - - - - False - True - - - - - True - False - - - False - True - - - - - True - False - reload - gtk-refresh - - - - False - True - - - - - False - False - stop - gtk-cancel - - - False - True - - - - - True - True - 0 - - - - - True - True - - 10 - 0.10000000149011612 - gtk-find - False - False - - - - - False - True - 20 - 1 - - - - - True - True - 1 - - - - - True - True - 0 - - - - - - False - True - 1 - - - - - False - False - 0 - - - - - True - True - left - True - True - - - - True - True - - - 150 - True - True - - - 75 - True - True - True - - - - - - - - - False - True - - - - - True - True - - - 200 - True - 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 - - - True - True - 0 - - - - - 75 - False - True - 0.28000000000000003 - loading... - - - False - True - 1 - - - - - 20 - True - False - 2 - - - False - True - 2 - - - - - False - True - 2 - - - - - - - streamtuner2 - - - - ADDED gtk3.xml.zlib Index: gtk3.xml.zlib ================================================================== --- gtk3.xml.zlib +++ gtk3.xml.zlib cannot compute difference between binary files Index: st2.py ================================================================== --- st2.py +++ st2.py @@ -14,11 +14,11 @@ # { type: env, name: http_proxy, description: proxy for HTTP access } # { type: env, name: XDG_CONFIG_HOME, description: relocates user .config subdirectory } # category: sound # depends: pygtk | gi, threading, requests, pyquery, lxml # id: streamtuner2 -# pack: *.py, gtk*.xml, bin, channels/__init__.py, bundle/*.py, CREDITS, help/index.page, +# pack: *.py, gtk3.xml.zlib, bin, channels/__init__.py, bundle/*.py, CREDITS, help/index.page, # streamtuner2.desktop=/usr/share/applications/, README=/usr/share/doc/streamtuner2/, # help/streamtuner2.1=/usr/share/man/man1/, NEWS.gz=/usr/share/doc/streamtuner2/changelog.gz, # logo.png=/usr/share/pixmaps/streamtuner2.png # architecture: all # @@ -235,11 +235,11 @@ # List of module titles for channel tabs @property def channel_names(self): n = self.notebook_channels - return [n.get_menu_label_text(n.get_nth_page(i)) for i in xrange(0, n.get_n_pages())] + return [n.get_menu_label_text(n.get_nth_page(i)) for i in range(0, n.get_n_pages())] # Returns the currently selected directory/channel object (from gtk) def current_channel_gtk(self): return self.channel_names[self.notebook_channels.get_current_page()] @@ -304,13 +304,14 @@ url = self.channel().meta.get("url", "https://duckduckgo.com/?q=" + self.channel().module) self.action.browser(url) # Reload stream list in current channel-category def on_reload_clicked(self, widget=None, reload=1): - __print__(dbg.UI, "reload", reload, self.current_channel, self.channels[self.current_channel], self.channel().current) + __print__(dbg.UI, "on_reload_clicked()", "reload=", reload, "current_channel=", self.current_channel, "c=", self.channels[self.current_channel], "cat=", self.channel().current) category = self.channel().current self.thread( + #@TODO: should get a wrapper, for HTTP errors, and optionalize bookamrks lambda: ( self.channel().load(category,reload), reload and self.bookmarks.heuristic_update(self.current_channel,category) ) ) # Thread a function, add to worker pool (for utilizing stop button) def thread(self, target, *args): Index: uikit.py ================================================================== --- uikit.py +++ uikit.py @@ -57,11 +57,11 @@ GdkPixbuf = gtk.gdk empty_pixbuf = GdkPixbuf.Pixbuf(gtk.gdk.COLORSPACE_RGB,True,8,16,16) empty_pixbuf.fill(0xFFFFFFFF) # prepare gtkbuilder data -ui_xml = get_data("gtk3.xml", decode=True) +ui_xml = get_data("gtk3.xml.zlib", decode=True, z=True) or get_data("gtk3.xml", decode=True) if ver == 2: ui_xml = ui_xml.replace('version="3.0"', 'version="2.16"')