mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
Merge pull request #150 from blueyed/master
Make autojump work with Python 2.6 again: vendorize argparse.
This commit is contained in:
commit
a2657d6fca
11
bin/autojump
11
bin/autojump
@ -21,12 +21,17 @@
|
|||||||
|
|
||||||
from __future__ import division, print_function
|
from __future__ import division, print_function
|
||||||
|
|
||||||
import argparse
|
import sys
|
||||||
from operator import itemgetter
|
|
||||||
import os
|
import os
|
||||||
|
try:
|
||||||
|
import argparse
|
||||||
|
except ImportError:
|
||||||
|
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
|
||||||
|
import autojump_argparse as argparse
|
||||||
|
sys.path.pop()
|
||||||
|
from operator import itemgetter
|
||||||
import re
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
|
||||||
from tempfile import NamedTemporaryFile
|
from tempfile import NamedTemporaryFile
|
||||||
|
|
||||||
VERSION = 'release-v21-rc.2'
|
VERSION = 'release-v21-rc.2'
|
||||||
|
2362
bin/autojump_argparse.py
Normal file
2362
bin/autojump_argparse.py
Normal file
File diff suppressed because it is too large
Load Diff
32
install.sh
32
install.sh
@ -110,35 +110,10 @@ fi
|
|||||||
if [ ! ${force} ]; then
|
if [ ! ${force} ]; then
|
||||||
python_version=`python -c 'import sys; print(sys.version_info[:])'`
|
python_version=`python -c 'import sys; print(sys.version_info[:])'`
|
||||||
|
|
||||||
if [[ ${python_version:1:1} -eq 3 && ${python_version:4:1} -lt 2 ]]; then
|
if [[ ${python_version:1:1} -eq 2 && ${python_version:4:1} -lt 6 ]]; then
|
||||||
echo
|
echo
|
||||||
echo "Incompatible Python version, please upgrade to v2.7+ or v3.2+."
|
echo "Incompatible Python version, please upgrade to v2.6+."
|
||||||
echo
|
if [[ ${python_version:4:1} -ge 4 ]]; then
|
||||||
echo "Alternatively, you can download v19 that supports Python v3.0+ from:"
|
|
||||||
echo
|
|
||||||
echo -e "\thttps://github.com/joelthelion/autojump/downloads"
|
|
||||||
echo
|
|
||||||
echo "OR"
|
|
||||||
echo
|
|
||||||
echo "Install argparse manually using 'pip install argparse' and then reattempt the installation using the --force option."
|
|
||||||
echo
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${python_version:1:1} -eq 2 && ${python_version:4:1} -lt 7 ]]; then
|
|
||||||
echo
|
|
||||||
echo "Incompatible Python version, please upgrade to v2.7+ or v3.2+."
|
|
||||||
if [[ ${python_version:4:1} -ge 6 ]]; then
|
|
||||||
echo
|
|
||||||
echo "Alternatively, you can download v19 that supports Python v2.6+ from:"
|
|
||||||
echo
|
|
||||||
echo -e "\thttps://github.com/joelthelion/autojump/downloads"
|
|
||||||
echo
|
|
||||||
echo "OR"
|
|
||||||
echo
|
|
||||||
echo "Install argparse manually using 'pip install argparse' and then reattempt the installation using the --force option."
|
|
||||||
echo
|
|
||||||
elif [[ ${python_version:4:1} -ge 4 ]]; then
|
|
||||||
echo
|
echo
|
||||||
echo "Alternatively, you can download v12 that supports Python v2.4+ from:"
|
echo "Alternatively, you can download v12 that supports Python v2.4+ from:"
|
||||||
echo
|
echo
|
||||||
@ -163,6 +138,7 @@ mkdir -p ${prefix}/share/man/man1/
|
|||||||
cp -v ./bin/icon.png ${prefix}/share/autojump/
|
cp -v ./bin/icon.png ${prefix}/share/autojump/
|
||||||
cp -v ./bin/jumpapplet ${prefix}/bin/
|
cp -v ./bin/jumpapplet ${prefix}/bin/
|
||||||
cp -v ./bin/autojump ${prefix}/bin/
|
cp -v ./bin/autojump ${prefix}/bin/
|
||||||
|
cp -v ./bin/autojump_argparse.py ${prefix}/bin/
|
||||||
cp -v ./docs/autojump.1 ${prefix}/share/man/man1/
|
cp -v ./docs/autojump.1 ${prefix}/share/man/man1/
|
||||||
|
|
||||||
# global installation
|
# global installation
|
||||||
|
Loading…
Reference in New Issue
Block a user