chiark / gitweb /
gooswapper
5 years agochangelog v0.2
Matthew Vernon [Tue, 11 Dec 2018 15:15:05 +0000 (15:15 +0000)]
changelog

5 years agoNote requirement for an exchangelib with our fixes
Matthew Vernon [Tue, 11 Dec 2018 15:12:03 +0000 (15:12 +0000)]
Note requirement for an exchangelib with our fixes

5 years agoUse start timezone for finding recurrences, and date only for all-days
Matthew Vernon [Tue, 11 Dec 2018 15:07:21 +0000 (15:07 +0000)]
Use start timezone for finding recurrences, and date only for all-days

This enables the correct recurrence to be found; in particular all-day
events should be search for with only the start date, not the start
timestamp.

5 years agoUse event timezone for events (where available)
Matthew Vernon [Tue, 11 Dec 2018 15:06:31 +0000 (15:06 +0000)]
Use event timezone for events (where available)

This required a fix in the upstream exchange library (to properly
understand the MS timezones), but now we can use the event's timezone.

5 years agoEmphasis
Matthew Vernon [Wed, 21 Nov 2018 17:13:55 +0000 (17:13 +0000)]
Emphasis

5 years agoNote that this isn't a supported bit of software
Matthew Vernon [Wed, 21 Nov 2018 17:12:06 +0000 (17:12 +0000)]
Note that this isn't a supported bit of software

5 years agoadd README
Matthew Vernon [Wed, 21 Nov 2018 16:20:08 +0000 (16:20 +0000)]
add README

5 years agoUse a per-exchange-calendar cache file
Matthew Vernon [Tue, 20 Nov 2018 17:54:23 +0000 (17:54 +0000)]
Use a per-exchange-calendar cache file

We now use ~/.gooswapper to store our cache files (rather than CWD),
and also use one cache file per exchange calendar ID.

5 years agoAdd Copyright notice
Matthew Vernon [Tue, 13 Nov 2018 14:50:44 +0000 (14:50 +0000)]
Add Copyright notice

5 years agoAdd LICENSE (AGPLv3)
Matthew Vernon [Tue, 13 Nov 2018 12:58:25 +0000 (12:58 +0000)]
Add LICENSE (AGPLv3)

5 years agocurrent state-of-play notes v0.1
Matthew Vernon [Mon, 12 Nov 2018 16:58:00 +0000 (16:58 +0000)]
current state-of-play notes

5 years agoAdd looping support
Matthew Vernon [Mon, 12 Nov 2018 16:52:06 +0000 (16:52 +0000)]
Add looping support

If you specify -l now, run through the main loop every 10 minutes.

5 years agore-order setup actions
Matthew Vernon [Wed, 24 Oct 2018 15:54:21 +0000 (16:54 +0100)]
re-order setup actions

This is so we can put a loop round those that we want to repeat, after
having done all the necessary login actions.

5 years agoBugfix: handle events with no gcal_id link cli
Matthew Vernon [Wed, 24 Oct 2018 15:47:22 +0000 (16:47 +0100)]
Bugfix: handle events with no gcal_id link

...this is typically where we can't edit the Exchange event (because
we don't own it). We could, as alternatives:

i) try and re-match each time
ii) store the link value in our cache and use that

5 years agoBasic CLI
Matthew Vernon [Wed, 24 Oct 2018 15:43:54 +0000 (16:43 +0100)]
Basic CLI

usage: gooswapper.py [-h] [--auth_host_name AUTH_HOST_NAME]
                     [--noauth_local_webserver]
                     [--auth_host_port [AUTH_HOST_PORT [AUTH_HOST_PORT ...]]]
                     [--logging_level {DEBUG,INFO,WARNING,ERROR,CRITICAL}]
                     [-g GCALID] [-l]
                     exchuser exchemail

Gooswapper calendar sync

positional arguments:
  exchuser              Exchange user e.g. 'SANGER\mv3'
  exchemail             Exchange calendar email e.g. ISGGroup@sanger.ac.uk

optional arguments:
  -h, --help            show this help message and exit
  --auth_host_name AUTH_HOST_NAME
                        Hostname when running a local web server.
  --noauth_local_webserver
                        Do not run a local web server.
  --auth_host_port [AUTH_HOST_PORT [AUTH_HOST_PORT ...]]
                        Port web server should listen on.
  --logging_level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Set the logging level of detail.
  -g GCALID, --gcalid GCALID
                        google Calendar ID
  -l, --loop            keep running indefinitely

