Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b4953bc5f | ||
|
|
62f6fc85a5 | ||
|
|
d2b1b2183b | ||
|
|
a236609ebf | ||
|
|
6c893c136e | ||
|
|
f4212f232e | ||
|
|
3a805b0ca9 | ||
|
|
c52627cc8f | ||
|
|
b84fed1de9 | ||
|
|
d49bc548c7 | ||
|
|
492d6cd2d4 | ||
|
|
be3558167e | ||
|
|
4573fd2760 | ||
|
|
2a23c2e81d |
@@ -0,0 +1,23 @@
|
|||||||
|
name: Release @pybricks/images
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '@pybricks/images/**'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish_ide_docs:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
# Setup .npmrc file to publish to npm
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: '16.x'
|
||||||
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
- run: ./build.py
|
||||||
|
working-directory: npm/images
|
||||||
|
- run: yarn publish
|
||||||
|
working-directory: npm/images/build
|
||||||
|
env:
|
||||||
|
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
|
||||||
@@ -4,6 +4,11 @@
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
## 3.2.0b5 - 2022-11-11
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixed Jedi code completion for `Color` and `Icon` classes in `pybricks.parameters`.
|
||||||
|
|
||||||
## 3.2.0b4 - 2022-10-21
|
## 3.2.0b4 - 2022-10-21
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2018-2021 The Pybricks Authors
|
Copyright (c) 2018-2022 The Pybricks Authors
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ HUB_FEATURES = {
|
|||||||
"movehub": {"movehub"} | FEATURES_SMALL,
|
"movehub": {"movehub"} | FEATURES_SMALL,
|
||||||
"cityhub": {"cityhub"} | FEATURES_MEDIUM,
|
"cityhub": {"cityhub"} | FEATURES_MEDIUM,
|
||||||
"technichub": {"technichub"} | FEATURES_MEDIUM,
|
"technichub": {"technichub"} | FEATURES_MEDIUM,
|
||||||
"primehub": {"primehub", "inventorhub"} | FEATURES_LARGE,
|
"primehub": {"primehub", "inventorhub", "light-matrix"} | FEATURES_LARGE,
|
||||||
"inventorhub": {"primehub", "inventorhub"} | FEATURES_LARGE,
|
"inventorhub": {"primehub", "inventorhub", "light-matrix"} | FEATURES_LARGE,
|
||||||
"essentialhub": {"essentialhub"} | FEATURES_LARGE,
|
"essentialhub": {"essentialhub"} | FEATURES_LARGE,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ class PybricksRequirementsStaticDirective(Directive):
|
|||||||
# Cell with image of a hub.
|
# Cell with image of a hub.
|
||||||
hub_cell = """
|
hub_cell = """
|
||||||
<th><div class="align-default">
|
<th><div class="align-default">
|
||||||
<img alt="" src="{0}_images/compat_{1}_{2}_label.png">
|
<img alt="" src="{0}_images/compat_{1}_{2}.png">
|
||||||
</div></th>
|
</div></th>
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 121 KiB |
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 80 KiB |
@@ -0,0 +1,86 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
version="1.1"
|
||||||
|
id="svg2"
|
||||||
|
width="525"
|
||||||
|
height="525"
|
||||||
|
viewBox="0 0 525 525"
|
||||||
|
sodipodi:docname="icon_cityhub.svg"
|
||||||
|
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||||
|
<metadata
|
||||||
|
id="metadata8">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs6">
|
||||||
|
<clipPath
|
||||||
|
clipPathUnits="userSpaceOnUse"
|
||||||
|
id="clipPath860">
|
||||||
|
<rect
|
||||||
|
style="fill:#6ab0de;fill-opacity:1;stroke:#6ab0de;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
id="rect862"
|
||||||
|
width="589.10107"
|
||||||
|
height="96.333336"
|
||||||
|
x="235.33333"
|
||||||
|
y="-236.00002" />
|
||||||
|
</clipPath>
|
||||||
|
<clipPath
|
||||||
|
clipPathUnits="userSpaceOnUse"
|
||||||
|
id="clipPath1040">
|
||||||
|
<rect
|
||||||
|
style="fill:#1e1e1e;fill-opacity:1;stroke:none;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
id="rect1042"
|
||||||
|
width="128.5101"
|
||||||
|
height="19.934668"
|
||||||
|
x="827.15656"
|
||||||
|
y="74.666672" />
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
pagecolor="#fcfcfc"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="1"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="1856"
|
||||||
|
inkscape:window-height="1136"
|
||||||
|
id="namedview4"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="0.9950413"
|
||||||
|
inkscape:cx="301.49502"
|
||||||
|
inkscape:cy="344.20682"
|
||||||
|
inkscape:window-x="64"
|
||||||
|
inkscape:window-y="27"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="svg2"
|
||||||
|
inkscape:snap-global="false"
|
||||||
|
inkscape:pagecheckerboard="0" />
|
||||||
|
<image
|
||||||
|
width="349"
|
||||||
|
height="400"
|
||||||
|
preserveAspectRatio="none"
|
||||||
|
xlink:href="../cad/output/hub-city.png"
|
||||||
|
id="image834"
|
||||||
|
x="90"
|
||||||
|
y="55" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.5 KiB |
@@ -0,0 +1,86 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
version="1.1"
|
||||||
|
id="svg2"
|
||||||
|
width="525"
|
||||||
|
height="525"
|
||||||
|
viewBox="0 0 525 525"
|
||||||
|
sodipodi:docname="icon_essentialhub.svg"
|
||||||
|
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||||
|
<metadata
|
||||||
|
id="metadata8">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs6">
|
||||||
|
<clipPath
|
||||||
|
clipPathUnits="userSpaceOnUse"
|
||||||
|
id="clipPath860">
|
||||||
|
<rect
|
||||||
|
style="fill:#6ab0de;fill-opacity:1;stroke:#6ab0de;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
id="rect862"
|
||||||
|
width="589.10107"
|
||||||
|
height="96.333336"
|
||||||
|
x="235.33333"
|
||||||
|
y="-236.00002" />
|
||||||
|
</clipPath>
|
||||||
|
<clipPath
|
||||||
|
clipPathUnits="userSpaceOnUse"
|
||||||
|
id="clipPath1040">
|
||||||
|
<rect
|
||||||
|
style="fill:#1e1e1e;fill-opacity:1;stroke:none;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
id="rect1042"
|
||||||
|
width="128.5101"
|
||||||
|
height="19.934668"
|
||||||
|
x="827.15656"
|
||||||
|
y="74.666672" />
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
pagecolor="#fcfcfc"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="1"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="1856"
|
||||||
|
inkscape:window-height="1136"
|
||||||
|
id="namedview4"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="0.9950413"
|
||||||
|
inkscape:cx="301.49502"
|
||||||
|
inkscape:cy="344.20682"
|
||||||
|
inkscape:window-x="64"
|
||||||
|
inkscape:window-y="27"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="svg2"
|
||||||
|
inkscape:snap-global="false"
|
||||||
|
inkscape:pagecheckerboard="0" />
|
||||||
|
<image
|
||||||
|
width="379"
|
||||||
|
height="338"
|
||||||
|
preserveAspectRatio="none"
|
||||||
|
xlink:href="../cad/output/hub-essential.png"
|
||||||
|
id="image1283"
|
||||||
|
x="80"
|
||||||
|
y="80" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.5 KiB |
@@ -0,0 +1,86 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
version="1.1"
|
||||||
|
id="svg2"
|
||||||
|
width="525"
|
||||||
|
height="525"
|
||||||
|
viewBox="0 0 525 525"
|
||||||
|
sodipodi:docname="icon_inventorhub.svg"
|
||||||
|
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||||
|
<metadata
|
||||||
|
id="metadata8">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs6">
|
||||||
|
<clipPath
|
||||||
|
clipPathUnits="userSpaceOnUse"
|
||||||
|
id="clipPath860">
|
||||||
|
<rect
|
||||||
|
style="fill:#6ab0de;fill-opacity:1;stroke:#6ab0de;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
id="rect862"
|
||||||
|
width="589.10107"
|
||||||
|
height="96.333336"
|
||||||
|
x="235.33333"
|
||||||
|
y="-236.00002" />
|
||||||
|
</clipPath>
|
||||||
|
<clipPath
|
||||||
|
clipPathUnits="userSpaceOnUse"
|
||||||
|
id="clipPath1040">
|
||||||
|
<rect
|
||||||
|
style="fill:#1e1e1e;fill-opacity:1;stroke:none;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
id="rect1042"
|
||||||
|
width="128.5101"
|
||||||
|
height="19.934668"
|
||||||
|
x="827.15656"
|
||||||
|
y="74.666672" />
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
pagecolor="#fcfcfc"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="1"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="1856"
|
||||||
|
inkscape:window-height="1136"
|
||||||
|
id="namedview4"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="0.9950413"
|
||||||
|
inkscape:cx="301.49502"
|
||||||
|
inkscape:cy="344.20682"
|
||||||
|
inkscape:window-x="64"
|
||||||
|
inkscape:window-y="27"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="svg2"
|
||||||
|
inkscape:snap-global="false"
|
||||||
|
inkscape:pagecheckerboard="0" />
|
||||||
|
<image
|
||||||
|
width="513"
|
||||||
|
height="465"
|
||||||
|
preserveAspectRatio="none"
|
||||||
|
xlink:href="../cad/output/hub-inventor.png"
|
||||||
|
id="image1430"
|
||||||
|
x="7"
|
||||||
|
y="21" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.5 KiB |
@@ -0,0 +1,87 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
version="1.1"
|
||||||
|
id="svg2"
|
||||||
|
width="525"
|
||||||
|
height="525"
|
||||||
|
viewBox="0 0 525 525"
|
||||||
|
sodipodi:docname="icon_movehub.svg"
|
||||||
|
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||||
|
<metadata
|
||||||
|
id="metadata8">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs6">
|
||||||
|
<clipPath
|
||||||
|
clipPathUnits="userSpaceOnUse"
|
||||||
|
id="clipPath860">
|
||||||
|
<rect
|
||||||
|
style="fill:#6ab0de;fill-opacity:1;stroke:#6ab0de;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
id="rect862"
|
||||||
|
width="589.10107"
|
||||||
|
height="96.333336"
|
||||||
|
x="235.33333"
|
||||||
|
y="-236.00002" />
|
||||||
|
</clipPath>
|
||||||
|
<clipPath
|
||||||
|
clipPathUnits="userSpaceOnUse"
|
||||||
|
id="clipPath1040">
|
||||||
|
<rect
|
||||||
|
style="fill:#1e1e1e;fill-opacity:1;stroke:none;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
id="rect1042"
|
||||||
|
width="128.5101"
|
||||||
|
height="19.934668"
|
||||||
|
x="827.15656"
|
||||||
|
y="74.666672" />
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
pagecolor="#fcfcfc"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="1"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="1856"
|
||||||
|
inkscape:window-height="1136"
|
||||||
|
id="namedview4"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="0.9950413"
|
||||||
|
inkscape:cx="301.49502"
|
||||||
|
inkscape:cy="344.20682"
|
||||||
|
inkscape:window-x="64"
|
||||||
|
inkscape:window-y="27"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="svg2"
|
||||||
|
inkscape:snap-global="false"
|
||||||
|
inkscape:pagecheckerboard="0" />
|
||||||
|
<image
|
||||||
|
width="525"
|
||||||
|
height="475.44"
|
||||||
|
preserveAspectRatio="none"
|
||||||
|
xlink:href="../cad/output/hub-move.png"
|
||||||
|
id="image1015"
|
||||||
|
x="0"
|
||||||
|
y="18"
|
||||||
|
style="stroke-width:1.19048" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.5 KiB |
@@ -0,0 +1,86 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
version="1.1"
|
||||||
|
id="svg2"
|
||||||
|
width="525"
|
||||||
|
height="525"
|
||||||
|
viewBox="0 0 525 525"
|
||||||
|
sodipodi:docname="icon_primehub.svg"
|
||||||
|
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||||
|
<metadata
|
||||||
|
id="metadata8">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs6">
|
||||||
|
<clipPath
|
||||||
|
clipPathUnits="userSpaceOnUse"
|
||||||
|
id="clipPath860">
|
||||||
|
<rect
|
||||||
|
style="fill:#6ab0de;fill-opacity:1;stroke:#6ab0de;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
id="rect862"
|
||||||
|
width="589.10107"
|
||||||
|
height="96.333336"
|
||||||
|
x="235.33333"
|
||||||
|
y="-236.00002" />
|
||||||
|
</clipPath>
|
||||||
|
<clipPath
|
||||||
|
clipPathUnits="userSpaceOnUse"
|
||||||
|
id="clipPath1040">
|
||||||
|
<rect
|
||||||
|
style="fill:#1e1e1e;fill-opacity:1;stroke:none;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
id="rect1042"
|
||||||
|
width="128.5101"
|
||||||
|
height="19.934668"
|
||||||
|
x="827.15656"
|
||||||
|
y="74.666672" />
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
pagecolor="#fcfcfc"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="1"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="1856"
|
||||||
|
inkscape:window-height="1136"
|
||||||
|
id="namedview4"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="0.9950413"
|
||||||
|
inkscape:cx="301.49502"
|
||||||
|
inkscape:cy="344.20682"
|
||||||
|
inkscape:window-x="64"
|
||||||
|
inkscape:window-y="27"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="svg2"
|
||||||
|
inkscape:snap-global="false"
|
||||||
|
inkscape:pagecheckerboard="0" />
|
||||||
|
<image
|
||||||
|
width="513"
|
||||||
|
height="465"
|
||||||
|
preserveAspectRatio="none"
|
||||||
|
xlink:href="../cad/output/hub-prime.png"
|
||||||
|
id="image1329"
|
||||||
|
x="7"
|
||||||
|
y="21" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.5 KiB |
@@ -0,0 +1,87 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
version="1.1"
|
||||||
|
id="svg2"
|
||||||
|
width="525"
|
||||||
|
height="525"
|
||||||
|
viewBox="0 0 525 525"
|
||||||
|
sodipodi:docname="icon_technichub.svg"
|
||||||
|
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||||
|
<metadata
|
||||||
|
id="metadata8">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs6">
|
||||||
|
<clipPath
|
||||||
|
clipPathUnits="userSpaceOnUse"
|
||||||
|
id="clipPath860">
|
||||||
|
<rect
|
||||||
|
style="fill:#6ab0de;fill-opacity:1;stroke:#6ab0de;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
id="rect862"
|
||||||
|
width="589.10107"
|
||||||
|
height="96.333336"
|
||||||
|
x="235.33333"
|
||||||
|
y="-236.00002" />
|
||||||
|
</clipPath>
|
||||||
|
<clipPath
|
||||||
|
clipPathUnits="userSpaceOnUse"
|
||||||
|
id="clipPath1040">
|
||||||
|
<rect
|
||||||
|
style="fill:#1e1e1e;fill-opacity:1;stroke:none;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
id="rect1042"
|
||||||
|
width="128.5101"
|
||||||
|
height="19.934668"
|
||||||
|
x="827.15656"
|
||||||
|
y="74.666672" />
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
pagecolor="#fcfcfc"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="1"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="1856"
|
||||||
|
inkscape:window-height="1136"
|
||||||
|
id="namedview4"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="0.9950413"
|
||||||
|
inkscape:cx="301.49502"
|
||||||
|
inkscape:cy="344.20682"
|
||||||
|
inkscape:window-x="64"
|
||||||
|
inkscape:window-y="27"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="svg2"
|
||||||
|
inkscape:snap-global="false"
|
||||||
|
inkscape:pagecheckerboard="0" />
|
||||||
|
<image
|
||||||
|
width="525"
|
||||||
|
height="447.47662"
|
||||||
|
preserveAspectRatio="none"
|
||||||
|
xlink:href="../cad/output/hub-technic.png"
|
||||||
|
id="image985"
|
||||||
|
x="0"
|
||||||
|
y="35.996998"
|
||||||
|
style="stroke-width:1.01905" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.5 KiB |
@@ -177,13 +177,15 @@ Changing the display orientation
|
|||||||
.. literalinclude::
|
.. literalinclude::
|
||||||
../../../examples/pup/hub_primehub/display_orientation_imu.py
|
../../../examples/pup/hub_primehub/display_orientation_imu.py
|
||||||
|
|
||||||
|
.. _make_icons:
|
||||||
|
|
||||||
Making your own images
|
Making your own images
|
||||||
**********************
|
**********************
|
||||||
|
|
||||||
.. literalinclude::
|
.. literalinclude::
|
||||||
../../../examples/pup/hub_primehub/display_matrix.py
|
../../../examples/pup/hub_primehub/display_matrix.py
|
||||||
|
|
||||||
Combining images to make expressions
|
Combining icons to make expressions
|
||||||
************************************
|
************************************
|
||||||
|
|
||||||
.. literalinclude::
|
.. literalinclude::
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
.. pybricks-requirements:: light-matrix
|
||||||
|
|
||||||
|
Icon
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. autoclass:: pybricks.parameters.Icon
|
||||||
|
|
||||||
|
See the :ref:`make_icons` section for examples.
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
button
|
button
|
||||||
color
|
color
|
||||||
direction
|
direction
|
||||||
|
icon
|
||||||
port
|
port
|
||||||
side
|
side
|
||||||
stop
|
stop
|
||||||
@@ -23,6 +24,8 @@
|
|||||||
|
|
||||||
.. pybricks-classlink:: Direction
|
.. pybricks-classlink:: Direction
|
||||||
|
|
||||||
|
.. pybricks-classlink:: Icon
|
||||||
|
|
||||||
.. pybricks-classlink:: Port
|
.. pybricks-classlink:: Port
|
||||||
|
|
||||||
.. pybricks-classlink:: Side
|
.. pybricks-classlink:: Side
|
||||||
|
|||||||
@@ -104,3 +104,12 @@
|
|||||||
|
|
||||||
.. autoattribute:: pybricks.robotics.DriveBase.heading_control
|
.. autoattribute:: pybricks.robotics.DriveBase.heading_control
|
||||||
:annotation:
|
:annotation:
|
||||||
|
|
||||||
|
Examples
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
Driving straight and turning in place
|
||||||
|
**********************************************
|
||||||
|
|
||||||
|
.. literalinclude::
|
||||||
|
../../examples/pup/robotics/drivebase_basics.py
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
from pybricks.pupdevices import Motor
|
||||||
|
from pybricks.parameters import Port, Direction
|
||||||
|
from pybricks.robotics import DriveBase
|
||||||
|
|
||||||
|
# Initialize both motors. In this example, the motor on the
|
||||||
|
# left must turn counterclockwise to make the robot go forward.
|
||||||
|
left_motor = Motor(Port.A, Direction.COUNTERCLOCKWISE)
|
||||||
|
right_motor = Motor(Port.B)
|
||||||
|
|
||||||
|
# Initialize the drive base. In this example, the wheel diameter is 56mm.
|
||||||
|
# The distance between the two wheel-ground contact points is 112mm.
|
||||||
|
drive_base = DriveBase(left_motor, right_motor, wheel_diameter=56, axle_track=112)
|
||||||
|
|
||||||
|
# Drive forward by 500mm (half a meter).
|
||||||
|
drive_base.straight(500)
|
||||||
|
|
||||||
|
# Turn around clockwise (180 degrees)
|
||||||
|
drive_base.turn(180)
|
||||||
|
|
||||||
|
# Drive forward again to drive back.
|
||||||
|
drive_base.straight(500)
|
||||||
|
|
||||||
|
# Turn around counterclockwise.
|
||||||
|
drive_base.turn(-180)
|
||||||
@@ -4,6 +4,9 @@
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixed code completion for `Color` and `Icon` classes in `pybricks.parameters`.
|
||||||
|
|
||||||
## 1.2.0 - 2022-10-21
|
## 1.2.0 - 2022-10-21
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -0,0 +1,139 @@
|
|||||||
|
import json
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
from pybricks_jedi import CompletionItem, complete
|
||||||
|
|
||||||
|
|
||||||
|
def _create_snippet(class_name: str) -> str:
|
||||||
|
"""
|
||||||
|
Creates a code snippet::
|
||||||
|
|
||||||
|
from pybricks.parameters import {class_name}
|
||||||
|
{class_name}.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
line: The value substituted for ``{class_name}``
|
||||||
|
"""
|
||||||
|
return "\n".join(
|
||||||
|
(f"from pybricks.parameters import {class_name}", f"{class_name}.")
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
ENUMS = [
|
||||||
|
pytest.param(
|
||||||
|
"Button",
|
||||||
|
[
|
||||||
|
"BEACON",
|
||||||
|
"BLUETOOTH",
|
||||||
|
"CENTER",
|
||||||
|
"DOWN",
|
||||||
|
"LEFT",
|
||||||
|
"LEFT_DOWN",
|
||||||
|
"LEFT_MINUS",
|
||||||
|
"LEFT_PLUS",
|
||||||
|
"LEFT_UP",
|
||||||
|
"RIGHT",
|
||||||
|
"RIGHT_DOWN",
|
||||||
|
"RIGHT_MINUS",
|
||||||
|
"RIGHT_PLUS",
|
||||||
|
"RIGHT_UP",
|
||||||
|
"UP",
|
||||||
|
],
|
||||||
|
),
|
||||||
|
pytest.param(
|
||||||
|
"Color",
|
||||||
|
[
|
||||||
|
"BLACK",
|
||||||
|
"BLUE",
|
||||||
|
"BROWN",
|
||||||
|
"CYAN",
|
||||||
|
"GRAY",
|
||||||
|
"GREEN",
|
||||||
|
"MAGENTA",
|
||||||
|
"NONE",
|
||||||
|
"ORANGE",
|
||||||
|
"RED",
|
||||||
|
"VIOLET",
|
||||||
|
"WHITE",
|
||||||
|
"YELLOW",
|
||||||
|
],
|
||||||
|
),
|
||||||
|
pytest.param("Direction", ["CLOCKWISE", "COUNTERCLOCKWISE"]),
|
||||||
|
pytest.param(
|
||||||
|
"Icon",
|
||||||
|
[
|
||||||
|
"ARROW_DOWN",
|
||||||
|
"ARROW_LEFT",
|
||||||
|
"ARROW_LEFT_DOWN",
|
||||||
|
"ARROW_LEFT_UP",
|
||||||
|
"ARROW_RIGHT",
|
||||||
|
"ARROW_RIGHT_DOWN",
|
||||||
|
"ARROW_RIGHT_UP",
|
||||||
|
"ARROW_UP",
|
||||||
|
"CIRCLE",
|
||||||
|
"CLOCKWISE",
|
||||||
|
"COUNTERCLOCKWISE",
|
||||||
|
"DOWN",
|
||||||
|
"EMPTY",
|
||||||
|
"EYE_LEFT",
|
||||||
|
"EYE_LEFT_BLINK",
|
||||||
|
"EYE_LEFT_BROW",
|
||||||
|
"EYE_LEFT_BROW_UP",
|
||||||
|
"EYE_RIGHT",
|
||||||
|
"EYE_RIGHT_BLINK",
|
||||||
|
"EYE_RIGHT_BROW",
|
||||||
|
"EYE_RIGHT_BROW_UP",
|
||||||
|
"FALSE",
|
||||||
|
"FULL",
|
||||||
|
"HAPPY",
|
||||||
|
"HEART",
|
||||||
|
"LEFT",
|
||||||
|
"PAUSE",
|
||||||
|
"RIGHT",
|
||||||
|
"SAD",
|
||||||
|
"SQUARE",
|
||||||
|
"TRIANGLE_DOWN",
|
||||||
|
"TRIANGLE_LEFT",
|
||||||
|
"TRIANGLE_RIGHT",
|
||||||
|
"TRIANGLE_UP",
|
||||||
|
"TRUE",
|
||||||
|
"UP",
|
||||||
|
],
|
||||||
|
),
|
||||||
|
pytest.param("Port", ["A", "B", "C", "D", "E", "F", "S1", "S2", "S3", "S4"]),
|
||||||
|
pytest.param("Side", ["BACK", "BOTTOM", "FRONT", "LEFT", "RIGHT", "TOP"]),
|
||||||
|
pytest.param("Stop", ["BRAKE", "COAST", "HOLD"]),
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize("class_name,members", ENUMS)
|
||||||
|
def test_get_parameter_class_member_completion(class_name: str, members: list[str]):
|
||||||
|
|
||||||
|
code = _create_snippet(class_name)
|
||||||
|
completions: list[CompletionItem] = json.loads(
|
||||||
|
complete(code, 2, len(class_name) + 2)
|
||||||
|
)
|
||||||
|
assert [c["insertText"] for c in completions] == members
|
||||||
|
|
||||||
|
|
||||||
|
def test_get_parameter_color_completion():
|
||||||
|
code = "\n".join(["from pybricks.parameters import Color", "Color.RED."])
|
||||||
|
completions: list[CompletionItem] = json.loads(complete(code, 2, 11))
|
||||||
|
assert [c["insertText"] for c in completions] == [
|
||||||
|
"BLACK",
|
||||||
|
"BLUE",
|
||||||
|
"BROWN",
|
||||||
|
"CYAN",
|
||||||
|
"GRAY",
|
||||||
|
"GREEN",
|
||||||
|
"h",
|
||||||
|
"MAGENTA",
|
||||||
|
"NONE",
|
||||||
|
"ORANGE",
|
||||||
|
"RED",
|
||||||
|
"s",
|
||||||
|
"v",
|
||||||
|
"VIOLET",
|
||||||
|
"WHITE",
|
||||||
|
"YELLOW",
|
||||||
|
]
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
version-tag-prefix "@pybricks/images/v"
|
||||||
|
version-git-message "@pybricks/images v%s"
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
<!-- refer to https://keepachangelog.com/en/1.0.0/ for guidance -->
|
||||||
|
|
||||||
|
## 1.2.1 - 2022-11-08
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Changed size of some icons.
|
||||||
|
|
||||||
|
## 1.2.0 - 2022-10-28
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Changed all icon files to have the same dimensions.
|
||||||
|
|
||||||
|
## 1.1.0 - 2022-10-28
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Added MINDSTORMS Robot Inventor hub image.
|
||||||
|
|
||||||
|
## 1.0.0 - 2022-10-28
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Added new @pybricks/images package.
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2018-2022 The Pybricks Authors
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
@pybricks/images
|
||||||
|
================
|
||||||
|
|
||||||
|
Image resource for Pybricks Code.
|
||||||
|
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import json
|
||||||
|
import pathlib
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
BUILD_DIR = (pathlib.Path(__file__).parent / "build").resolve()
|
||||||
|
IMAGE_DIR = (
|
||||||
|
pathlib.Path(__file__).parent.parent.parent / "doc" / "main" / "diagrams"
|
||||||
|
).resolve()
|
||||||
|
HUBS = ["move", "city", "technic", "prime", "essential", "inventor"]
|
||||||
|
|
||||||
|
package_json = {
|
||||||
|
"name": "@pybricks/images",
|
||||||
|
"version": "1.2.1",
|
||||||
|
"description": "Distribution of Pybricks images.",
|
||||||
|
"license": "MIT",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/pybricks/pybricks-api",
|
||||||
|
"directory": "npm/images",
|
||||||
|
},
|
||||||
|
"publishConfig": {"registry": "https://registry.npmjs.org", "access": "public"},
|
||||||
|
}
|
||||||
|
|
||||||
|
# ensure empty build directory so we don't end up with stale files
|
||||||
|
shutil.rmtree(BUILD_DIR, True)
|
||||||
|
BUILD_DIR.mkdir()
|
||||||
|
|
||||||
|
# copy the hub images
|
||||||
|
for h in HUBS:
|
||||||
|
shutil.copyfile(IMAGE_DIR / f"icon_{h}hub.png", BUILD_DIR / f"hub-{h}.png")
|
||||||
|
|
||||||
|
# generate package.json file
|
||||||
|
|
||||||
|
# create "exports" item for hub images.
|
||||||
|
package_json["exports"] = {f"./hub-{h}.png": f"./hub-{h}.png" for h in HUBS}
|
||||||
|
|
||||||
|
with open(BUILD_DIR / "package.json", "w") as f:
|
||||||
|
json.dump(package_json, f, indent=2)
|
||||||
|
|
||||||
|
# copy additional files
|
||||||
|
|
||||||
|
ROOT_DIR = (pathlib.Path(__file__).parent).resolve()
|
||||||
|
|
||||||
|
for file in "README.md", "CHANGELOG.md", "LICENSE":
|
||||||
|
shutil.copy(ROOT_DIR / file, BUILD_DIR / file)
|
||||||
@@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
<!-- refer to https://keepachangelog.com/en/1.0.0/ for guidance -->
|
<!-- refer to https://keepachangelog.com/en/1.0.0/ for guidance -->
|
||||||
|
|
||||||
|
## 1.1.0 - 2022-10-21
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Updated `pybricks_jedi` Python package to v1.2.0.
|
||||||
|
|
||||||
## 1.0.1 - 2022-09-07
|
## 1.0.1 - 2022-09-07
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ BUILD_DIR = (pathlib.Path(__file__).parent / "build").resolve()
|
|||||||
|
|
||||||
package_json = {
|
package_json = {
|
||||||
"name": "@pybricks/jedi",
|
"name": "@pybricks/jedi",
|
||||||
"version": "1.0.1",
|
"version": "1.2.0",
|
||||||
"description": "Binary distribution of pybricks-jedi Python package and dependencies for use with Pyodide.",
|
"description": "Binary distribution of pybricks-jedi Python package and dependencies for use with Pyodide.",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -38,7 +38,7 @@ subprocess.check_call(
|
|||||||
"pip",
|
"pip",
|
||||||
"download",
|
"download",
|
||||||
"--only-binary=any",
|
"--only-binary=any",
|
||||||
"pybricks-jedi==1.1.0",
|
"pybricks-jedi==1.2.0",
|
||||||
],
|
],
|
||||||
cwd=BUILD_DIR,
|
cwd=BUILD_DIR,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "pybricks"
|
name = "pybricks"
|
||||||
version = "3.2.0b4"
|
version = "3.2.0b5"
|
||||||
description = "Documentation and user-API stubs for Pybricks MicroPython"
|
description = "Documentation and user-API stubs for Pybricks MicroPython"
|
||||||
authors = ["The Pybricks Authors <dev@pybricks.com>"]
|
authors = ["The Pybricks Authors <dev@pybricks.com>"]
|
||||||
maintainers = ["Laurens Valk <laurens@pybricks.com>", "David Lechner <david@pybricks.com>" ]
|
maintainers = ["Laurens Valk <laurens@pybricks.com>", "David Lechner <david@pybricks.com>" ]
|
||||||
|
|||||||
@@ -60,21 +60,43 @@ class _PybricksEnum(Enum, metaclass=_PybricksEnumMeta):
|
|||||||
class Color:
|
class Color:
|
||||||
"""Light or surface color."""
|
"""Light or surface color."""
|
||||||
|
|
||||||
h: int
|
NONE: Color = ...
|
||||||
s: int
|
BLACK: Color = ...
|
||||||
v: int
|
GRAY: Color = ...
|
||||||
|
WHITE: Color = ...
|
||||||
|
RED: Color = ...
|
||||||
|
ORANGE: Color = ...
|
||||||
|
BROWN: Color = ...
|
||||||
|
YELLOW: Color = ...
|
||||||
|
GREEN: Color = ...
|
||||||
|
CYAN: Color = ...
|
||||||
|
BLUE: Color = ...
|
||||||
|
VIOLET: Color = ...
|
||||||
|
MAGENTA: Color = ...
|
||||||
|
|
||||||
def __init__(self, h: Number, s: Number = 100, v: Number = 100):
|
def __init__(self, h: Number, s: Number = 100, v: Number = 100):
|
||||||
"""Color(h, s=100, v=100)
|
"""Color(h, s=100, v=100)
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
h (Number, deg): Hue (0--360)
|
h (Number, deg): Hue.
|
||||||
s (Number, %): Saturation.
|
s (Number, %): Saturation.
|
||||||
v (Number, %): Brightness value.
|
v (Number, %): Brightness value.
|
||||||
"""
|
"""
|
||||||
self.h = h % 360
|
|
||||||
self.s = max(0, min(s, 100))
|
self.h = int(h) % 360
|
||||||
self.v = max(0, min(v, 100))
|
"""
|
||||||
|
The hue.
|
||||||
|
"""
|
||||||
|
|
||||||
|
self.s = max(0, min(int(s), 100))
|
||||||
|
"""
|
||||||
|
The saturation.
|
||||||
|
"""
|
||||||
|
|
||||||
|
self.v = max(0, min(int(v), 100))
|
||||||
|
"""
|
||||||
|
The brightness value.
|
||||||
|
"""
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "Color(h={}, s={}, v={})".format(self.h, self.s, self.v)
|
return "Color(h={}, s={}, v={})".format(self.h, self.s, self.v)
|
||||||
@@ -185,39 +207,297 @@ class Side(_PybricksEnum):
|
|||||||
|
|
||||||
|
|
||||||
class Icon:
|
class Icon:
|
||||||
UP: _Matrix
|
"""Icons to display on a light matrix.
|
||||||
DOWN: _Matrix
|
|
||||||
LEFT: _Matrix
|
Each of the following attributes are matrices. This means you can scale
|
||||||
RIGHT: _Matrix
|
icons to adjust the brightness or add icons to make composites.
|
||||||
ARROW_RIGHT_UP: _Matrix
|
"""
|
||||||
ARROW_RIGHT_DOWN: _Matrix
|
|
||||||
ARROW_LEFT_UP: _Matrix
|
UP: _Matrix = ...
|
||||||
ARROW_LEFT_DOWN: _Matrix
|
"""
|
||||||
ARROW_UP: _Matrix
|
| ⬜⬜🟨⬜⬜
|
||||||
ARROW_DOWN: _Matrix
|
| ⬜🟨🟨🟨⬜
|
||||||
ARROW_LEFT: _Matrix
|
| 🟨🟨🟨🟨🟨
|
||||||
ARROW_RIGHT: _Matrix
|
| ⬜🟨🟨🟨⬜
|
||||||
HAPPY: _Matrix
|
| ⬜🟨🟨🟨⬜
|
||||||
SAD: _Matrix
|
"""
|
||||||
EYE_LEFT: _Matrix
|
DOWN: _Matrix = ...
|
||||||
EYE_RIGHT: _Matrix
|
"""
|
||||||
EYE_LEFT_BLINK: _Matrix
|
| ⬜🟨🟨🟨⬜
|
||||||
EYE_RIGHT_BLINK: _Matrix
|
| ⬜🟨🟨🟨⬜
|
||||||
EYE_RIGHT_BROW: _Matrix
|
| 🟨🟨🟨🟨🟨
|
||||||
EYE_LEFT_BROW: _Matrix
|
| ⬜🟨🟨🟨⬜
|
||||||
EYE_LEFT_BROW_UP: _Matrix
|
| ⬜⬜🟨⬜⬜
|
||||||
EYE_RIGHT_BROW_UP: _Matrix
|
"""
|
||||||
HEART: _Matrix
|
LEFT: _Matrix = ...
|
||||||
PAUSE: _Matrix
|
"""
|
||||||
EMPTY: _Matrix
|
| ⬜⬜🟨⬜⬜
|
||||||
FULL: _Matrix
|
| ⬜🟨🟨🟨🟨
|
||||||
SQUARE: _Matrix
|
| 🟨🟨🟨🟨🟨
|
||||||
TRIANGLE_RIGHT: _Matrix
|
| ⬜🟨🟨🟨🟨
|
||||||
TRIANGLE_LEFT: _Matrix
|
| ⬜⬜🟨⬜⬜
|
||||||
TRIANGLE_UP: _Matrix
|
"""
|
||||||
TRIANGLE_DOWN: _Matrix
|
RIGHT: _Matrix = ...
|
||||||
CIRCLE: _Matrix
|
"""
|
||||||
CLOCKWISE: _Matrix
|
| ⬜⬜🟨⬜⬜
|
||||||
COUNTERCLOCKWISE: _Matrix
|
| 🟨🟨🟨🟨⬜
|
||||||
TRUE: _Matrix
|
| 🟨🟨🟨🟨🟨
|
||||||
FALSE: _Matrix
|
| 🟨🟨🟨🟨⬜
|
||||||
|
| ⬜⬜🟨⬜⬜
|
||||||
|
"""
|
||||||
|
ARROW_RIGHT_UP: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| ⬜⬜🟨🟨🟨
|
||||||
|
| ⬜⬜⬜🟨🟨
|
||||||
|
| ⬜⬜🟨⬜🟨
|
||||||
|
| ⬜🟨⬜⬜⬜
|
||||||
|
| 🟨⬜⬜⬜⬜
|
||||||
|
"""
|
||||||
|
ARROW_RIGHT_DOWN: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| 🟨⬜⬜⬜⬜
|
||||||
|
| ⬜🟨⬜⬜⬜
|
||||||
|
| ⬜⬜🟨⬜🟨
|
||||||
|
| ⬜⬜⬜🟨🟨
|
||||||
|
| ⬜⬜🟨🟨🟨
|
||||||
|
"""
|
||||||
|
ARROW_LEFT_UP: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| 🟨🟨🟨⬜⬜
|
||||||
|
| 🟨🟨⬜⬜⬜
|
||||||
|
| 🟨⬜🟨⬜⬜
|
||||||
|
| ⬜⬜⬜🟨⬜
|
||||||
|
| ⬜⬜⬜⬜🟨
|
||||||
|
"""
|
||||||
|
ARROW_LEFT_DOWN: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| ⬜⬜⬜⬜🟨
|
||||||
|
| ⬜⬜⬜🟨⬜
|
||||||
|
| 🟨⬜🟨⬜⬜
|
||||||
|
| 🟨🟨⬜⬜⬜
|
||||||
|
| 🟨🟨🟨⬜⬜
|
||||||
|
"""
|
||||||
|
ARROW_UP: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| ⬜⬜🟨⬜⬜
|
||||||
|
| ⬜🟨🟨🟨⬜
|
||||||
|
| 🟨⬜🟨⬜🟨
|
||||||
|
| ⬜⬜🟨⬜⬜
|
||||||
|
| ⬜⬜🟨⬜⬜
|
||||||
|
"""
|
||||||
|
ARROW_DOWN: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| ⬜⬜🟨⬜⬜
|
||||||
|
| ⬜⬜🟨⬜⬜
|
||||||
|
| 🟨⬜🟨⬜🟨
|
||||||
|
| ⬜🟨🟨🟨⬜
|
||||||
|
| ⬜⬜🟨⬜⬜
|
||||||
|
"""
|
||||||
|
ARROW_LEFT: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| ⬜⬜🟨⬜⬜
|
||||||
|
| ⬜🟨⬜⬜⬜
|
||||||
|
| 🟨🟨🟨🟨🟨
|
||||||
|
| ⬜🟨⬜⬜⬜
|
||||||
|
| ⬜⬜🟨⬜⬜
|
||||||
|
"""
|
||||||
|
ARROW_RIGHT: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| ⬜⬜🟨⬜⬜
|
||||||
|
| ⬜⬜⬜🟨⬜
|
||||||
|
| 🟨🟨🟨🟨🟨
|
||||||
|
| ⬜⬜⬜🟨⬜
|
||||||
|
| ⬜⬜🟨⬜⬜
|
||||||
|
"""
|
||||||
|
HAPPY: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| 🟨🟨⬜🟨🟨
|
||||||
|
| 🟨🟨⬜🟨🟨
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| 🟨⬜⬜⬜🟨
|
||||||
|
| ⬜🟨🟨🟨⬜
|
||||||
|
"""
|
||||||
|
SAD: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| 🟨🟨⬜🟨🟨
|
||||||
|
| 🟨🟨⬜🟨🟨
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜🟨🟨🟨⬜
|
||||||
|
| 🟨⬜⬜⬜🟨
|
||||||
|
"""
|
||||||
|
EYE_LEFT: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| 🟨🟨⬜⬜⬜
|
||||||
|
| 🟨🟨⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
"""
|
||||||
|
EYE_RIGHT: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜⬜⬜🟨🟨
|
||||||
|
| ⬜⬜⬜🟨🟨
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
"""
|
||||||
|
EYE_LEFT_BLINK: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| 🟨🟨⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
"""
|
||||||
|
EYE_RIGHT_BLINK: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜⬜⬜🟨🟨
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
"""
|
||||||
|
EYE_RIGHT_BROW: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜⬜⬜🟨🟨
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
"""
|
||||||
|
EYE_LEFT_BROW: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| 🟨🟨⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
"""
|
||||||
|
EYE_LEFT_BROW_UP: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| 🟨🟨⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
"""
|
||||||
|
EYE_RIGHT_BROW_UP: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| ⬜⬜⬜🟨🟨
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
"""
|
||||||
|
HEART: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| ⬜🟨⬜🟨⬜
|
||||||
|
| 🟨🟨🟨🟨🟨
|
||||||
|
| 🟨🟨🟨🟨🟨
|
||||||
|
| ⬜🟨🟨🟨⬜
|
||||||
|
| ⬜⬜🟨⬜⬜
|
||||||
|
"""
|
||||||
|
PAUSE: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜🟨⬜🟨⬜
|
||||||
|
| ⬜🟨⬜🟨⬜
|
||||||
|
| ⬜🟨⬜🟨⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
"""
|
||||||
|
EMPTY: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
"""
|
||||||
|
FULL: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| 🟨🟨🟨🟨🟨
|
||||||
|
| 🟨🟨🟨🟨🟨
|
||||||
|
| 🟨🟨🟨🟨🟨
|
||||||
|
| 🟨🟨🟨🟨🟨
|
||||||
|
| 🟨🟨🟨🟨🟨
|
||||||
|
"""
|
||||||
|
SQUARE: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜🟨🟨🟨⬜
|
||||||
|
| ⬜🟨🟨🟨⬜
|
||||||
|
| ⬜🟨🟨🟨⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
"""
|
||||||
|
TRIANGLE_RIGHT: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| ⬜🟨⬜⬜⬜
|
||||||
|
| ⬜🟨🟨⬜⬜
|
||||||
|
| ⬜🟨🟨🟨⬜
|
||||||
|
| ⬜🟨🟨⬜⬜
|
||||||
|
| ⬜🟨⬜⬜⬜
|
||||||
|
"""
|
||||||
|
TRIANGLE_LEFT: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| ⬜⬜⬜🟨⬜
|
||||||
|
| ⬜⬜🟨🟨⬜
|
||||||
|
| ⬜🟨🟨🟨⬜
|
||||||
|
| ⬜⬜🟨🟨⬜
|
||||||
|
| ⬜⬜⬜🟨⬜
|
||||||
|
"""
|
||||||
|
TRIANGLE_UP: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| ⬜⬜🟨⬜⬜
|
||||||
|
| ⬜🟨🟨🟨⬜
|
||||||
|
| 🟨🟨🟨🟨🟨
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
"""
|
||||||
|
TRIANGLE_DOWN: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
| 🟨🟨🟨🟨🟨
|
||||||
|
| ⬜🟨🟨🟨⬜
|
||||||
|
| ⬜⬜🟨⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
"""
|
||||||
|
CIRCLE: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| ⬜🟨🟨🟨⬜
|
||||||
|
| 🟨🟨🟨🟨🟨
|
||||||
|
| 🟨🟨🟨🟨🟨
|
||||||
|
| 🟨🟨🟨🟨🟨
|
||||||
|
| ⬜🟨🟨🟨⬜
|
||||||
|
"""
|
||||||
|
CLOCKWISE: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| 🟨🟨🟨🟨⬜
|
||||||
|
| 🟨⬜⬜🟨⬜
|
||||||
|
| 🟨⬜⬜🟨⬜
|
||||||
|
| 🟨⬜🟨🟨🟨
|
||||||
|
| ⬜⬜⬜🟨⬜
|
||||||
|
"""
|
||||||
|
COUNTERCLOCKWISE: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| ⬜🟨🟨🟨🟨
|
||||||
|
| ⬜🟨⬜⬜🟨
|
||||||
|
| ⬜🟨⬜⬜🟨
|
||||||
|
| 🟨🟨🟨⬜🟨
|
||||||
|
| ⬜🟨⬜⬜⬜
|
||||||
|
"""
|
||||||
|
TRUE: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| ⬜⬜⬜⬜🟨
|
||||||
|
| ⬜⬜⬜🟨⬜
|
||||||
|
| 🟨⬜🟨⬜⬜
|
||||||
|
| ⬜🟨⬜⬜⬜
|
||||||
|
| ⬜⬜⬜⬜⬜
|
||||||
|
"""
|
||||||
|
FALSE: _Matrix = ...
|
||||||
|
"""
|
||||||
|
| 🟨⬜⬜⬜🟨
|
||||||
|
| ⬜🟨⬜🟨⬜
|
||||||
|
| ⬜⬜🟨⬜⬜
|
||||||
|
| ⬜🟨⬜🟨⬜
|
||||||
|
| 🟨⬜⬜⬜🟨
|
||||||
|
"""
|
||||||
|
|||||||