Internet radio browser GUI for music/video streams from various directory services.

⌈⌋ branch:  streamtuner2


Check-in [6106a0bcdd]

Overview
Comment:Remove channels.module_meta(), wich is now config.plugin_meta() and closer to plugin meta data spec.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6106a0bcdd652e9d521916f49e7dabac4c5b27fb
User & Date: mario on 2015-03-28 07:29:10
Other Links: manifest | tags
Context
2015-03-28
07:30
Add .deb package $DEPS. check-in: 58df0e920e user: mario tags: trunk
07:29
Remove channels.module_meta(), wich is now config.plugin_meta() and closer to plugin meta data spec. check-in: 6106a0bcdd user: mario tags: trunk
07:28
Add timeout for HTTP requests. (Bug report regarding xiph plugin and cache server blocking startup.) check-in: a2d2843470 user: mario tags: trunk
Changes

Modified channels/__init__.py from [720f2889ce] to [9432295735].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17



18

19
20
21
22
23
24
25
#
# encoding: UTF-8
# api: streamtuner2
# title: Plugin handling
# description: Channels and feature plugins reside in channels/
# type: R
# category: core
# priority: core
# pack:
#   file.py, _generic.py, global_key.py, history.py, icast.py,
#   internet_radio.py, itunes.py, jamendo.py, links.py, live365.py,
#   modarchive.py, myoggradio.py, punkcast.py, shoutcast.py,
#   surfmusik.py, tunein.py, timer.py, xiph.py, youtube.py, *.png
# obsolete:
#   dirble.py 
#
#






from channels._generic import *

# Only reexport plugin classes
__all__ = [
    "GenericChannel", "ChannelPlugin"
]












|
<
|


>
>
>
|
>







1
2
3
4
5
6
7
8
9
10
11
12
13

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#
# encoding: UTF-8
# api: streamtuner2
# title: Plugin handling
# description: Channels and feature plugins reside in channels/
# type: R
# category: core
# priority: core
# pack:
#   file.py, _generic.py, global_key.py, history.py, icast.py,
#   internet_radio.py, itunes.py, jamendo.py, links.py, live365.py,
#   modarchive.py, myoggradio.py, punkcast.py, shoutcast.py,
#   surfmusik.py, tunein.py, timer.py, xiph.py, youtube.py,

#   radiotray.py, *.png
#
#
# Just exports GenericChannel and ChannelPlugin. Makes module
# scanning and meta data parsing available.  Currently just for
# globally-installed /usr/share/streamtuner2/channel/*.py plugins.
#
#

from channels._generic import *

# Only reexport plugin classes
__all__ = [
    "GenericChannel", "ChannelPlugin"
]
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
    ls = [fn[:-3] for fn in ls if re.match("^[a-z][\w\d_]+\.py$", fn)]
    
    # resort with tab order
    order = [module.strip() for module in conf.channel_order.lower().replace(".","_").replace("-","_").split(",")]
    ls = [module for module in (order) if (module in ls)] + [module for module in (ls) if (module not in order)]

    return ls


# Parse plugin comment blocks.
#
def module_meta():
    meta = {}

    rx_meta = re.compile(r"""^#\s*(\w+):\s*(.+)$""", re.M)

    # Loop through all existing module.py scripts
    for name in module_list():
       meta[name] = dict(title="", type="", description="")

       # Read and regex-extract into dict
       with open("%s/channels/%s.py" % (conf.share, name)) as f:
           for field in re.findall(rx_meta, f.read(1024)):
               meta[name][field[0]] = field[1]

    return meta












<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
39
40
41
42
43
44
45
46






















    ls = [fn[:-3] for fn in ls if re.match("^[a-z][\w\d_]+\.py$", fn)]
    
    # resort with tab order
    order = [module.strip() for module in conf.channel_order.lower().replace(".","_").replace("-","_").split(",")]
    ls = [module for module in (order) if (module in ls)] + [module for module in (ls) if (module not in order)]

    return ls