Merge pull request #221 from DavidCamre/feature/venv
Fixed parser reading file based calendars as strings rather than calendar objects
This commit is contained in:
		| @@ -78,12 +78,12 @@ class iCalendar: | |||||||
|             for path in filepath: |             for path in filepath: | ||||||
|                 with open(path, mode='r') as ical_file: |                 with open(path, mode='r') as ical_file: | ||||||
|                     ical = (Calendar.from_ical(ical_file.read())) |                     ical = (Calendar.from_ical(ical_file.read())) | ||||||
|                     self.icalendars += ical |                     self.icalendars.append(ical) | ||||||
|  |  | ||||||
|         elif isinstance(filepath, str): |         elif isinstance(filepath, str): | ||||||
|             with open(filepath, mode='r') as ical_file: |             with open(filepath, mode='r') as ical_file: | ||||||
|                 ical = (Calendar.from_ical(ical_file.read())) |                 ical = (Calendar.from_ical(ical_file.read())) | ||||||
|                 self.icalendars += ical |                 self.icalendars.append(ical) | ||||||
|         else: |         else: | ||||||
|             raise Exception(f"Input: '{filepath}' is not a string or list!") |             raise Exception(f"Input: '{filepath}' is not a string or list!") | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user