Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi please assist me in implementing code for updating the data file of the following code. def volunteers_input (): next_7_days = [] time = []

Hi please assist me in implementing code for updating the data file of the following code.
image text in transcribed
def volunteers_input():

next_7_days = []
time = []
for day in range(7):
next_7_days.append(str(datetime.now()+datetime.
timedelta
(days=day))[:10])
for times in range(8):
time.append(str(datetime.now()+datetime.timedelta(
hours
=times))[11:19])
print(next_7_days)
print(time)

while True:
user_input = input("Acceptable format[yyyy-mm-dd]
Input date: "
)
# user_input = input("Acceptable format[hh:mm] Input time: ")

if user_input in next_7_days:
break
return user_input
# volunteers_input()

def check_time():

while True:
user_input = input("Acceptable format[hh:mm]
Input time: "
)
time = user_input.split(':')
hour = int(time[0])
min = int(time[1])
if hour 16 and hour > 8:
if min >= 0 and min 60:
break
return user_input
# check_time()

def create_event(service):
date = volunteers_input()
time = check_time()
event = {
'summary': 'volunteer',
'location': '84 Albertinah Sisulu St., Johannesburg, 2000',
'description':
'A chance to hear more about Code clinics calendar.'
,
'start': {
'dateTime': f'{date}T{time}:00-07:00',
'timeZone': 'Africa/Johannesburg',
},
'end': {
'dateTime': f'{date}T{time[:2]}:30:00-07:00',
'timeZone': 'Africa/Johannesburg',
},
'recurrence': [
'RRULE:FREQ=DAILY;COUNT=1'
],
'attendees': [
{'email': 'sinkabi022@student.wethinkcode.co.za'}
],
'reminders': {
'useDefault': False,
'overrides': [
{'method': 'email', 'minutes': 24 * 60},
{'method': 'popup', 'minutes': 10},
],
},
}

event = service.events().insert(calendarId=
'c_9hvu4b3796ulvqfh3vk2brri6o@group.calendar.google.com'
, body=event).execute()
event = service.events().insert(calendarId='primary', body=
event
).execute()
print('Event created: %s' % (event.get('htmlLink')))

create_event(authentification())

Volunteer for a slot As a student that wants to volunteer their time in the coding clinic, I want to indicate my availability for a specific slot. - Do not allow double booking for volunteers - The booking should also show on the volunteer's personal Google Calendar - The data file for the volunteer should be updated as well

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Informix Database Administrators Survival Guide

Authors: Joe Lumbley

1st Edition

0131243144, 978-0131243149

More Books

Students also viewed these Databases questions

Question

understand the meaning of the terms discipline and grievance

Answered: 1 week ago