Skip to content

Commit

Permalink
Skip non-ICS files when loading from a directory
Browse files Browse the repository at this point in the history
See discussion here:
anufrievroman#4 (comment)
  • Loading branch information
thezeroalpha committed Apr 25, 2023
1 parent 724ebcf commit 4c7ad8e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion calcure/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,12 @@ def read_resource(self, path):
for filename in files:
# Get the full path to the file
file_path = os.path.join(root, filename)
ics_files.append(self.read_file(file_path))

# `path` may contain files with metadata, e.g. `color` and
# `displayname`. For now, exclude those while loading.
if file_path.endswith('.ics'):
ics_files.append(self.read_file(file_path))

return ics_files


Expand Down

0 comments on commit 4c7ad8e

Please sign in to comment.