Commit 37e96a87 authored by Jean-Francois Dockes's avatar Jean-Francois Dockes
Browse files

Explicitely specify python2 for all python scripts: better to stay explicit...

Explicitely specify python2 for all python scripts: better to stay explicit and consistent until we switch everything to python3
parent 4a44b16d
#!/usr/bin/env python
#!/usr/bin/env python2
#
# A lot of code copied from the Kodi Tidal addon which is:
# Copyright (C) 2014 Thomas Amland
......
#!/usr/bin/env python
#!/usr/bin/env python2
#
# A lot of code copied from the Kodi Tidal addon which is:
# Copyright (C) 2014 Thomas Amland
......
#!/usr/bin/env python
#!/usr/bin/env python2
#
# A lot of code copied from the Kodi Tidal addon which is:
# Copyright (C) 2014 Thomas Amland
......
#!/usr/bin/env python
#!/usr/bin/env python2
#
# Copyright (C) 2017 J.F.Dockes
#
......
#!/usr/bin/env python
#!/usr/bin/env python2
#
# Copyright (C) 2017 J.F.Dockes
#
......
#!/usr/bin/env python
#
# Copyright (C) 2017 J.F.Dockes
#
# This program is free software: you can redistribute it and/or modify
......
#!/usr/bin/env python
#!/usr/bin/env python2
#
# Copyright (C) 2017 J.F.Dockes
#
......
#!/usr/bin/env python3
#
# Metadata getter for fip stations, we get the station number as first
# parameter (set in config file).
#!/usr/bin/env python2
from __future__ import print_function
# metadata getter for French radio FIP stations, we get the station
# number as first parameter (set in config file).
import requests
import json
import sys
......
#!/usr/bin/env python3
#!/usr/bin/env python2
# Copyright (C) 2017-2018 J.F.Dockes
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -30,6 +30,8 @@
# right metadata available when upmpdcli calls us
from __future__ import print_function
import requests
import json
import sys
......@@ -49,6 +51,11 @@ def newcache(jsd):
os.chmod(tmpname, 0o666)
out["audioUrl"] = jsd['url'] + "?src=alexa"
def makebytes(data):
if type(data) == type(u''):
return data.encode("UTF-8", errors='replace')
return data
##### Main script
......@@ -137,5 +144,5 @@ else:
reload -= 2
out['reload'] = reload
debug("%s" % json.dumps(out))
print("%s" % json.dumps(out))
debug("%s" % makebytes(json.dumps(out)))
print("%s" % makebytes(json.dumps(out)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment