# modules.py: the modules the lesson names, each imported, with what it is for. A missing one prints MISSING.
# Run: exec(open('/your/folder/modules.py').read())     Tested in FreeCAD 1.1.4 (all present; numpy ships with FreeCAD).
import importlib
WHAT = [
    ('FreeCAD', 'documents, objects, vectors, placements'),
    ('Part', 'solids: boxes, cylinders, extrusions, booleans, STEP files'),
    ('Sketcher', 'sketches and their constraints, from code'),
    ('PartDesign', 'bodies and features such as Pad and Pocket'),
    ('Draft', '2D drafting, arrays, and some shape helpers'),
    ('Mesh', 'triangle meshes: STL in and out'),
    ('MeshPart', 'turn a solid into a mesh with a set fineness'),
    ('Import', 'STEP and IGES in and out, keeping names and colours'),
    ('numpy', 'fast arrays of numbers'),
]
found = 0
for name, job in WHAT:
    try:
        importlib.import_module(name); found += 1; print('%-11s ok       %s' % (name, job))
    except ImportError as e:
        print('%-11s MISSING  %s' % (name, e))
import numpy
print('numpy', numpy.__version__)
# ---- test
assert found == len(WHAT), 'a module is missing'
print('TEST modules.py: PASS')
