Skip to content

Commit 83e1ae9

Browse files
committed
src: Remove images without test
Signed-off-by: Ce Gao <ce.gao@outlook.com>
1 parent f5094a4 commit 83e1ae9

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/generate.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,19 +181,23 @@ def parse_reference_item(self):
181181
if os.path.isfile(os.path.join(self.item_dir, filename)):
182182
continue
183183
sketchFile = '%s/%s/%s.rpde' % (self.item_dir, filename, filename)
184-
testConfigFile = '%s/%s/.test.yml' % (self.item_dir, filename)
185-
if os.path.isfile(testConfigFile) is not True:
186-
continue
187184
with open(sketchFile, 'r') as f:
188185
print("Interpreting " + sketchFile)
189186
code = f.read()
190187
img_path = os.path.join(self.output_img_dir, ('%s.png' % filename))
191-
self.generate_image(code, img_path)
192-
self.examples.append({
193-
'code': code,
194-
'path': sketchFile,
195-
'image': os.path.join(img_dir, ('%s.png' % filename))
196-
})
188+
testConfigFile = '%s/%s/.test.yml' % (self.item_dir, filename)
189+
if os.path.isfile(testConfigFile) is not True:
190+
self.examples.append({
191+
'code': code,
192+
'path': sketchFile
193+
})
194+
else:
195+
self.generate_image(code, img_path)
196+
self.examples.append({
197+
'code': code,
198+
'path': sketchFile,
199+
'image': os.path.join(img_dir, ('%s.png' % filename))
200+
})
197201

198202
def generate_image(self, code, to):
199203
footer = ''

0 commit comments

Comments
 (0)