Update file paths in po/
[oscopy.git] / ioscopy_app.sh
blobe1082feeabdd89199452b6f57833287702781be5
1 #!/bin/sh
2 #-*-Shell-*-
4 IPYTHON=ipython
5 IOSCOPY=ioscopy
7 getprofd () {
8 profd=`$IPYTHON --quick --profile=$IOSCOPY --no-banner --quiet --no-confirm-exit --classic<< EOF| grep /
9 ip=get_ipython()
10 print "\n" + ip.profile_dir.location + "\n"
11 EOF`;
14 $IPYTHON profile list --log-level=40 | grep $IOSCOPY > /dev/null
15 if [ $? -ne 0 ]; then
16 echo IPython $IOSCOPY profile not found, creating it.
17 $IPYTHON profile create $IOSCOPY
18 getprofd
19 cp @datarootdir@/oscopy/ipython_config.py $profd
20 else
21 getprofd
22 if [ ! -f "$profd/ipython_config.py" ]; then
23 echo IPython $IOSCOPY profile file not found, copying it.
24 cp @datarootdir@/oscopy/ipython_config.py $profd
25 elif [ "$profd/ipython_config.py" -ot "@datarootdir@/oscopy/ipython_config.py" ]; then
26 echo
27 upd=0
28 read -p "IPython $IOSCOPY profile file is outdated, update [N/y] ? " upd
29 echo
30 if [ "$upd" = "Y" -o "$upd" = "y" ] ; then
31 echo Updating IPython $IOSCOPY profile.
32 echo
33 cp @datarootdir@/oscopy/ipython_config.py $profd
34 else
35 echo "skipping profile update."
36 echo
40 args=$*
41 args=`echo $* | sed -e 's/-b[[:space:]]*/--IOscopy.batch=True --IOscopy.file=/; s/-i/--IOscopy.interactive=True/ ; s/-h/--IOscopy.help=True/ ; s/-H/-h/; s/-q/--IOscopy.quiet=True/'`
42 $IPYTHON --profile=$IOSCOPY $args