From: Jorg S. <jor...@gm...> - 2006-10-17 15:26:54
|
Thanks Clarke, I'll go over your patches once I get back home and find some time. I appreciate you input -- keep on sending patches! Cheers, JCS. -------- Original-Nachricht -------- Datum: Mon, 16 Oct 2006 20:24:59 -0700 Von: Clarke Brunsdon <cl...@vo...> An: gtkpod-devel <gtk...@li...> Betreff: [Gtkpod-devel] Patch to allow a filter on evolution calendar sync > The following patch adds another option to the sync-evolcalendar script, > allowing a filter script to be ran before the ical information is > recoded. > > This means that uers can add a filter script in before the data is added > to the ical (for me, that means filtering out all VTASKS that are marked > as Completed). > > It also cuts the sleep at the end from 30 seconds to 5 (anyone know why > the sleep is there, anyway?). > > Thanks > ~Clarke Brunsdon > > Index: scripts/sync-evocalendar.sh > =================================================================== > RCS file: /cvsroot/gtkpod/gtkpod/scripts/sync-evocalendar.sh,v > retrieving revision 1.3 > diff -u -r1.3 sync-evocalendar.sh > --- scripts/sync-evocalendar.sh 8 Mar 2006 13:15:34 -0000 1.3 > +++ scripts/sync-evocalendar.sh 16 Oct 2006 16:41:24 -0000 > @@ -6,11 +6,15 @@ > # > # sync-evocalendar.sh [-i <ipod mountpoint>] [-e <encoding>] > # ... [-c <evolution calendar file>] [-t <evolution > tasks file>] > +# ... [-f <ical filter script>] > # > # with the following defaults: > > IPOD_MOUNT=/mnt/ipod # mountpoint of ipod > > +#the path to a script that will be passed the ical information from > STDIN and filter, if needed > +#FILTER_SCRIPT= > + > #get all the local evolution calendars > CALFILES=`find ~/.evolution/calendar/local/ -name "calendar.ics"` > > @@ -78,7 +82,8 @@ > c) CALFILES=$OPTARG;; > t) TASKFILES=$OPTARG;; > e) ENCODING=$OPTARG;; > - \?) echo "Usage: `basename $0` [-i <ipod mountpoint>] [-c > <evolution calendar file>] [-t <evolution tasks file>] [-e <encoding>]" > + f) FILTER=$OPTARG;; > + \?) echo "Usage: `basename $0` [-i <ipod mountpoint>] > [-c <evolution calendar file>] [-t <evolution tasks file>] [-f <filter > script>] [-e <encoding>]" > exit 1;; > esac > done > @@ -91,6 +96,11 @@ > RECODE="iconv -f UTF-8 -t $ENCODING" > fi > > +if [ $FILTER_SCRIPT ]; then > + FILTER=$FILTER_SCRIPT > +else > + FILTER="cat" > +fi > > # check if CALFILES exist > for i in $CALFILES; do > @@ -110,8 +120,9 @@ > > echo $CALFILES > echo $TASKFILES > -sleep 30 > + > +sleep 5 > # remove all empty lines and recode if necessary > echo -n "Syncing iPod ... [Calendar] " > - cat $CALFILES $TASKFILES | grep -v '^[[:space:]]$\|^$' | $RECODE > > $IPOD_MOUNT/Calendars/evolution > + cat $CALFILES $TASKFILES | grep -v '^[[:space:]]$\|^$' | $FILTER > | $RECODE > $IPOD_MOUNT/Calendars/evolution > echo "done!" > > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Gtkpod-devel mailing list > Gtk...@li... > https://lists.sourceforge.net/lists/listinfo/gtkpod-devel -- What's the difference between eating sugar (e.g. candy bar) and eating carbon hydrates (let's say a loaf of bread)? GMX DSL-Flatrate 0,- Euro* - Überall, wo DSL verfügbar ist! NEU: Jetzt bis zu 16.000 kBit/s! http://www.gmx.net/de/go/dsl |