(-l not yet implemented)

5 years agoWhen matching, add google events where we have unmatched exchange ones
Matthew Vernon [Wed, 24 Oct 2018 10:24:19 +0000 (11:24 +0100)]
When matching, add google events where we have unmatched exchange ones

i.e. if you have an event in Exchange where a matching google event
isn't found by matching, then create that event in google.

5 years agohandle empty subjects when matching
Matthew Vernon [Tue, 23 Oct 2018 15:40:44 +0000 (16:40 +0100)]
handle empty subjects when matching

5 years agoadd option to ignore existing gcal_id links
Matthew Vernon [Tue, 23 Oct 2018 15:40:26 +0000 (16:40 +0100)]
add option to ignore existing gcal_id links

5 years agocheck event isn't already cancelled before deleting
Matthew Vernon [Tue, 23 Oct 2018 15:39:39 +0000 (16:39 +0100)]
check event isn't already cancelled before deleting

5 years agoHandle the remaining recurrence types
Matthew Vernon [Tue, 23 Oct 2018 15:12:47 +0000 (16:12 +0100)]
Handle the remaining recurrence types

These are in simple forms, as can be generated via the Outlook web
UI...

5 years agoHandle updates to recurring events
Matthew Vernon [Tue, 23 Oct 2018 13:38:11 +0000 (14:38 +0100)]
Handle updates to recurring events

5 years agoUpdate changekey of master event after adjusting instances
Matthew Vernon [Fri, 19 Oct 2018 16:53:17 +0000 (17:53 +0100)]
Update changekey of master event after adjusting instances

Changing the instances (e.g. by adding a gcal_link) updates the
changekey of the master instance. So we need to reflect this in our
cache.

5 years agoRemove warning about not supporting modified/deleted recurrences
Matthew Vernon [Fri, 19 Oct 2018 16:41:48 +0000 (17:41 +0100)]
Remove warning about not supporting modified/deleted recurrences

5 years agoDon't store instances of recurring events in the cache
Matthew Vernon [Fri, 19 Oct 2018 16:39:10 +0000 (17:39 +0100)]
Don't store instances of recurring events in the cache

...as they don't appear in the usual listing, which means we end up
considering them as deleted events.

5 years agoHandle modified / deleted recurrences
Matthew Vernon [Fri, 19 Oct 2018 16:37:33 +0000 (17:37 +0100)]
Handle modified / deleted recurrences

This has a bug in that adding the modified events to the events cache
causes them to get deleted on the next run (since they don't appear in
the events listing normally).

5 years agohandle weekly recurrence pattern
Matthew Vernon [Fri, 19 Oct 2018 11:42:17 +0000 (12:42 +0100)]
handle weekly recurrence pattern

5 years agoonly register gcal_link if necessary
Matthew Vernon [Fri, 19 Oct 2018 11:41:54 +0000 (12:41 +0100)]
only register gcal_link if necessary

5 years agomore verbose logging of recurrence
Matthew Vernon [Fri, 19 Oct 2018 10:21:52 +0000 (11:21 +0100)]
more verbose logging of recurrence

5 years agoadd utility function to pop an event from the cache
Matthew Vernon [Fri, 19 Oct 2018 10:21:36 +0000 (11:21 +0100)]
add utility function to pop an event from the cache

5 years agoStart on recurring event support
Matthew Vernon [Wed, 17 Oct 2018 16:04:30 +0000 (17:04 +0100)]
Start on recurring event support

...currently only daily events, but this is tested and works across a
DST change.

5 years agoMake start and end times be rendered in target timezone
Matthew Vernon [Wed, 17 Oct 2018 16:03:24 +0000 (17:03 +0100)]
Make start and end times be rendered in target timezone

This is consistent with how we were handling all-day events
previously, and means that recurring events work round DST changes
better.

5 years agorestrict fields passed to event.save()
Matthew Vernon [Wed, 10 Oct 2018 15:45:08 +0000 (16:45 +0100)]
restrict fields passed to event.save()

This avoids problems where the event has some fields we can't edit.

5 years agocheck for empty body
Matthew Vernon [Wed, 10 Oct 2018 15:44:36 +0000 (16:44 +0100)]
check for empty body

5 years agoRemove some no-longer needed lines
Matthew Vernon [Mon, 8 Oct 2018 10:35:26 +0000 (11:35 +0100)]
Remove some no-longer needed lines

