Add updateevent documentation, fix bug (#1142)

* Add updateevent documentation

* Fix calendar bug

* updateevent doesn't use id|eventid
This commit is contained in:
Ross Scroggs
2020-03-30 18:31:35 -07:00
committed by GitHub
parent 490d0a7815
commit e5e5db335d
2 changed files with 9 additions and 3 deletions

View File

@@ -1005,7 +1005,6 @@ The following attributes are equivalent:
guestscantinviteothers|
guestscantseeothers|
hangoutsmeet|
(id <String>)|
(location <String>)|
(noreminders| (reminder <Number> email|popup|sms))|
(optionalattendee <EmailAddress>)|
@@ -1019,6 +1018,11 @@ The following attributes are equivalent:
(timezone <Timezone>)|
(visibility default|public|prvate)
<EventUpdateAttributes> ::=
<EventAttributes>|
(removeattendee <EmailAddress>)|
(replacedescription <RegularExpression> <String>)
<EventSelectProperty:> ::=
(after <Time>)|
(before <Time>)|
@@ -1030,9 +1034,10 @@ The following attributes are equivalent:
<EventDisplayProperty> ::=
(timezone <TimeZone>)
gam calendar <CalendarItem> addevent <EventAttributes>+ [<EventNotificationAttribute>]
gam calendar <CalendarItem> addevent [id <String>] <EventAttributes>+ [<EventNotificationAttribute>]
gam calendar <CalendarItem> deleteevent id|eventid <EventID> [doit] [<EventNotificationAttribute>]
gam calendar <CalendarItem> moveevent id|eventid <EventID> [doit] [<EventNotificationAttribute>]
gam calendar <CalendarItem> updateevent <EventID> <EventUpdateAttributes>+ [<EventNotificationAttribute>]
gam calendar <CalendarItem> wipe
gam calendar <CalendarItem> printevents <EventSelectProperty>* <EventDisplayProperty>* [todrive]

View File

@@ -370,7 +370,8 @@ def getEventAttributes(i, calendarId, cal, body, action):
elif myarg == 'replacedescription' and action == 'update':
search = sys.argv[i+1]
replace = sys.argv[i+2]
body['description'] = re.sub(search, replace, body['description'])
if 'description' in body:
body['description'] = re.sub(search, replace, body['description'])
i += 3
elif myarg == 'start':
if sys.argv[i+1].lower() == 'allday':