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

⌈⌋ branch:  streamtuner2


Check-in [52f8cb3961]

Overview
Comment:action: optionalize quoting for BSD/Linux if plain http:// url without special chars. And fix regex to properly caret-escape + quote for Windows.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:52f8cb3961ce1d9ed4cf867de2ca52bd046c8219
User & Date: mario on 2016-11-13 13:23:35
Other Links: manifest | tags
Context
2016-11-13
13:23
Workaround plugin for RadioSure multi-URL entries. check-in: 80f3cdf4c2 user: mario tags: trunk
13:23
action: optionalize quoting for BSD/Linux if plain http:// url without special chars. And fix regex to properly caret-escape + quote for Windows. check-in: 52f8cb3961 user: mario tags: trunk
2016-11-11
22:58
Adapt GenericChannel to use state icon for multi-URL stations. Fix RadioSure slightly to use spaces instead of TABs for `url` lists. check-in: 4ebb6babed user: mario tags: trunk
Changes

Modified action.py from [3ad993befe] to [1335d1a09a].

180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196



197
198
199
200
201
202
203
204
205


# OS shell command escaping
#
def quote(ins):
    if type(ins) is list:
        return " ".join([quote(s) for s in ins])
    # Windows: double quotes
    elif conf.windows:
        if re.search(r"""[()<>&%!^'";\s]""", ins):
            ins = re.sub(r"([()<>&%^])", "^$1", ins)
            ins = ins.replace('"', '\\^"')
            return '"%s"' % ins
        else:
            return subprocess.list2cmdline([ins])
    # Posix-style shell quoting
    else:



        return pipes.quote(ins)
        return "%r" % ins


# Convert e.g. "text/x-scpls" MIME types to just "pls" monikers
#
def listfmt(t = "pls"):
    return listfmt_t.get(t, t) # e.g. "pls" or still "text/x-unknown"








|


|
|
|




>
>
>
|
|







180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208


# OS shell command escaping
#
def quote(ins):
    if type(ins) is list:
        return " ".join([quote(s) for s in ins])
    # Windows: double quotes / caret escaping
    elif conf.windows:
        if re.search(r"""[()<>&%!^'";\s]""", ins):
            ins = '"%s"' % ins
            ins = re.sub(r'([()<>"&%^])', r"^\1", ins)
            return ins
        else:
            return subprocess.list2cmdline([ins])
    # Posix-style shell quoting
    else:
        if re.match("^\w[\w.:/\-]+$", ins):
            return ins
        else:
            return pipes.quote(ins)
    #return "%r" % ins


# Convert e.g. "text/x-scpls" MIME types to just "pls" monikers
#
def listfmt(t = "pls"):
    return listfmt_t.get(t, t) # e.g. "pls" or still "text/x-unknown"