Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Toben Archer committed Nov 7, 2016
1 parent fb6952b commit 8bec2a5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 20 deletions.
20 changes: 9 additions & 11 deletions MANIFEST
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# file GENERATED by distutils, do NOT edit
setup.cfg
setup.py
O365/__init__.py
O365/attachment.py
O365/cal.py
O365/contact.py
O365/event.py
O365/group.py
O365/inbox.py
O365/message.py
O365/onedrive.py
O365/onefile.py
O365/schedule.py
O365\__init__.py
O365\attachment.py
O365\cal.py
O365\contact.py
O365\event.py
O365\group.py
O365\inbox.py
O365\message.py
O365\schedule.py
24 changes: 16 additions & 8 deletions O365/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Event( object ):
setEnd -- sets the starting time of the event. (struct_time)
setAttendees -- sets the attendee list.
setStartTimeZone -- sets the timezone for the start of the event item.
setEndTimeZone -- sets the timezone for the end of the event item.
setEndTimeZone -- sets the timezone for the end of the event item.
Variables:
time_string -- Formated time string for translation to and from json.
Expand Down Expand Up @@ -224,7 +224,15 @@ def setSubject(self,val):

def setBody(self,val):
'''sets event body content.'''
self.json['Body']['Content'] = val
cont = False

while not cont:
try:
self.json['Body']['Content'] = val
self.json['Body']['ContentType'] = 'Text'
cont = True
except:
self.json['Body'] = {}

def setStart(self,val):
'''
Expand Down Expand Up @@ -302,13 +310,13 @@ def setAttendees(self,val):
return False
return True

def setStartTimeZone(self,val):
'''sets event start timezone'''
self.json['StartTimeZone'] = val
def setStartTimeZone(self,val):
'''sets event start timezone'''
self.json['StartTimeZone'] = val

def setEndTimeZone(self,val):
'''sets event end timezone'''
self.json['EndTimeZone'] = val
def setEndTimeZone(self,val):
'''sets event end timezone'''
self.json['EndTimeZone'] = val

def addAttendee(self,address,name=None):
'''
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
https://github.com/Narcolapser/python-o365'''

setup(name='O365',
version='0.9',
version='0.9.2',
description='Python library for working with Microsoft Office 365',
long_description=long_desc,
author='Toben Archer',
Expand Down

0 comments on commit 8bec2a5

Please sign in to comment.