@@ -158,15 +158,30 @@ def get_files_for_example(example_path):
158158 """Get the set of files for a library example"""
159159 found_files = set (("code.py" ,))
160160 example_dir = os .path .dirname (example_path )
161- for file in os .listdir (example_dir ):
161+
162+ full_tree = os .walk (example_dir )
163+ root_level = next (full_tree )
164+
165+ for file in root_level [2 ]:
162166 if "." in file :
163167 cur_extension = file .split ("." )[- 1 ]
164168 if cur_extension in SHOWN_FILETYPES_EXAMPLE :
165169 # print(file)
166170 found_files .add (file )
167- else :
168- # add dir
169- found_files .add (file )
171+
172+ for _dir in root_level [1 ]:
173+ dir_tuple = (_dir , tuple ())
174+ for cur_tuple in os .walk (example_dir ):
175+ if cur_tuple [0 ].split ("/" )[- 1 ] == _dir :
176+ for _sub_dir in cur_tuple [1 ]:
177+ dir_tuple = (dir_tuple [0 ], dir_tuple [1 ] + (_sub_dir ,))
178+ for _sub_file in cur_tuple [2 ]:
179+ dir_tuple = (dir_tuple [0 ], dir_tuple [1 ] + (_sub_file ,))
180+
181+ # e.g. ("dir_name", ("file_1.txt", "file_2.txt"))
182+
183+ if ".circuitpython.skip-screenshot" not in dir_tuple [1 ]:
184+ found_files .add (dir_tuple )
170185 return found_files
171186
172187
@@ -201,7 +216,7 @@ def get_learn_guide_cp_projects():
201216 # Skip files in this folder, but handle sub-folders
202217 if ".circuitpython.skip-screenshot-here" in filenames :
203218 continue
204- # Do not reurse , but handle files in this folder
219+ # Do not recurse , but handle files in this folder
205220 if ".circuitpython.skip-screenshot-sub" in filenames :
206221 del dirnames [:]
207222
0 commit comments