1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-08-13 19:03:58 +02:00

Various bug fixed from moving printed parts.

This commit is contained in:
Chris Palmer
2019-06-12 11:21:53 +01:00
parent 09db2f06b0
commit c1e31036eb
10 changed files with 57 additions and 18 deletions

View File

@@ -29,7 +29,7 @@ def parse_line(line):
return False, line[start :]
else:
words = line.split()
return len(words) and (words[0] == "module" or words[0] == "function"), ""
return len(words) and (words[0] == "module" or words[0] == "function" or words[0] == 'include'), ""
def _scrape_blurb(lines):
""" Find Markup lines before the first function or module given a list of lines."""

View File

@@ -20,7 +20,7 @@
#
#
#! Makes this document.
#! Makes this document and doc/usage.md.
#
from __future__ import print_function
@@ -63,10 +63,15 @@ They should work with both Python 2 and Python 3.
with open(dir + "/readme.html", "wt") as html_file:
do_cmd(("python -m markdown -x tables " + doc_name).split(), html_file)
with open("docs/usage.html", "wt") as html_file:
do_cmd(("python -m markdown -x tables docs/usage.md").split(), html_file)
#
# Spell check
#
do_cmd(('codespell -L od ' + doc_name).split())
do_cmd(('codespell -L od docs/usage.md').split())
if __name__ == '__main__':
doc_scripts()

View File

@@ -83,7 +83,7 @@ def make_parts(target, part_type, parts = None):
#
# Find all the scad files
#
lib_dir = os.environ['OPENSCADPATH'] + '/NopSCADlib'
lib_dir = os.environ['OPENSCADPATH'] + '/NopSCADlib/printed'
used = []
module_suffix = '_dxf' if part_type == 'svg' else '_' + part_type
for dir in [source_dir, lib_dir]:

View File

@@ -31,7 +31,7 @@ from shutil import copyfile
from tests import update_image
import sys
project_dir = '../..'
project_dirs = ['../..', 'examples']
target_dir = 'gallery'
output_name = target_dir + '/readme.md'
@@ -39,11 +39,12 @@ def gallery(force):
if not os.path.isdir(target_dir):
os.makedirs(target_dir)
projects = [i for i in os.listdir(project_dir) if os.path.isdir(project_dir + '/' + i + '/assemblies')]
paths = sorted([pdir + '/' + i for pdir in project_dirs for i in os.listdir(pdir) if os.path.isdir(pdir + '/' + i + '/assemblies')], key = lambda s: os.path.basename(s))
with open(output_name, 'wt') as output_file:
print("# A gallery of projects made with NopSCADlib", file = output_file)
for project in projects:
path = project_dir + '/' + project
for path in paths:
project = os.path.basename(path)
print(project)
document = path + '/readme.md'
if force:

View File

@@ -8,7 +8,7 @@ They should work with both Python 2 and Python 3.
|:--|:--|
| ```bom.py``` | Generates BOM files for the project. |
| ```c14n_stl.py``` | OpenSCAD produces randomly ordered STL files. This script re-orders them consistently so that GIT can tell if they have changed or not. |
| ```doc_scripts.py``` | Makes this document. |
| ```doc_scripts.py``` | Makes this document and doc/usage.md. |
| ```dxfs.py``` | Generates DXF files for all the routed parts listed on the BOM or a specified list. |
| ```gallery.py``` | Finds projects and adds them to the gallery. |
| ```make_all.py``` | Generates all the files for a project by running ```bom.py```, ```stls.py```, ```dxfs.py```, ```render.py``` and ```views.py```. |

View File

@@ -120,7 +120,7 @@ def views(target, do_assemblies = None):
# Find all the scad files
#
main_blurb = None
lib_dir = os.environ['OPENSCADPATH'] + '/NopSCADlib'
lib_dir = os.environ['OPENSCADPATH'] + '/NopSCADlib/printed'
for dir in [source_dir, lib_dir]:
for filename in os.listdir(dir):
if filename.endswith('.scad'):