1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-08-22 07:03:45 +02:00

Add the ability to have a target specific top level module in place of main_assembly().

This commit is contained in:
Chris Palmer
2021-06-03 11:58:10 +01:00
parent 3027b942a6
commit 823f3b936e
3 changed files with 33 additions and 37 deletions

View File

@@ -161,6 +161,7 @@ def views(target, do_assemblies = None):
# Find all the scad files
#
main_blurb = None
main_assembly, main_file = bom.main_assembly(target)
pngs = []
for dir in source_dirs(bom_dir):
if os.path.isdir(dir):
@@ -232,7 +233,7 @@ def views(target, do_assemblies = None):
update_image(tmp_name, tn_name)
done_assemblies.append(real_name)
else:
if module == 'main_assembly':
if module == main_assembly:
main_blurb = blurb.scrape_module_blurb(lines[:line_no])
line_no += 1
#
@@ -246,9 +247,6 @@ def views(target, do_assemblies = None):
project = ' '.join(word[0].upper() + word[1:] for word in os.path.basename(os.getcwd()).split('_'))
print('<a name="TOP"></a>', file = doc_file)
print('# %s' % project, file = doc_file)
main_file = bom.find_scad_file('main_assembly')
if not main_file:
raise Exception("can't find source for main_assembly")
text = blurb.scrape_blurb(source_dir + '/' + main_file)
blurbs = blurb.split_blurb(text)
if len(text):