Skip to content

Commit

Permalink
Skipping dot files and folders (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbenning committed Jul 12, 2020
1 parent 6f98e80 commit ee59f9b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions generator/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ def process_album(self, album_dir, album_name, output_albums_photos_path, extern
files = list(filter(lambda e: self.is_supported_photo(e), entries))

for album_file in files:
if album_file.startswith('.'): # skip dotfiles
continue
photo_file = os.path.join(album_dir, album_file)
print(" --> Processing %s... " % photo_file)
try:
Expand All @@ -315,6 +317,8 @@ def process_album(self, album_dir, album_name, output_albums_photos_path, extern
# Recursively process sub-dirs
if self.recursive_albums:
for sub_album_dir in dirs:
if os.path.basename(sub_album_dir).startswith('.'): # skip dotfiles
continue
sub_album_name = "%s" % self.recursive_albums_name_pattern
sub_album_name = sub_album_name.replace("{parent_album}", album_name)
sub_album_name = sub_album_name.replace("{album}", os.path.basename(sub_album_dir))
Expand All @@ -341,6 +345,8 @@ def generate_site(self, output_photos_path, output_data_path, external_root):

for album_dir in dirs:
album_name = os.path.basename(album_dir)
if album_name.startswith('.'): # skip dotfiles
continue
self.process_album(album_dir, album_name, output_albums_photos_path, external_root)

with open(output_albums_data_file, 'w') as outfile:
Expand Down

0 comments on commit ee59f9b

Please sign in to comment.