Check-in [2b729c9433]
Overview
| Comment: | Cleanup exportcat file extension mapping, and fix docs. |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
2b729c9433b68928e39923662443bffd |
| User & Date: | mario on 2015-04-11 19:14:56 |
| Other Links: | manifest | tags |
Context
|
2015-04-12
| ||
| 00:48 | SomaFM.com channel plugin, with entirely static station list. check-in: 6a5133781f user: mario tags: trunk | |
|
2015-04-11
| ||
| 19:14 | Cleanup exportcat file extension mapping, and fix docs. check-in: 2b729c9433 user: mario tags: trunk | |
| 19:14 | Manually implement $XDG_MUSIC_DIR lookup. check-in: b3afb7ed76 user: mario tags: trunk | |
Changes
Modified channels/exportcat.py from [02ad2daff2] to [e085c85a05].
1 2 3 4 5 6 7 8 9 | # encoding: UTF-8 # api: streamtuner2 # title: Export All # description: Exports a complete channel category (all stations into one file). # version: -0.1 # type: feature # category: file # priority: optional # config: | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# encoding: UTF-8
# api: streamtuner2
# title: Export All
# description: Exports a complete channel category (all stations into one file).
# version: -0.1
# type: feature
# category: file
# priority: optional
# config:
# { name: export_format, value: pls, type: select, select: "pls|xspf|m3u|jspf|smil|asx|json", description: Export format. }
# hooks: config_save
#
# Use "Extensions > Export all" in the desired channel and category,
# to export all station entries at once. Currently just export PLS,
# which in turn references other .pls file). Luckily most players
# can cover up for this horrid misdesign.
#
|
| ︙ | ︙ | |||
45 46 47 48 49 50 51 |
def savewindow(self, *w):
cn = self.parent.channel()
source = cn.listformat
streams = cn.streams[cn.current]
fn = uikit.save_file("Export category", None, "%s.%s.%s" % (cn.module, cn.current, conf.export_format))
__print__(dbg.PROC, "Exporting category to", fn)
if fn:
| | < < | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
def savewindow(self, *w):
cn = self.parent.channel()
source = cn.listformat
streams = cn.streams[cn.current]
fn = uikit.save_file("Export category", None, "%s.%s.%s" % (cn.module, cn.current, conf.export_format))
__print__(dbg.PROC, "Exporting category to", fn)
if fn:
dest = re.findall("\.(m3u8?|pls|xspf|jspf|json|smil|asx)8?$", fn.lower())
if dest:
dest = dest[0]
else:
self.parent.status("Unsupported export playlist type (file extension).")
return
action.save_playlist(source="asis", multiply=False).file(rows=streams, fn=fn, dest=dest)
pass
|
Modified help/exportcat.page from [ca8d0fbaec] to [c87fe2cfa8].
| ︙ | ︙ | |||
17 18 19 20 21 22 23 | And it allows to import radio lists into any other music player or playlist collection/management app (such as Rhythmbox).</p> <section id="configuration"> <title>Configuration option</title> <p>You can set the default export format in the settings dialog <key>F12</key>.</p> | | > | 17 18 19 20 21 22 23 24 25 26 27 28 | And it allows to import radio lists into any other music player or playlist collection/management app (such as Rhythmbox).</p> <section id="configuration"> <title>Configuration option</title> <p>You can set the default export format in the settings dialog <key>F12</key>.</p> <p>It supports all common export formats now, with .PLS being the default.</p> </section> </page> |
Modified st2.py from [90b6a5f946] to [4efb5a505d].
1 2 3 4 5 6 7 | #!/usr/bin/env python # # encoding: UTF-8 # api: python # type: application # title: streamtuner2 # description: Directory browser for internet radio, audio and video streams | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#!/usr/bin/env python
#
# encoding: UTF-8
# api: python
# type: application
# title: streamtuner2
# description: Directory browser for internet radio, audio and video streams
# version: 2.1.6
# state: beta
# author: Mario Salzer <mario@include-once.org>
# license: Public Domain
# url: http://freshcode.club/projects/streamtuner2
# config:
# { type: env, name: http_proxy, description: proxy for HTTP access }
# { type: env, name: XDG_CONFIG_HOME, description: relocates user .config subdirectory }
|
| ︙ | ︙ | |||
228 229 230 231 232 233 234 |
def current_channel_gtk(self):
return self.channel_names[self.notebook_channels.get_current_page()]
# Notebook tab has been clicked (receives numeric page_num), but *NOT* yet changed (visually).
def channel_switch(self, notebook, page, page_num=0, *args):
self.current_channel = notebook.get_menu_label_text(notebook.get_nth_page(page_num))
| | | 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
def current_channel_gtk(self):
return self.channel_names[self.notebook_channels.get_current_page()]
# Notebook tab has been clicked (receives numeric page_num), but *NOT* yet changed (visually).
def channel_switch(self, notebook, page, page_num=0, *args):
self.current_channel = notebook.get_menu_label_text(notebook.get_nth_page(page_num))
__print__(dbg.UI, "main.channel_switch() :=", self.current_channel)
self.update_title()
# if first selected, load current category
self.channel().first_show()
# Invoked from the menu instead, uses module name instead of numeric tab id
def channel_switch_by_name(self, name):
self.notebook_channels.set_current_page(self.channel_names.index(name))
|
| ︙ | ︙ |