forked from boatbod/op25
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wrapper method of dynamically determining correct python version
- Loading branch information
Showing
6 changed files
with
132 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/env python | ||
|
||
#!/bin/sh | ||
# Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017 Max H. Parke KA1RBI | ||
# Copyright 2020 Graham J. Norbury - [email protected] | ||
# | ||
|
@@ -20,6 +19,29 @@ | |
# Software Foundation, Inc., 51 Franklin Street, Boston, MA | ||
# 02110-1301, USA. | ||
|
||
"true" '''\' | ||
DEFAULT_PYTHON2=/usr/bin/python | ||
DEFAULT_PYTHON3=/usr/bin/python3 | ||
if [ -f op25_python ]; then | ||
OP25_PYTHON=$(cat op25_python) | ||
else | ||
OP25_PYTHON="/usr/bin/python" | ||
fi | ||
|
||
if [ -x $OP25_PYTHON ]; then | ||
echo Using Python $OP25_PYTHON >&2 | ||
exec $OP25_PYTHON "$0" "$@" | ||
elif [ -x $DEFAULT_PYTHON2 ]; then | ||
echo Using Python $DEFAULT_PYTHON2 >&2 | ||
exec $DEFAULT_PYTHON2 "$0" "$@" | ||
elif [ -x $DEFAULT_PYTHON3 ]; then | ||
echo Using Python $DEFAULT_PYTHON3 >&2 | ||
exec $DEFAULT_PYTHON3 "$0" "$@" | ||
else | ||
echo Unable to find Python >&2 | ||
fi | ||
exit 127 | ||
''' | ||
import io | ||
import os | ||
import sys | ||
|
@@ -574,7 +596,7 @@ def configure_metadata(self, config): | |
sys.stderr.write("Configuring metadata stream #%d [%s]: %s\n" % (idx, stream_name, stream['icecastServerAddress'] + "/" + stream['icecastMountpoint'])) | ||
except: | ||
sys.stderr.write("Error configuring metadata stream #%d; %s\n" % (idx, sys.exc_info()[1])) | ||
sys.exc_clear() | ||
#sys.exc_clear() | ||
else: | ||
sys.stderr.write("Ignoring unnamed metadata stream #%d\n" % idx) | ||
idx += 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters