diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..7943d5e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,5 @@ +[submodule "templates/PcbDraw-Lib"] + path = templates/PcbDraw-Lib + url = git@github.com:MLAB-project/PcbDraw-Lib.git + branch = master + shallow = true diff --git a/graphics/images/SignalConnectors.dia b/graphics/images/SignalConnectors.dia new file mode 100644 index 0000000..65b6899 Binary files /dev/null and b/graphics/images/SignalConnectors.dia differ diff --git a/graphics/images/SignalConnectors.png b/graphics/images/SignalConnectors.png new file mode 100644 index 0000000..e4b2cd7 Binary files /dev/null and b/graphics/images/SignalConnectors.png differ diff --git a/kibot/cad.kibot.yaml b/kibot/cad.kibot.yaml index 18e0e72..f6c8c01 100644 --- a/kibot/cad.kibot.yaml +++ b/kibot/cad.kibot.yaml @@ -1,12 +1,15 @@ kibot: version: 1 -# preflight: -# run_erc: false -# run_drc: false -# check_zone_fills: false -# ignore_unconnected: false -# update_xml: false +preflight: + run_erc: false + run_drc: false + check_zone_fills: true + ignore_unconnected: false + update_xml: + enabled: true + check_pcb_parity: true + as_warnings: true # pcb_replace: # date_command: date -d @`git log -1 --format='%at' -- $KIBOT_PCB_NAME` +%Y-%m-%d_%H-%M-%S diff --git a/kibot/erc.kibot.yaml b/kibot/erc.kibot.yaml index 68fcccd..8872668 100644 --- a/kibot/erc.kibot.yaml +++ b/kibot/erc.kibot.yaml @@ -6,4 +6,7 @@ preflight: run_drc: false check_zone_fills: true ignore_unconnected: true - update_xml: false \ No newline at end of file + update_xml: + enabled: true + check_pcb_parity: true + as_warnings: false \ No newline at end of file diff --git a/kibot/gerbers.kibot.yaml b/kibot/gerbers.kibot.yaml index d7afc3c..1bfc117 100644 --- a/kibot/gerbers.kibot.yaml +++ b/kibot/gerbers.kibot.yaml @@ -1,6 +1,17 @@ kibot: version: 1 + +preflight: + run_erc: false + run_drc: false + check_zone_fills: true + ignore_unconnected: false + update_xml: + enabled: true + check_pcb_parity: true + as_warnings: true + outputs: - name: "https://en.wikipedia.org/wiki/Gerber_format" comment: "Gerbers" @@ -145,4 +156,5 @@ outputs: # (%i='drill_report' %x='txt') # filename: '%i.%x' # [boolean=false] use the auxiliar axis as origin for coordinates + zeros_format: "SUPPRESS_LEADING" use_aux_axis_as_origin: true diff --git a/kibot/ibom.kibot.yaml b/kibot/ibom.kibot.yaml new file mode 100644 index 0000000..09ac703 --- /dev/null +++ b/kibot/ibom.kibot.yaml @@ -0,0 +1,23 @@ +kibot: + version: 1 + +preflight: + run_erc: false + run_drc: false + check_zone_fills: true + ignore_unconnected: false + update_xml: + enabled: true + check_pcb_parity: true + as_warnings: true + +global: + kiauto_time_out_scale: 15 + +outputs: + - name: 'ibom' + type: ibom + dir: docs + options: + extra_fields: "UST_ID" + include_nets: true diff --git a/kibot/placement.kibot.yaml b/kibot/placement.kibot.yaml index 2e6dc79..590912b 100644 --- a/kibot/placement.kibot.yaml +++ b/kibot/placement.kibot.yaml @@ -1,6 +1,17 @@ kibot: version: 1 + +preflight: + run_erc: false + run_drc: false + check_zone_fills: true + ignore_unconnected: false + update_xml: + enabled: true + check_pcb_parity: true + as_warnings: true + global: kiauto_time_out_scale: 15 @@ -23,3 +34,21 @@ outputs: layers: - F.Fab - Edge.Cuts + + - name: 'SVG print' + type: pcb_print + dir: docs + options: + mirror: true + scaling: 0 + plot_sheet_reference: false + format: 'SVG' + pages: + - layers: + - B.Fab + - Edge.Cuts + mirror: false + - layers: + - F.Fab + - Edge.Cuts + mirror: true diff --git a/kibot/pnp.kibot.yaml b/kibot/pnp.kibot.yaml index 459e56c..6b3d083 100644 --- a/kibot/pnp.kibot.yaml +++ b/kibot/pnp.kibot.yaml @@ -6,7 +6,10 @@ preflight: run_drc: false check_zone_fills: true ignore_unconnected: false - update_xml: false + update_xml: + enabled: true + check_pcb_parity: true + as_warnings: true outputs: diff --git a/kibot/render.kibot.yaml b/kibot/render.kibot.yaml index 62b801c..d966b0a 100644 --- a/kibot/render.kibot.yaml +++ b/kibot/render.kibot.yaml @@ -1,72 +1,80 @@ kibot: version: 1 + preflight: run_erc: false run_drc: false - check_zone_fills: false + check_zone_fills: true ignore_unconnected: false - update_xml: false + update_xml: + enabled: true + check_pcb_parity: true + as_warnings: true + outputs: - - name: 'white png top' + - name: 'Yellow png top' type: 'pcbdraw' dir: 'img' options: - # [boolean=false] render the bottom side of the board (default is top side) bottom: false - # [string|list(string)=''] Name of the filter to mark components as not fitted. - # A short-cut to use for simple cases where a variant is an overkill dnf_filter: '' - # [number=300] [10,1200] dots per inch (resolution) of the generated image dpi: 600 - # [string='svg'] [svg,png,jpg] output format. Only used if no `output` is specified format: 'png' - # [list(string)=[]] list of components to highlight highlight: [] - # [list(string)=[]] list of libraries - libs: [] - # [boolean=false] mirror the board + libs: ['/github/workspace/doc/assets/templates/PcbDraw-Lib/KiCAD-base', '/github/workspace/doc/assets/templates/PcbDraw-Lib/MLAB-base'] mirror: false - # [boolean=false] do not make holes transparent no_drillholes: false - # [string='%f-%i%v.%x'] name for the generated file. Affected by global options output: '%f-%i.%x' - # [boolean=false] show placeholder for missing components placeholder: false - # [dict|None] replacements for PCB references using components (lib:component) remap: - # [list(string)|string=none] [none,all] list of components to draw, can be also a string for none or all. - # The default is none show_components: all - # [string|dict] PCB style (colors). An internal name, the name of a JSON file or the style options - #style: '/usr/share/pcbdraw/styles/set-black-cu.json' style: 'doc/assets/kibot/styles/mlab.json' - # [string=''] Board variant to apply variant: '' - # [boolean=false] render V-CUTS on the Cmts.User layer vcuts: false - # [string='visible'] [visible,all,none] using visible only the warnings about components in the visible side are generated warnings: 'none' margin: 5 - - name: 'white png bottom' + - name: 'Yellow png bottom' type: 'pcbdraw' dir: 'img' options: - # [boolean=false] render the bottom side of the board (default is top side) bottom: true + dnf_filter: '' + dpi: 600 + format: 'png' + highlight: [] + libs: ['/github/workspace/doc/assets/templates/PcbDraw-Lib/KiCAD-base', '/github/workspace/doc/assets/templates/PcbDraw-Lib/MLAB-base'] + mirror: false + no_drillholes: false + output: '%f-%i.%x' + placeholder: false + remap: + show_components: all + style: 'doc/assets/kibot/styles/mlab.json' + variant: '' + vcuts: false + warnings: 'none' + margin: 5 + + - name: 'Yellow svg top' + type: 'pcbdraw' + dir: 'img' + options: + # [boolean=false] render the bottom side of the board (default is top side) + bottom: false # [string|list(string)=''] Name of the filter to mark components as not fitted. # A short-cut to use for simple cases where a variant is an overkill dnf_filter: '' # [number=300] [10,1200] dots per inch (resolution) of the generated image dpi: 600 - # [string='png'] [svg,png,jpg] output format. Only used if no `output` is specified - format: 'png' + # [string='svg'] [svg,png,jpg] output format. Only used if no `output` is specified + format: 'svg' # [list(string)=[]] list of components to highlight highlight: [] # [list(string)=[]] list of libraries - libs: [] + libs: ['/github/workspace/doc/assets/templates/PcbDraw-Lib/KiCAD-base', '/github/workspace/doc/assets/templates/PcbDraw-Lib/MLAB-base'] # [boolean=false] mirror the board mirror: false # [boolean=false] do not make holes transparent @@ -92,13 +100,12 @@ outputs: margin: 5 -outputs: - - name: 'white png top' + - name: 'Yellow svg bottom' type: 'pcbdraw' dir: 'img' options: # [boolean=false] render the bottom side of the board (default is top side) - bottom: false + bottom: true # [string|list(string)=''] Name of the filter to mark components as not fitted. # A short-cut to use for simple cases where a variant is an overkill dnf_filter: '' @@ -109,7 +116,7 @@ outputs: # [list(string)=[]] list of components to highlight highlight: [] # [list(string)=[]] list of libraries - libs: [] + libs: ['/github/workspace/doc/assets/templates/PcbDraw-Lib/KiCAD-base', '/github/workspace/doc/assets/templates/PcbDraw-Lib/MLAB-base'] # [boolean=false] mirror the board mirror: false # [boolean=false] do not make holes transparent diff --git a/kibot/report.kibot.yaml b/kibot/report.kibot.yaml index 41b0786..7b2ce81 100644 --- a/kibot/report.kibot.yaml +++ b/kibot/report.kibot.yaml @@ -1,8 +1,17 @@ kibot: version: 1 + preflight: - update_xml: true + run_erc: false + run_drc: false + check_zone_fills: true + ignore_unconnected: false + update_xml: + enabled: true + check_pcb_parity: true + as_warnings: true + global: kiauto_time_out_scale: 10 @@ -13,9 +22,3 @@ outputs: options: output: 'README.md' template: 'full_svg' - - - name: 'bom' - comment: "Bill of Materials in CSV format" - type: bom - options: - group_fields: ['Part', 'Part Lib', 'Value', 'Footprint', 'Footprint Lib'] diff --git a/kibot/schematics.kibot.yaml b/kibot/schematics.kibot.yaml index 4421b79..354a02b 100644 --- a/kibot/schematics.kibot.yaml +++ b/kibot/schematics.kibot.yaml @@ -1,6 +1,18 @@ kibot: version: 1 + +preflight: + run_erc: false + run_drc: false + check_zone_fills: true + ignore_unconnected: false + update_xml: + enabled: true + check_pcb_parity: true + as_warnings: true + + global: kiauto_time_out_scale: 10 diff --git a/kibot/xml.kibot.yaml b/kibot/xml.kibot.yaml index 0d1b3c7..10f8f60 100644 --- a/kibot/xml.kibot.yaml +++ b/kibot/xml.kibot.yaml @@ -1,9 +1,25 @@ kibot: version: 1 + preflight: run_erc: false run_drc: false - check_zone_fills: false - ignore_unconnected: true - update_xml: true + check_zone_fills: true + ignore_unconnected: false + update_xml: + enabled: true + check_pcb_parity: true + as_warnings: true + + +global: + kiauto_time_out_scale: 10 + +outputs: + - name: 'bom' + comment: "Bill of Materials in CSV format" + type: bom + dir: hw/sch_pcb/ + options: + group_fields: ['Part', 'Part Lib', 'Value', 'Footprint', 'Footprint Lib'] diff --git a/templates/PcbDraw-Lib b/templates/PcbDraw-Lib new file mode 160000 index 0000000..187fe15 --- /dev/null +++ b/templates/PcbDraw-Lib @@ -0,0 +1 @@ +Subproject commit 187fe155582bcabb99a82345e9368f2a4b410ad3 diff --git a/workflows/copy_workflow_to_repo.sh b/workflows/copy_workflow_to_repo.sh index fde6439..18bfe93 100755 --- a/workflows/copy_workflow_to_repo.sh +++ b/workflows/copy_workflow_to_repo.sh @@ -5,6 +5,14 @@ # mkdir -p ../../../.github/workflows -cp kicad_outputs.yml ../../../.github/workflows/kicad_outputs.yml + +if [ "$(find ../../../hw -name '*kicad_pro' 2>/dev/null)" ] +then + echo "This is KICAD project" + cp kicad_outputs.yml ../../../.github/workflows/kicad_outputs.yml +else + rm ../../../.github/workflows/kicad_outputs.yml 2>/dev/null || true + echo "Kicad not found" +fi cp update_actions.yml ../../../.github/workflows/update_actions.yml cp metadata_updater.yml ../../../.github/workflows/metadata_updater.yml diff --git a/workflows/kicad_outputs.yml b/workflows/kicad_outputs.yml index ebfbcc8..3ff8a64 100644 --- a/workflows/kicad_outputs.yml +++ b/workflows/kicad_outputs.yml @@ -33,7 +33,7 @@ jobs: token: ${{ secrets.pat }} ref: ${{ github.head_ref }} - - uses: INTI-CMNB/KiBot@v2_dk6 + - uses: INTI-CMNB/KiBot@v2_dk7 with: config: ${{ env.kibot }}/erc.kibot.yaml schema: ${{ env.schema }} @@ -51,7 +51,7 @@ jobs: token: ${{ secrets.pat }} ref: ${{ github.head_ref }} - - uses: INTI-CMNB/KiBot@v2_dk6 + - uses: INTI-CMNB/KiBot@v2_dk7 with: config: ${{ env.kibot }}/drc.kibot.yaml schema: ${{ env.schema }} @@ -69,7 +69,7 @@ jobs: token: ${{ secrets.pat }} ref: ${{ github.head_ref }} - - uses: INTI-CMNB/KiBot@v2_dk6 + - uses: INTI-CMNB/KiBot@v2_dk7 with: config: ${{ env.kibot }}/schematics.kibot.yaml schema: ${{ env.schema }} @@ -93,20 +93,19 @@ jobs: token: ${{ secrets.pat }} ref: ${{ github.head_ref }} - - uses: INTI-CMNB/KiBot@v2_dk6 + - uses: INTI-CMNB/KiBot@v2_dk7 with: config: ${{ env.kibot }}/placement.kibot.yaml schema: ${{ env.schema }} board: ${{ env.board }} dir: ${{ env.dir }}_docs - - uses: INTI-CMNB/KiBot@v2_dk6 + - uses: INTI-CMNB/KiBot@v2_dk7 with: config: ${{ env.kibot }}/xml.kibot.yaml schema: ${{ env.schema }} board: ${{ env.board }} - dir: ${{ env.dir }} - + dir: ${{ env.dir }}_docs - name: "Rename output" run: | @@ -117,14 +116,19 @@ jobs: if: ${{ success() }} with: name: doc_xml - path: hw/sch_pcb/*.xml + path: | + hw/sch_pcb/*.xml + hw/sch_pcb/*.csv # Zde se zahazuji debugovaci videa - uses: actions/upload-artifact@v3 if: ${{ success() }} with: name: doc_placement - path: ${{ env.dir }}_docs/**/*.pdf + path: | + ${{ env.dir }}_docs/**/*.pdf + ${{ env.dir }}_docs/**/*.svg + ${{ env.dir }}_docs/**/*.csv report: runs-on: ubuntu-latest @@ -136,7 +140,7 @@ jobs: token: ${{ secrets.pat }} ref: ${{ github.head_ref }} - - uses: INTI-CMNB/KiBot@v2_dk6 + - uses: INTI-CMNB/KiBot@v2_dk7 with: config: ${{ env.kibot }}/report.kibot.yaml schema: ${{ env.schema }} @@ -149,6 +153,34 @@ jobs: name: doc_report path: ${{ env.dir }}_report/ + + ibom: + runs-on: ubuntu-latest + continue-on-error: true + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + token: ${{ secrets.pat }} + ref: ${{ github.head_ref }} + + - uses: INTI-CMNB/KiBot@v2_dk7 + with: + config: ${{ env.kibot }}/ibom.kibot.yaml + schema: ${{ env.schema }} + board: ${{ env.board }} + dir: ${{ env.dir }}_ibom + + - name: "Rename output" + run: for file in $(find ${{env.dir}} -type f); do sudo mv "${file}" "${file//${{env.project}}/${{env.branch}}}" ; done + + - uses: actions/upload-artifact@v3 + if: ${{ success() }} + with: + name: doc_ibom + path: ${{ env.dir }}_ibom/ + + # fabrications gerbers: name: "Fabrication: Gerebrs, Drill and PnP" @@ -161,7 +193,7 @@ jobs: token: ${{ secrets.pat }} ref: ${{ github.head_ref }} - - uses: INTI-CMNB/KiBot@v2_dk6 + - uses: INTI-CMNB/KiBot@v2_dk7 with: config: ${{ env.kibot }}/gerbers.kibot.yaml schema: ${{ env.schema }} @@ -170,7 +202,7 @@ jobs: verbose: 3 - name: "Rename output" - run: for file in $(find ${{env.dir}}_gerbers -type f); do sudo mv "${file}" "${file//${{env.project}}/${{env.branch}}}" ; done + run: for file in $(find ${{env.dir}}_gerbers -type f); do sudo mv "${file}" "${file//${{env.project}}/${{env.branch}}}" || true ; done - uses: actions/upload-artifact@v2 if: ${{ success() }} @@ -190,14 +222,14 @@ jobs: token: ${{ secrets.pat }} ref: ${{ github.head_ref }} - - uses: INTI-CMNB/KiBot@v2_dk6 + - uses: INTI-CMNB/KiBot@v2_dk7 with: config: ${{ env.kibot }}/cad.kibot.yaml schema: ${{ env.schema }} board: ${{ env.board }} dir: ${{ env.dir }}_cad - - uses: INTI-CMNB/KiBot@v2_dk6 + - uses: INTI-CMNB/KiBot@v2_dk7 with: config: ${{ env.kibot }}/render.kibot.yaml schema: ${{ env.schema }} @@ -221,7 +253,7 @@ jobs: UPDATE_REPO: runs-on: ubuntu-latest name: Update repository - needs: [graphics, gerbers, schematics, placement, report] + needs: [graphics, gerbers, schematics, placement, report, ibom] steps: - uses: actions/checkout@v3 with: @@ -250,17 +282,22 @@ jobs: mkdir doc/img/render || true mkdir hw || true mkdir hw/cam_profi || true - - cp doc/assets/kibot/autogenerated.md hw/cam_profi.readme.md || true - + mkdir hw/cam_profi/gbr || true + mkdir hw/cam_profi/PnP || true + mkdir hw/cam_profi/ibom || true + cp -r doc_img/* doc/gen/img || true cp -r doc_cad/cad/* doc/gen || true - cp -r hw_cam_profi/* hw/cam_profi || true + mv -r hw_cam_profi/PnP hw/cam_profi/PnP || true + cp -r hw_cam_profi/* hw/cam_profi/gbr || true cp -r doc_sch/docs/* doc/gen || true - cp -r doc_xml/* doc/gen || true + cp -r doc_xml/* hw/cam_profi || true cp -r doc_sch/img/pcb/* doc/gen/img || true cp -r doc_placement/doc* hw/cam_profi || true cp -r doc_report/* doc/gen || true + cp -r doc_ibom/docs/* hw/cam_profi/ibom || true + + mv hw/cam_profi/grb/PnP hw/cam_profi/PnP || true rm -r doc_img || true rm -r doc_cad || true @@ -269,8 +306,7 @@ jobs: rm -r doc_placement || true rm -r doc_xml || true rm -r doc_report || true - - tree + rm -r doc_ibom || true git add . -f diff --git a/workflows/metadata_updater.yml b/workflows/metadata_updater.yml index fa42608..128eae7 100644 --- a/workflows/metadata_updater.yml +++ b/workflows/metadata_updater.yml @@ -15,18 +15,18 @@ jobs: - uses: actions/checkout@v3 with: submodules: 'recursive' - + - name: Set up Python 3.10 uses: actions/setup-python@v3 with: python-version: "3.10" - + - name: Install dependencies run: | python -m pip install --upgrade pip pip install flake8 pytest if [ -f doc/assets/workflows/requirements.txt ]; then pip install -r doc/assets/workflows/requirements.txt; fi - + - name: Update metadata env: gh_repo: ${{ github.event.repository.name }} @@ -37,7 +37,8 @@ jobs: gh_token: ${{ secrets.GITHUB_TOKEN }} run: | python3 doc/assets/workflows/update_metadata.py - + python3 doc/assets/workflows/update_kitspace.py + - uses: stefanzweifel/git-auto-commit-action@v4.16.0 with: commit_message: Update metadata files diff --git a/workflows/readme.md b/workflows/readme.md index 1675bb7..8fc762f 100644 --- a/workflows/readme.md +++ b/workflows/readme.md @@ -3,3 +3,19 @@ - `kicad_outputs.yml` - KiCAD manufacturing and documentation outputs automation. In case of creation of a new module from [module template](https://github.com/mlab-modules/MODUL01/tree/MODUL01A/.github/workflows) use `copy_workflow_to_repo.sh` script to copy the workflow file to the new MLAB module repository. + + +## Aktualizace submodulu v jednom prikazu pro starsi moduly +``` +git pull; git submodule update --init --remote; cd doc/assets/workflows; ./copy_workflow_to_repo.sh; cd ../../..; git add .gitmodules doc/assets/ .github; git commit -m"update actions"; git push +``` + + +.gitmodules +``` +[submodule "doc/assets"] + path = doc/assets + url = git@github.com:MLAB-project/documents.git + branch = old_mlab_naming + shallow = true +``` diff --git a/workflows/update_actions.yml b/workflows/update_actions.yml index 270306f..e97addb 100644 --- a/workflows/update_actions.yml +++ b/workflows/update_actions.yml @@ -1,8 +1,12 @@ name: Update actions and assets repository on: schedule: - - cron: "0 */2 * * *" + - cron: "0 */24 * * *" + push: + paths: + - '.gitmodules' + workflow_dispatch: jobs: @@ -16,6 +20,11 @@ jobs: token: ${{ secrets.pat }} ref: ${{ github.head_ref }} + - name: Update submodules + run: | + git -C doc/assets config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*' + git submodule sync doc/assets + git submodule update --init --remote doc/assets - name: Update submodules run: | diff --git a/workflows/update_kitspace.py b/workflows/update_kitspace.py new file mode 100644 index 0000000..dbcee4a --- /dev/null +++ b/workflows/update_kitspace.py @@ -0,0 +1,50 @@ + +# This tool should update kitspace.yaml metadata file. +# It should be run from the repository root. + +from github import Github +import yaml +from yaml import load, dump +from yaml import CLoader as Loader, CDumper as Dumper +import os +from glob import glob + +g = Github(os.environ['gh_token']) +repo = g.get_repo(os.environ['gh_repository']) +print(repo) + +config_file = 'kitspace.yaml' +new = 0 + +try: + stream = open(config_file, 'r') + data = yaml.full_load(stream) + stream.close() +except: + print("File does not exists") + data = None + +stream = open(config_file, 'w+') +print(data, type(data)) + +if data: + new = 0 +else: + data = {} + new = 1 + +if new: + pass + +data['summary'] = repo.description +data['site'] = os.environ.get('gh_url', "https://www.github.com/MLAB-project") +data['color'] = 'white' +data['bom'] = 'hw/sch_pcb/'+os.environ.get('gh_repo', "repository_name")+'.kicad_pcb' +data['gerbers'] = 'hw/cam_profi/' +data['eda'] = {} +data['eda']['type'] = 'kicad' +data['eda']['pcb'] = 'hw/sch_pcb/'+os.environ.get('gh_repo', "repository_name")+'.kicad_pcb' + +print(data) +yaml.dump(data, stream) +stream.close() diff --git a/workflows/update_metadata.py b/workflows/update_metadata.py index 6d8c3f0..40bd98d 100644 --- a/workflows/update_metadata.py +++ b/workflows/update_metadata.py @@ -31,7 +31,7 @@ new = 0 else: data = {} - data['homepage'] = True + data['homepage'] = False data['mark'] = 50 new = 1 @@ -47,22 +47,32 @@ data['title'] = data['github_repo'] -if not 'images' in data: - images = glob("**/*.jpg", recursive=True) - images.extend(glob("**/*.JPG", recursive=True)) - images.extend(glob("**/*.png", recursive=True)) - images.extend(glob("**/*.PNG", recursive=True)) - images.extend(glob("**/*.gif", recursive=True)) - images.extend(glob("**/*.GIF", recursive=True)) - images.extend(glob("**/*.svg", recursive=True)) - images.extend(glob("**/*.SVG", recursive=True)) - data['images'] = images +#if not 'images' in data: +images = glob("**/*.jpg", recursive=True) +images.extend(glob("**/*.JPG", recursive=True)) +images.extend(glob("**/*.png", recursive=True)) +images.extend(glob("**/*.PNG", recursive=True)) +images.extend(glob("**/*.gif", recursive=True)) +images.extend(glob("**/*.GIF", recursive=True)) +images.extend(glob("**/*.svg", recursive=True)) +images.extend(glob("**/*.SVG", recursive=True)) + +data['images'] = [] +for x in images: + if "asset" not in x: + print("Add", x) + data['images'].append(x) # try to guess schematics file scheme = glob("doc/**/*schematic.pdf", recursive=True) if len(scheme): data['mod_scheme'] = scheme[0] +scheme = glob("hw/**/*ibom.html", recursive=True) +if len(scheme): + data['mod_ibom'] = scheme[0] + + print(data) yaml.dump(data, stream) stream.close()