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

⌈⌋ ⎇ branch:  streamtuner2


Check-in [d0a9fca2bd]

Overview
Comment:Fix some print and log statements.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d0a9fca2bdfa6200e85309323f7322e5f67fd743
User & Date: mario on 2015-05-06 00:07:54
Other Links: manifest | tags
Context
2015-05-06
00:08
Release as 2.1.8 check-in: b0a6a50a20 user: mario tags: trunk, 2.1.8
00:07
Fix some print and log statements. check-in: d0a9fca2bd user: mario tags: trunk
00:07
Use Gtk3/gdk.Color.parse() as fallback to .get_colormap(), get rid of style copying (was only necessary with the previous theming support IIRC). check-in: ae1d856e69 user: mario tags: trunk
Changes

Modified channels/dirble.py from [b1c153b5bc] to [db262a5d06].

57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
    key = "a0bdd7b8efc2f5d1ebdf1728b65a07ece4c73de5"


    # Retrieve cat list and map
    def update_categories(self):
        cats = []
        for row in self.api("categories/tree"):
            print row
            cats += [row["title"]]
            self.catmap[row["title"]] = row["id"]
            if row.get("children"):
                cats += [[c["title"] for c in row["children"]]]
                for c in row["children"]:
                    self.catmap[c["title"]] = c["id"]
        self.categories = cats







<







57
58
59
60
61
62
63

64
65
66
67
68
69
70
    key = "a0bdd7b8efc2f5d1ebdf1728b65a07ece4c73de5"


    # Retrieve cat list and map
    def update_categories(self):
        cats = []
        for row in self.api("categories/tree"):

            cats += [row["title"]]
            self.catmap[row["title"]] = row["id"]
            if row.get("children"):
                cats += [[c["title"] for c in row["children"]]]
                for c in row["children"]:
                    self.catmap[c["title"]] = c["id"]
        self.categories = cats

Modified channels/somafm.py from [60212d55e2] to [ff62835ca5].

101
102
103
104
105
106
107
108
109
110
            <p.*?>(.+?)</p> .*?
            href="(http://somafm.com/.+?.pls)" .*?
        """, html, re.X|re.S)
        rows = [
           dict(genre=g, title=t, playing=p, url=u, listeners=int(l), bitrate=128, homepage=re.sub("\d*\.pls$", "/", u))
            for l,g,t,p,u in ls
        ]
        #print rows
        return rows
        







|


101
102
103
104
105
106
107
108
109
110
            <p.*?>(.+?)</p> .*?
            href="(http://somafm.com/.+?.pls)" .*?
        """, html, re.X|re.S)
        rows = [
           dict(genre=g, title=t, playing=p, url=u, listeners=int(l), bitrate=128, homepage=re.sub("\d*\.pls$", "/", u))
            for l,g,t,p,u in ls
        ]
        #log.DATA(rows)
        return rows
        

Modified channels/timer.py from [d2257940ad] to [3c5751b8b1].

114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
        
        
    # add event to list
    def queue(self, row):
    
        # chk
        if not row.get(self.timefield) or not row.get("url"):
            #print("NO TIME DATA", row)
            return
    
        # extract timing parameters
        _ = row[self.timefield]
        days = self.days(_)
        time = self.time(_)
        duration = self.duration(_)







|







114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
        
        
    # add event to list
    def queue(self, row):
    
        # chk
        if not row.get(self.timefield) or not row.get("url"):
            #log.DATA("NO TIME DATA", row)
            return
    
        # extract timing parameters
        _ = row[self.timefield]
        days = self.days(_)
        time = self.time(_)
        duration = self.duration(_)
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
            url = row["url"],
            audioformat = row.get("format","audio/mpeg"), 
            listformat = row.get("listformat","href"),
        )

    # action wrapper
    def record(self, row, *args, **kwargs):
        #print("TIMED RECORD")
        
        # extra params
        duration = self.duration(row.get(self.timefield))
        if duration:
            append = " -a %S.%d.%q -l "+str(duration*60)   # make streamripper record a whole broadcast
        else:
            append = ""

        # start recording
        action.record(
            url = row["url"],
            audioformat = row.get("format","audio/mpeg"), 
            listformat = row.get("listformat","href"),
            append = append,
        )
    
    def test(self, row, *args, **kwargs):
        print("TEST KRONOS", row)









|

















|


172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
            url = row["url"],
            audioformat = row.get("format","audio/mpeg"), 
            listformat = row.get("listformat","href"),
        )

    # action wrapper
    def record(self, row, *args, **kwargs):
        #log.TIMER("TIMED RECORD", *args)
        
        # extra params
        duration = self.duration(row.get(self.timefield))
        if duration:
            append = " -a %S.%d.%q -l "+str(duration*60)   # make streamripper record a whole broadcast
        else:
            append = ""

        # start recording
        action.record(
            url = row["url"],
            audioformat = row.get("format","audio/mpeg"), 
            listformat = row.get("listformat","href"),
            append = append,
        )
    
    def test(self, row, *args, **kwargs):
        log.TEST("KRONOS", row)


Modified config.py from [cf1c2001f3] to [8242f27bc4].

294
295
296
297
298
299
300
301
302
303
304
305
306
307
308

    # Use config:-style definitions for argv extraction,
    # such as: { arg: -D, name: debug, type: bool }
    def init_args(self, ap):
        for opt in plugin_meta(frame=1).get("config"):
            kwargs = pluginconf.argparse_map(opt)
            if kwargs:
                #print kwargs
                ap.add_argument(*kwargs.pop("args"), **kwargs)
        return ap.parse_args()


    # Copy args fields into conf. dict
    def apply_args(self, args):
        self.debug = args.debug







|







294
295
296
297
298
299
300
301
302
303
304
305
306
307
308

    # Use config:-style definitions for argv extraction,
    # such as: { arg: -D, name: debug, type: bool }
    def init_args(self, ap):
        for opt in plugin_meta(frame=1).get("config"):
            kwargs = pluginconf.argparse_map(opt)
            if kwargs:
                #print(kwargs)
                ap.add_argument(*kwargs.pop("args"), **kwargs)
        return ap.parse_args()


    # Copy args fields into conf. dict
    def apply_args(self, args):
        self.debug = args.debug