These were part of getting to the bottom of why saving wasn't working,
which we have now fixed (see previous commit).

5 years agoAdd code to propagate changes, and match events
Matthew Vernon [Sat, 6 Oct 2018 21:54:10 +0000 (22:54 +0100)]
Add code to propagate changes, and match events

Updating is a fairly simple process of copying across the fields we
think we care about.

Matching looks for non-recurring events with the same title in the
same time range.

5 years agopass gcal_tz where needed
Matthew Vernon [Fri, 5 Oct 2018 14:13:09 +0000 (15:13 +0100)]
pass gcal_tz where needed

5 years agoSplit out building gcal event structure (no functional change)
Matthew Vernon [Fri, 5 Oct 2018 14:06:14 +0000 (15:06 +0100)]
Split out building gcal event structure (no functional change)

...this will enable us to use it for updates as well as creation

5 years agocorrect warning text
Matthew Vernon [Fri, 5 Oct 2018 14:00:11 +0000 (15:00 +0100)]
correct warning text

5 years agoCache the auto-discovery values from Exchange
Matthew Vernon [Fri, 5 Oct 2018 13:51:51 +0000 (14:51 +0100)]
Cache the auto-discovery values from Exchange

This saves us a bit of time.

5 years agoAlso support single non-all-day events
Matthew Vernon [Fri, 5 Oct 2018 11:17:05 +0000 (12:17 +0100)]
Also support single non-all-day events

5 years agostore gcal_link in cache immediately (rather than waiting for next cache update
Matthew Vernon [Fri, 5 Oct 2018 11:16:38 +0000 (12:16 +0100)]
store gcal_link in cache immediately (rather than waiting for next cache update

5 years agofix syntax of extendedProperties setting
Matthew Vernon [Fri, 5 Oct 2018 11:15:32 +0000 (12:15 +0100)]
fix syntax of extendedProperties setting

5 years agoRemove old commented-out deletion code
Matthew Vernon [Fri, 5 Oct 2018 10:23:25 +0000 (11:23 +0100)]
Remove old commented-out deletion code

During testing, it made life easier to automatically delete new events
sometimes. We don't want to do that any more :)

5 years agodelete linked events
Matthew Vernon [Fri, 5 Oct 2018 10:22:37 +0000 (11:22 +0100)]
delete linked events

5 years agoSwitch to using a named tuple for the cache
Matthew Vernon [Fri, 5 Oct 2018 10:06:36 +0000 (11:06 +0100)]
Switch to using a named tuple for the cache

This lets us store more than one field per event, fairly simply.

5 years agoRemove old part-written broken function
Matthew Vernon [Fri, 5 Oct 2018 09:06:47 +0000 (10:06 +0100)]
Remove old part-written broken function

This was a previous iteration that never actually worked (it led to
the GlobalObjectId work, which in turn led to just using item_id)

5 years agoRemove GlobalObjectId code
Matthew Vernon [Fri, 5 Oct 2018 09:05:51 +0000 (10:05 +0100)]
Remove GlobalObjectId code

Firstly, we can use item_id instead; secondly, it doesn't always
actually work :-/

5 years agoMove to keying by item_id
Matthew Vernon [Fri, 5 Oct 2018 09:04:15 +0000 (10:04 +0100)]
Move to keying by item_id

item_id is constant (changekey changes if an event is updated) and
searchable, so use it as primary key.

5 years agoRemove commented-out account line
Matthew Vernon [Fri, 5 Oct 2018 08:33:42 +0000 (09:33 +0100)]
Remove commented-out account line

(previous work thought that ServiceAccount might be misbehaving)

5 years agotidy up the exchange extended property
Matthew Vernon [Fri, 5 Oct 2018 08:33:03 +0000 (09:33 +0100)]
tidy up the exchange extended property

The two commented-out versions were wrong ("gooswapper") and unhelpful
(the number, stolen from the exchangelib docs); better is to use a
public string entry.

5 years agoInitial commit
Matthew Vernon [Fri, 5 Oct 2018 08:31:07 +0000 (09:31 +0100)]
Initial commit

This now can cope with new all-day events from exchange, and make the
corresponding event in gcal.

5 years agogit ignore file
Matthew Vernon [Fri, 5 Oct 2018 08:27:38 +0000 (09:27 +0100)]
git ignore file