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

⌈⌋ ⎇ branch:  streamtuner2


Check-in [12d3b19c1d]

Overview
Comment:Support multiple `plugin_base` references (namely "channels" and "plugins").
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 12d3b19c1deefc4c459dc835a583e2f2d1bf195a
User & Date: mario on 2015-05-03 14:08:37
Other Links: manifest | tags
Context
2015-05-03
14:09
Allow to override encoding= for .text results (requests can't detect it automatically for binary/json responses). check-in: 00ff8bac09 user: mario tags: trunk
14:08
Support multiple `plugin_base` references (namely "channels" and "plugins"). check-in: 12d3b19c1d user: mario tags: trunk
14:08
Add .wrap() from configdialog for general use. check-in: 1ad0b9e76b user: mario tags: trunk
Changes

Modified config.py from [974441daf6] to [f4ef1864d6].

389
390
391
392
393
394
395

396
397
398
399
400


401


402
403
404
405
406
407
408
409
# Extremely crude version for Python and streamtuner2 plugin usage.
# But can fetch from different sources:
#  · fn= to read from literal files, out of a .pyzip package
#  · src= to extract from pre-read script code
#  · module= utilizes pkgutil to read 
#  · frame= automatically extract comment header from caller
#

def plugin_meta(fn=None, src=None, module=None, frame=1, plugin_base="channels"):

    # try via pkgutil first
    if module:
       fn = module


       try: src = pkgutil.get_data(plugin_base, fn+".py")


       except: pass  # Notice in plugin_meta_extract() is sufficient

    # get source directly from caller
    elif not src and not fn:
        module = inspect.getmodule(sys._getframe(frame))
        fn = inspect.getsourcefile(module)
        src = inspect.getcomments(module)








>
|




>
>
|
>
>
|







389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
# Extremely crude version for Python and streamtuner2 plugin usage.
# But can fetch from different sources:
#  · fn= to read from literal files, out of a .pyzip package
#  · src= to extract from pre-read script code
#  · module= utilizes pkgutil to read 
#  · frame= automatically extract comment header from caller
#
plugin_base = ("channels", "plugins")
def plugin_meta(fn=None, src=None, module=None, frame=1):

    # try via pkgutil first
    if module:
       fn = module
       for base in plugin_base:
           try:
               src = pkgutil.get_data(base, fn+".py")
               if src: break
           except:
               continue  # plugin_meta_extract() will print a notice later

    # get source directly from caller
    elif not src and not fn:
        module = inspect.getmodule(sys._getframe(frame))
        fn = inspect.getsourcefile(module)
        src = inspect.getcomments(module)