def parse_calendar_response(calendar):
 uid = calendar['id']
 name = calendar['summary']
 role = calendar['accessRole']
 read_only = True
 if ((role == 'owner') or (role == 'writer')):
  read_only = False
 description = calendar.get('description', None)
 return Calendar(uid=uid, name=name, read_only=read_only, description=description)

def parse_calendar_response ( calendar ) : uid = calendar [ 'id' ] name = calendar [ 'summary' ] role = calendar [ 'accessRole' ] read_only = True if ( ( role == 'owner' ) or ( role == 'writer' ) ) : read_only = False description = calendar . get ( 'description' , None ) return Calendar ( uid = uid , name = name , read_only = read_only , description = description )
constructs a calendar object from a google calendarlist resource .