8 REPS
="'-b': '$IOCFG.b=True $IOCFG.f=',\
9 '-i': '$IOCFG.i=True',\
10 '-h': '$IOCFG.h=True',\
12 '-q': '--no-banner --IOscopyConfig.quiet=True'"
16 profd
=`$IPYTHON --quick --profile=$IOSCOPY --no-banner --quiet --no-confirm-exit --classic --HistoryManager.hist_file=$tmpf<< EOF| grep /
18 print "\n" + ip.profile_dir.location + "\n"
24 which $IPYTHON > /dev
/null
26 echo IPython not found
30 # Validate version of IPython. Option name changed between 0.10 and 0.13.
31 if [ "0`$IPYTHON --version | tr -d . | cut -c 1-3`" -lt "0013" ]; then
32 echo IPython
'>' 0.13 needed to run IOscopy
34 elif [ "0`$IPYTHON --Version | tr -d . | cut -c 1-3`" -lt "0013" ]; then
35 echo IPython
'>' 0.13 needed to run IOscopy
39 # Now IPython version is validated, let's look for ioscopy profile
40 $IPYTHON profile list
--log-level=40 |
grep $IOSCOPY > /dev
/null
42 echo IPython
$IOSCOPY profile not found
, creating it.
43 $IPYTHON profile create
$IOSCOPY
45 if [ ! -d $profd ]; then
48 cp @datarootdir@
/oscopy
/ipython_config.py
$profd
51 if [ ! -f "$profd/ipython_config.py" ]; then
52 echo IPython
$IOSCOPY profile
file not found
, copying it.
53 cp @datarootdir@
/oscopy
/ipython_config.py
$profd
54 elif [ "$profd/ipython_config.py" -ot "@datarootdir@/oscopy/ipython_config.py" ]; then
57 read -p "IPython $IOSCOPY profile file is outdated, update [N/y] ? " upd
59 if [ "$upd" = "Y" -o "$upd" = "y" ] ; then
60 echo Updating IPython
$IOSCOPY profile.
62 cp @datarootdir@
/oscopy
/ipython_config.py
$profd
64 echo "skipping profile update."
70 # Replace short args with their equivalent, and delete space between = and
71 # file name when needed
74 argout=[reps.get(s, s) for s in "$*".split()]
75 print " ".join(argout).replace(".f= ", ".f=")
77 #echo ///// $args +++++++++++++++++++++++
78 $IPYTHON --profile=$IOSCOPY $args