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

⌈⌋ ⎇ branch:  streamtuner2


Check-in [cda3504633]

Overview
Comment:catmap{} cache handling now by _generic module
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: cda3504633ec7144f75c08a0bb59e8326874597a
User & Date: mario on 2014-08-01 01:34:20
Other Links: manifest | tags
Context
2014-08-01
01:35
Initial support for Dirble.com, provides grouped categories and search feature. check-in: 7965619312 user: mario tags: trunk
01:34
catmap{} cache handling now by _generic module check-in: cda3504633 user: mario tags: trunk
2014-07-31
17:22
Adapted Live365 channel plugin for /cgi-bin/play.pls?stationid=123457&direct=1 stream URLs instead of extraction, works again check-in: 8b3cd06ff7 user: mario tags: trunk
Changes

Modified channels/_generic.py from [530431fbe1] to [e9222413a9].

54
55
56
57
58
59
60

61
62
63
64
65
66
67
        listformat = "audio/x-scpls"
        audioformat = "audio/mpeg" # fallback value
        config = []
        has_search = False

        # categories
        categories = ["empty", ]

        current = ""
        default = "empty"
        shown = None     # last selected entry in stream list, also indicator if notebook tab has been selected once / stream list of current category been displayed yet

        # gui + data
        streams = {}      #meta information dicts
        liststore = {}    #gtk data structure







>







54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
        listformat = "audio/x-scpls"
        audioformat = "audio/mpeg" # fallback value
        config = []
        has_search = False

        # categories
        categories = ["empty", ]
        catmap = {}
        current = ""
        default = "empty"
        shown = None     # last selected entry in stream list, also indicator if notebook tab has been selected once / stream list of current category been displayed yet

        # gui + data
        streams = {}      #meta information dicts
        liststore = {}    #gtk data structure
129
130
131
132
133
134
135




136
137
138
139
140
141
142
            cache = conf.load("cache/" + self.module)
            if (cache):
                self.streams = cache
            # categories
            cache = conf.load("cache/categories_" + self.module)
            if (cache):
                self.categories = cache




            pass

            
        # initialize Gtk widgets / data objects
        def gui(self, parent):
            #print(self.module + ".gui()")








>
>
>
>







130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
            cache = conf.load("cache/" + self.module)
            if (cache):
                self.streams = cache
            # categories
            cache = conf.load("cache/categories_" + self.module)
            if (cache):
                self.categories = cache
            # catmap (optional)
            cache = conf.load("cache/catmap_" + self.module)
            if (cache):
                self.catmap = cache
            pass

            
        # initialize Gtk widgets / data objects
        def gui(self, parent):
            #print(self.module + ".gui()")

372
373
374
375
376
377
378

379


380
381
382
383
384
385
386


        # update categories, save, and display                
        def reload_categories(self):
        
            # get data and save
            self.update_categories()

            conf.save("cache/categories_"+self.module, self.categories)



            # display outside of this non-main thread            
            mygtk.do(self.display_categories)

        # insert content into gtk category list
        def display_categories(self):
        







>
|
>
>







377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394


        # update categories, save, and display                
        def reload_categories(self):
        
            # get data and save
            self.update_categories()
            if self.categories:
                conf.save("cache/categories_"+self.module, self.categories)
            if self.catmap:
                conf.save("cache/catmap_" + self.module, self.catmap);

            # display outside of this non-main thread            
            mygtk.do(self.display_categories)

        # insert content into gtk category list
        def display_categories(self):
        
460
461
462
463
464
465
466





467
468
469
470
471
472
473
        # remove SGML/XML entities
        def entity_decode(self, s):
            return xml.sax.saxutils.unescape(s)
        
        # convert special characters to &xx; escapes
        def xmlentities(self, s):
            return xml.sax.saxutils.escape(s)



















>
>
>
>
>







468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
        # remove SGML/XML entities
        def entity_decode(self, s):
            return xml.sax.saxutils.unescape(s)
        
        # convert special characters to &xx; escapes
        def xmlentities(self, s):
            return xml.sax.saxutils.escape(s)
        
        # Extracts integer from string
        def to_int(self, s):
            i = re.findall("\d+", s) or [0]
            return int(i[0])