From 6718938c1ad7a178fae81e4264770649e597701d Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Fri, 20 Sep 2024 07:38:44 -0700 Subject: [PATCH] Fixed bug that caused an error when creating a calendar birthday event. --- docs/Calendars-Events.md | 2 +- docs/GamUpdates.md | 4 ++ docs/How-to-Upgrade-from-Legacy-GAM.md | 4 +- docs/Users-Calendars-Events.md | 2 +- docs/Version-and-Help.md | 12 ++--- src/GamUpdate.txt | 4 ++ src/gam.wxs | 74 ++++++++++++++++++++++++++ src/gam/__init__.py | 14 +++-- 8 files changed, 102 insertions(+), 14 deletions(-) create mode 100644 src/gam.wxs diff --git a/docs/Calendars-Events.md b/docs/Calendars-Events.md index 20578bd4..9bc48527 100644 --- a/docs/Calendars-Events.md +++ b/docs/Calendars-Events.md @@ -263,7 +263,7 @@ Client access works when accessing Resource calendars. (privateproperty )| (range )| (recurrence )| - (reminder email|popup))| + (reminder email|popup)| (selectattendees [] [] )| (sequence )| (sharedproperty )| diff --git a/docs/GamUpdates.md b/docs/GamUpdates.md index 321c1a61..2eb1602a 100644 --- a/docs/GamUpdates.md +++ b/docs/GamUpdates.md @@ -10,6 +10,10 @@ Add the `-s` option to the end of the above commands to suppress creating the `g See [Downloads-Installs](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads-Installs) for Windows or other options, including manual installation +### 7.00.05 + +Fixed bug that caused an error when creating a calendar birthday event. + ### 7.00.04 Improved performance of `gam report users orgunit ` when `showorgunit` is not specified. diff --git a/docs/How-to-Upgrade-from-Legacy-GAM.md b/docs/How-to-Upgrade-from-Legacy-GAM.md index 2fb67d41..c607d32c 100644 --- a/docs/How-to-Upgrade-from-Legacy-GAM.md +++ b/docs/How-to-Upgrade-from-Legacy-GAM.md @@ -251,7 +251,7 @@ writes the credentials into the file oauth2.txt. admin@server:/Users/admin$ rm -f /Users/admin/GAMConfig/oauth2.txt admin@server:/Users/admin$ gam version WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found -GAMADV-XTD3 7.00.04 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 7.00.05 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.6 64-bit final MacOS Sonoma 14.5 x86_64 @@ -923,7 +923,7 @@ writes the credentials into the file oauth2.txt. C:\>del C:\GAMConfig\oauth2.txt C:\>gam version WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found -GAMADV-XTD3 7.00.04 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 7.00.05 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.6 64-bit final Windows-10-10.0.17134 AMD64 diff --git a/docs/Users-Calendars-Events.md b/docs/Users-Calendars-Events.md index 4b4f8386..e453d296 100644 --- a/docs/Users-Calendars-Events.md +++ b/docs/Users-Calendars-Events.md @@ -329,7 +329,7 @@ (privateproperty )| (range )| (recurrence )| - (reminder email|popup))| + (reminder email|popup)| (selectattendees [] [] )| (sequence )| (sharedproperty )| diff --git a/docs/Version-and-Help.md b/docs/Version-and-Help.md index 6cdba7a6..e913c474 100644 --- a/docs/Version-and-Help.md +++ b/docs/Version-and-Help.md @@ -3,7 +3,7 @@ Print the current version of Gam with details ``` gam version -GAMADV-XTD3 7.00.04 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 7.00.05 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.5 64-bit final MacOS Sonoma 14.5 x86_64 @@ -15,7 +15,7 @@ Time: 2023-06-02T21:10:00-07:00 Print the current version of Gam with details and time offset information ``` gam version timeoffset -GAMADV-XTD3 7.00.04 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 7.00.05 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.5 64-bit final MacOS Sonoma 14.5 x86_64 @@ -27,7 +27,7 @@ Your system time differs from www.googleapis.com by less than 1 second Print the current version of Gam with extended details and SSL information ``` gam version extended -GAMADV-XTD3 7.00.04 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 7.00.05 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.5 64-bit final MacOS Sonoma 14.5 x86_64 @@ -64,7 +64,7 @@ MacOS High Sierra 10.13.6 x86_64 Path: /Users/Admin/bin/gamadv-xtd3 Version Check: Current: 5.35.08 - Latest: 7.00.04 + Latest: 7.00.05 echo $? 1 ``` @@ -72,7 +72,7 @@ echo $? Print the current version number without details ``` gam version simple -7.00.04 +7.00.05 ``` In Linux/MacOS you can do: ``` @@ -82,7 +82,7 @@ echo $VER Print the current version of Gam and address of this Wiki ``` gam help -GAM 7.00.04 - https://github.com/taers232c/GAMADV-XTD3 +GAM 7.00.05 - https://github.com/taers232c/GAMADV-XTD3 Ross Scroggs Python 3.12.5 64-bit final MacOS Sonoma 14.5 x86_64 diff --git a/src/GamUpdate.txt b/src/GamUpdate.txt index 62b8e007..a3794e59 100644 --- a/src/GamUpdate.txt +++ b/src/GamUpdate.txt @@ -1,3 +1,7 @@ +7.00.05 + +Fixed bug that caused an error when creating a calendar birthday event. + 7.00.04 Improved performance of `gam report users orgunit ` when `showorgunit` is not specified. diff --git a/src/gam.wxs b/src/gam.wxs new file mode 100644 index 00000000..3da4d2e3 --- /dev/null +++ b/src/gam.wxs @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/gam/__init__.py b/src/gam/__init__.py index 78712316..298b17ba 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki """ __author__ = 'GAM Team ' -__version__ = '7.00.04' +__version__ = '7.00.05' __license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)' #pylint: disable=wrong-import-position @@ -37603,6 +37603,9 @@ def _getCalendarEventAttribute(myarg, body, parameters, function): body['start'] = {'dateTime': getTimeOrDeltaFromNow()} body['end'] = {'dateTime': getTimeOrDeltaFromNow()} elif myarg == 'birthday': + body['eventType'] = EVENT_TYPE_BIRTHDAY + body['visibility'] = 'private' + body['transparency'] = 'transparent' bday = getYYYYMMDD(returnDateTime=True) body['start'] = body['end'] = {'date': bday.strftime(YYYYMMDD_FORMAT)} if bday.month != 2 or bday.day != 29: @@ -38019,12 +38022,14 @@ def _createCalendarEvents(user, origCal, function, calIds, count, body, paramete if function == 'insert': event = callGAPI(cal.events(), 'insert', throwReasons=GAPI.CALENDAR_THROW_REASONS+[GAPI.INVALID, GAPI.REQUIRED, GAPI.TIME_RANGE_EMPTY, GAPI.EVENT_DURATION_EXCEEDS_LIMIT, - GAPI.REQUIRED_ACCESS_LEVEL, GAPI.DUPLICATE, GAPI.FORBIDDEN, GAPI.MALFORMED_WORKING_LOCATION_EVENT], + GAPI.REQUIRED_ACCESS_LEVEL, GAPI.DUPLICATE, GAPI.FORBIDDEN, + GAPI.MALFORMED_WORKING_LOCATION_EVENT, GAPI.BAD_REQUEST], calendarId=calId, conferenceDataVersion=1, sendUpdates=parameters['sendUpdates'], supportsAttachments=True, body=body, fields=fields) else: event = callGAPI(cal.events(), 'import_', throwReasons=GAPI.CALENDAR_THROW_REASONS+[GAPI.INVALID, GAPI.REQUIRED, GAPI.TIME_RANGE_EMPTY, GAPI.EVENT_DURATION_EXCEEDS_LIMIT, - GAPI.REQUIRED_ACCESS_LEVEL, GAPI.DUPLICATE, GAPI.FORBIDDEN, GAPI.MALFORMED_WORKING_LOCATION_EVENT, + GAPI.REQUIRED_ACCESS_LEVEL, GAPI.DUPLICATE, GAPI.FORBIDDEN, + GAPI.MALFORMED_WORKING_LOCATION_EVENT, GAPI.BAD_REQUEST, GAPI.PARTICIPANT_IS_NEITHER_ORGANIZER_NOR_ATTENDEE], calendarId=calId, conferenceDataVersion=1, supportsAttachments=True, body=body, fields=fields) if parameters['csvPF'] is None: @@ -38034,7 +38039,8 @@ def _createCalendarEvents(user, origCal, function, calIds, count, body, paramete _getEventDaysOfWeek(event) _printCalendarEvent(user, calId, event, parameters['csvPF'], parameters['FJQC']) except (GAPI.invalid, GAPI.required, GAPI.timeRangeEmpty, GAPI.eventDurationExceedsLimit, - GAPI.requiredAccessLevel, GAPI.participantIsNeitherOrganizerNorAttendee, GAPI.malformedWorkingLocationEvent) as e: + GAPI.requiredAccessLevel, GAPI.participantIsNeitherOrganizerNorAttendee, + GAPI.malformedWorkingLocationEvent, GAPI.badRequest) as e: entityActionFailedWarning([Ent.CALENDAR, calId, Ent.EVENT, event['id']], str(e), i, count) except GAPI.duplicate as e: entityActionFailedWarning([Ent.CALENDAR, calId, Ent.EVENT, event['id']], str(e), i, count)