Closes #81: default to python2 and fallback to python

This commit is contained in:
Bruno Pinto 2014-01-06 18:57:32 -02:00
parent 1d7a56177a
commit ef24766b0e
4 changed files with 14 additions and 4 deletions

View File

@ -0,0 +1,8 @@
# Use python2 if found, otherwise fallback to python.
function _python
if which python2
python2
else
python
end
end

View File

@ -1,5 +1,5 @@
# beautify json string
# use : pybeautifyjson '{"foo": "lorem", "bar": "ipsum"}'
function pybeautifyjson
echo $argv | python -mjson.tool
end
echo $argv | _python -mjson.tool
end

View File

@ -5,5 +5,6 @@ function pyhttp
else
set HTTPPORT 1025
end
python -m SimpleHTTPServer $HTTPPORT;
_python -m SimpleHTTPServer $HTTPPORT;
end

View File

@ -5,6 +5,7 @@ function pysmtp
else
set SMTPPORT 1025
end
echo "smtp server started on port" $SMTPPORT;
python -m smtpd -n -c DebuggingServer localhost:$SMTPPORT;
_python -m smtpd -n -c DebuggingServer localhost:$SMTPPORT;
end