-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: 'tuple' object does not support item assignment #67
Comments
Can you include your stack trace? |
hi, i just realised that i was not using a schedule to retrieve a calendar, can you help on what I am missing? schedule = Schedule(authentication) CALENDARev = Event(authentication) I am trying to understand how to get a calendar from a scheduler and pass it to event.create |
Well, the library does a lazy load, so you need to get the calendars like this:
Then you create the event with the calendar of your choosing, assuming you only have one, it should look something like this:
It's a bit of a wonky system I'll admit. It's largely because I'm just exposing the API in Python fairly directly. I'm starting to realize I need to rewrite this to work in a more sensible way. |
hey again and thank you but this line: |
oh, hehe, sorry. It's been a while clearly. This should work:
|
Still same issue, ill show you all my code to understand what I am trying to do. So I am trying to see if your library is suitable for posting and getting events for my web application, what I am having now is this:
It fetches the events and I indeed have them in a dictionary but when i go to "ev." lines I have the following error with the program output being this: Traceback (most recent call last): Process finished with exit code 1 |
your problem is in instantiation of Event. Because the constructor for Event uses key word arguments, authentication and your calendar aren't going to the right places. The method declaration looks like this:
If you don't assign the key word arguments, it just does them in order. Which means you are passing in your authentication tuple as the json, and your calendar as authentication. Try updating your event line to this:
|
It worked, cheers for you fast and effective responses mate! |
No problem. Glad to help! |
The error is here:
self.json['Subject'] = val
I think your codebase has an error which I am getting from here:
e = Event(authenticiation)
e.setSubject('coffee') # <- THIS LINE
e.setStart(time.gmtime(time.time()+3600)) #start an hour from now.
e.setEnd(time.gmtime(time.time()+7200)) #end two hours from now.
new_e = e.create()
Note that e.setStart(..) line and the following returns the same error.
The text was updated successfully, but these errors were encountered: