Skip to content

Commit 8bec2a5

Browse files
author
Toben Archer
committed
Tabbing errors from u/Yenthe666. Fixed those. Consistently Tabs now. There was no error checking on setting body for the events. Now if the event is new, it checks to make sure that "body" is in the event json before it tries to assign to it.
1 parent fb6952b commit 8bec2a5

3 files changed

Lines changed: 26 additions & 20 deletions

File tree

MANIFEST

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
# file GENERATED by distutils, do NOT edit
22
setup.cfg
33
setup.py
4-
O365/__init__.py
5-
O365/attachment.py
6-
O365/cal.py
7-
O365/contact.py
8-
O365/event.py
9-
O365/group.py
10-
O365/inbox.py
11-
O365/message.py
12-
O365/onedrive.py
13-
O365/onefile.py
14-
O365/schedule.py
4+
O365\__init__.py
5+
O365\attachment.py
6+
O365\cal.py
7+
O365\contact.py
8+
O365\event.py
9+
O365\group.py
10+
O365\inbox.py
11+
O365\message.py
12+
O365\schedule.py

O365/event.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Event( object ):
3131
setEnd -- sets the starting time of the event. (struct_time)
3232
setAttendees -- sets the attendee list.
3333
setStartTimeZone -- sets the timezone for the start of the event item.
34-
setEndTimeZone -- sets the timezone for the end of the event item.
34+
setEndTimeZone -- sets the timezone for the end of the event item.
3535
3636
Variables:
3737
time_string -- Formated time string for translation to and from json.
@@ -224,7 +224,15 @@ def setSubject(self,val):
224224

225225
def setBody(self,val):
226226
'''sets event body content.'''
227-
self.json['Body']['Content'] = val
227+
cont = False
228+
229+
while not cont:
230+
try:
231+
self.json['Body']['Content'] = val
232+
self.json['Body']['ContentType'] = 'Text'
233+
cont = True
234+
except:
235+
self.json['Body'] = {}
228236

229237
def setStart(self,val):
230238
'''
@@ -302,13 +310,13 @@ def setAttendees(self,val):
302310
return False
303311
return True
304312

305-
def setStartTimeZone(self,val):
306-
'''sets event start timezone'''
307-
self.json['StartTimeZone'] = val
313+
def setStartTimeZone(self,val):
314+
'''sets event start timezone'''
315+
self.json['StartTimeZone'] = val
308316

309-
def setEndTimeZone(self,val):
310-
'''sets event end timezone'''
311-
self.json['EndTimeZone'] = val
317+
def setEndTimeZone(self,val):
318+
'''sets event end timezone'''
319+
self.json['EndTimeZone'] = val
312320

313321
def addAttendee(self,address,name=None):
314322
'''

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
https://github.com/Narcolapser/python-o365'''
3434

3535
setup(name='O365',
36-
version='0.9',
36+
version='0.9.2',
3737
description='Python library for working with Microsoft Office 365',
3838
long_description=long_desc,
3939
author='Toben Archer',

0 commit comments

Comments
 (0)