1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-07-25 01:41:12 +02:00

Better use of Python regex facilities.

This commit is contained in:
Chris Palmer
2020-12-30 09:48:46 +00:00
parent 8f2532d61b
commit 46937e403e
3 changed files with 3 additions and 7 deletions

View File

@@ -227,11 +227,7 @@ def views(target, do_assemblies = None):
#
# Only add the image if the first blurb section doesn't contain one.
#
got_image = False
for line in blurbs[0].split('\n'):
if re.match(r'.*\!\[.*\]\(.*\).*', line):
got_image = True
if not got_image:
if not re.search(r'\!\[.*\]\(.*\)', blurbs[0], re.MULTILINE):
print('![Main Assembly](assemblies/%s.png)\n' % flat_bom[-1]["name"].replace('_assembly', '_assembled'), file = doc_file)
eop(print_mode, doc_file, first = True)
#