streamtuner2: Check-in [93908484c3]
Internet radio browser GUI for music/video streams from various directory services.

⌈⌋ branch:  streamtuner2


Check-in [93908484c3]

Overview
Comment:Fixed file open "rt" mode.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:93908484c37e588ad00eadee7af436c825746918
User & Date: mario on 2016-11-09 20:08:13
Other Links: manifest | tags
Context
2016-11-10
17:35
Custom .quote() cmd argument escaping for windows. check-in: 89f9b52549 user: mario tags: trunk
2016-11-09
20:08
Fixed file open "rt" mode. check-in: 93908484c3 user: mario tags: trunk
20:06
Fix binary file open mode (CRLF corruption on Windows) check-in: 9564d3909a user: mario tags: trunk
Changes

Modified action.py from [ce49d58115] to [a6fade5fcd].

370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
    def __init__(self, text=None, fn=None):
        # Literal playlist source content
        if text:
            self.src = text
        # Only read filename if it matches allowed extension
        if fn and self.probe_ext(fn):
            self.fn = fn
            self.src = open(fn, "rt").read()


    # Test URL/path "extension" for ".pls" / ".m3u" etc.
    def probe_ext(self, url):
        e = re.findall("\.(pls|m3u|xspf|jspf|asx|wpl|wsf|smil|html|url|json|desktop)\d?$", url)
        if e: return e[0]
        else: pass







|







370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
    def __init__(self, text=None, fn=None):
        # Literal playlist source content
        if text:
            self.src = text
        # Only read filename if it matches allowed extension
        if fn and self.probe_ext(fn):
            self.fn = fn
            self.src = open(fn, conf.open_mode).read()


    # Test URL/path "extension" for ".pls" / ".m3u" etc.
    def probe_ext(self, url):
        e = re.findall("\.(pls|m3u|xspf|jspf|asx|wpl|wsf|smil|html|url|json|desktop)\d?$", url)
        if e: return e[0]
        else: pass