[SyncEvolution] Syncevlution --import could not import all events for some calendars(?)

Patrick Ohly patrick.ohly at intel.com
Fri Feb 14 09:47:50 UTC 2014


On Thu, 2014-02-13 at 21:34 +0005, Sunny Sigara wrote:

> I am trying to import a google holiday calendar with "syncevolution
> --import function.
> While it can import all events from a evolution-ical file just fine,
> it fails to do so for google calendar. I am using syncevolution-1.3.2
> on saucy.
> 
> 
> '''
> cd ~/Desktop/calendar
> 
> 
> wget https://www.google.com/calendar/ical/en.indian%23holiday%
> 40group.v.calendar.google.com/public/basic.ics

The problem is that SyncEvolution cannot split up .ics files which have
multiple VEVENT/VTODO/VJOURNAL components in a single big VCALENDAR.
This is what the Google calendar file contains.

The --import code which splits the file and then passes individual
chunks of it to the backend into which they are to be imported only
knows how to split at empty lines (the default). From the man page:


       syncevolution --print-items <config> <source>
       syncevolution [--delimiter <string>] --export <dir>|<file>|- [<config> [<source> [<luid> ...]]]
       syncevolution [--delimiter <string>|none] --import <dir>|<file>|- [<config> <source>]
       syncevolution --update <dir> <config> <source>
       syncevolution [--delimiter <string>|none] --update <file>|- <config> <source> <luid> ...
       syncevolution --delete-items <config> <source> (<luid> ... | *)

       [...]

       --export
              Writes  all  items in the source or all items whose <luid> is given into a directory if the --export
              parameter exists and is a directory. The <luid> of each item is used as file name. Otherwise it cre‐
              ates  a  new  file  under  that name and writes the selected items separated by the chosen delimiter
              string. stdout can be selected with a dash.

              The default delimiter (two line breaks) matches a blank line. As a special case, it also  matches  a
              blank  line with DOS line ending (line break, carriage return, line break). This works for vCard 3.0
              and iCalendar 2.0, which never contain blank lines.

              When exporting, the default delimiter will always insert two  line  breaks  regardless  whether  the
              items contain DOS line ends. As a special case, the initial newline of a delimiter is skipped if the
              item already ends in a newline.

       --import
              Adds all items found in the directory or input file to the source.  When reading from  a  directory,
              each  file  is  treated as one item. Otherwise the input is split at the chosen delimiter. "none" as
              delimiter disables splitting of the input.


If someone was interested in fixing this, he or she would have to add
methods in SyncSource for splitting up text according to the expected
content and then have the generic --import code call that.

Until then one has to pre-process input files to get the format that
SyncEvolution knows how to import. I'm attaching such a script. It
handles .ics files with one or more VCALENDAR inside.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: split-ics.py
Type: text/x-python
Size: 2084 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/syncevolution/attachments/20140214/cf0df3f8/attachment.py>


More information about the SyncEvolution mailing list