Skip to content

Updates to pixelbuf API - Addresses #884 #2034

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 55 commits into from
Jan 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
db84445
WIP: refactor _pixelbuf to use strings instead of classes
rhooper Jul 21, 2019
a62a1ae
WIP: refactor _pixelbuf to use strings instead of classes
rhooper Jul 21, 2019
31e4591
WIP: refactor _pixelbuf to use strings instead of classes
rhooper Jul 21, 2019
cf3bb7e
fix bugs and inline the byteorder code
rhooper Jul 26, 2019
cff9c9b
Reuse error message
rhooper Aug 2, 2019
5c08182
fix fix the byte order property.
rhooper Aug 3, 2019
3cf9a47
fix 'white' byte for dotstars
rhooper Aug 4, 2019
1051001
Merge branch 'master' into new-pixelbuf-api
rhooper Oct 3, 2019
7507b20
disable troublesome context dump (Argument list too long)
rhooper Oct 3, 2019
0003261
Update translation
rhooper Oct 3, 2019
dfad135
echo github context using python
rhooper Oct 3, 2019
84b8ae1
change frozen point on dotstar and neopixel libs
rhooper Oct 5, 2019
000ae6b
support subclasses
rhooper Oct 5, 2019
55c688c
restructure to be subclassable
rhooper Oct 5, 2019
dc8c27d
make dotstar byteorder constants start with P. fix small bugs.
rhooper Oct 7, 2019
2970680
fix show and fix step > 1
rhooper Oct 20, 2019
fa57de0
use instance for verbose errors
rhooper Nov 16, 2019
c770ccd
make ->subscr take an instance to pass when instance_subscr is called…
rhooper Nov 23, 2019
27979f5
use base for errors
rhooper Nov 23, 2019
6108fa3
Merge branch 'master' into new-pixelbuf-api
rhooper Nov 23, 2019
03b8923
Try to fix frozen to fix CI
rhooper Nov 23, 2019
75e1e7d
Try to fix frozen to fix CI
rhooper Nov 23, 2019
a9baa44
disable -Wunused-parameter on subscr functions
rhooper Nov 23, 2019
7422f43
update translations
rhooper Nov 23, 2019
d4ed258
remove unnecessary qstrs
rhooper Nov 26, 2019
0ef9344
make pixelbuf iterable
rhooper Nov 26, 2019
0b0aa5c
Undo github workflow workaround
rhooper Nov 26, 2019
56720ea
remove unnecessary intermediate mp_obj_subscr wrapper
rhooper Nov 26, 2019
a9624ff
add show
rhooper Nov 27, 2019
a4bbf35
Merge branch 'master' into new-pixelbuf-api
rhooper Dec 2, 2019
659dcce
run translate
rhooper Dec 2, 2019
0d267ea
fix compile fails
rhooper Dec 2, 2019
dd7ac68
fix slice anf fill bugs
rhooper Dec 8, 2019
222dd29
Fix slice step.
rhooper Dec 11, 2019
0326c98
Merge branch 'master' into new-pixelbuf-api
rhooper Dec 11, 2019
72ad2e9
Merge branch 'master' into new-pixelbuf-api
rhooper Dec 13, 2019
cc31f2d
update translations
rhooper Dec 13, 2019
15072c6
push changes
rhooper Dec 13, 2019
dc8dd6d
Revert subscr signature change
rhooper Dec 13, 2019
7f7105d
Fix tuple test
tannewt Dec 13, 2019
d8e66a5
try 2. make namedtuple types handle subclasses
tannewt Dec 14, 2019
ef2a890
move call to show outside loop
rhooper Dec 16, 2019
7b1ad3e
Merge pull request #2 from tannewt/pixelbuf_subscr
rhooper Dec 17, 2019
b90c394
Merge branch 'master' into new-pixelbuf-api
rhooper Dec 18, 2019
09d4fe0
Merge branch 'master' into new-pixelbuf-api
rhooper Dec 21, 2019
f1a9039
Merge branch 'master' into pixelbuf-subscr-change
rhooper Dec 29, 2019
023d64f
Merge branch 'pixelbuf-subscr-change' into new-pixelbuf-api
rhooper Dec 29, 2019
64556e0
Merge branch 'master' into new-pixelbuf-api
rhooper Dec 31, 2019
ca5b277
try a property with a callable static class
rhooper Jan 1, 2020
8129a85
Revert "try a property with a callable static class"
rhooper Jan 1, 2020
1219391
move native fill to a helper to work around being unable to call a su…
rhooper Jan 1, 2020
4e19968
Fix docstring for byteorder
rhooper Jan 2, 2020
fdddb54
rename call_show to pixelbuf_call_show
rhooper Jan 2, 2020
ccf158b
raise mp_raise_NotImplementedError
rhooper Jan 2, 2020
767ce1c
remove unnecessary GCC pragmas
rhooper Jan 2, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion extmod/modbtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ STATIC mp_obj_t btree_iternext(mp_obj_t self_in) {
}

STATIC mp_obj_t btree_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) {
mp_obj_btree_t *self = MP_OBJ_TO_PTR(self_in);
mp_obj_btree_t *self = mp_instance_cast_to_native_base(self_in, &btree_type);
if (value == MP_OBJ_NULL) {
// delete
DBT key;
Expand Down
4 changes: 2 additions & 2 deletions extmod/moductypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,8 @@ STATIC void uctypes_struct_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
}
}

STATIC mp_obj_t uctypes_struct_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value) {
mp_obj_uctypes_struct_t *self = MP_OBJ_TO_PTR(self_in);
STATIC mp_obj_t uctypes_struct_subscr(mp_obj_t base_in, mp_obj_t index_in, mp_obj_t value) {
mp_obj_uctypes_struct_t *self = mp_instance_cast_to_native_base(base_in, &uctypes_struct_type);

if (value == MP_OBJ_NULL) {
// delete
Expand Down
37 changes: 15 additions & 22 deletions locale/ID.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-12-12 15:33-0800\n"
"POT-Creation-Date: 2020-01-01 17:29-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -396,11 +396,6 @@ msgstr ""
msgid "Call super().__init__() before accessing native object."
msgstr ""

#: shared-bindings/_pixelbuf/PixelBuf.c
#, c-format
msgid "Can not use dotstar with %s"
msgstr ""

#: ports/nrf/common-hal/_bleio/Characteristic.c
msgid "Can't set CCCD on local Characteristic"
msgstr ""
Expand Down Expand Up @@ -605,6 +600,10 @@ msgstr ""
msgid "Expected a Characteristic"
msgstr ""

#: shared-bindings/_pixelbuf/__init__.c
msgid "Expected a PixelBuf instance"
msgstr ""

#: shared-bindings/_bleio/Characteristic.c
msgid "Expected a Service"
msgstr ""
Expand Down Expand Up @@ -745,6 +744,10 @@ msgstr ""
msgid "Invalid buffer size"
msgstr "Ukuran buffer tidak valid"

#: shared-bindings/_pixelbuf/PixelBuf.c
msgid "Invalid byteorder string"
msgstr ""

#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
msgid "Invalid capture period. Valid range: 1 - 500"
msgstr ""
Expand Down Expand Up @@ -872,6 +875,10 @@ msgstr ""
msgid "Must be a %q subclass."
msgstr ""

#: shared-bindings/_pixelbuf/PixelBuf.c
msgid "Negative step not supported"
msgstr ""

#: ports/nrf/common-hal/_bleio/Characteristic.c
msgid "No CCCD for this Characteristic"
msgstr ""
Expand Down Expand Up @@ -971,10 +978,6 @@ msgid ""
"%d bpp given"
msgstr ""

#: shared-bindings/_pixelbuf/PixelBuf.c
msgid "Only slices with step=1 (aka None) are supported"
msgstr ""

#: shared-bindings/audiobusio/PDMIn.c
msgid "Oversample must be multiple of 8."
msgstr ""
Expand Down Expand Up @@ -1079,7 +1082,6 @@ msgid "Sample rate must be positive"
msgstr ""

#: ports/atmel-samd/common-hal/audioio/AudioOut.c
#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c
#, c-format
msgid "Sample rate too high. It must be less than %d"
msgstr "Nilai sampel terlalu tinggi. Nilai harus kurang dari %d"
Expand Down Expand Up @@ -1462,8 +1464,7 @@ msgid "byte code not implemented"
msgstr ""

#: shared-bindings/_pixelbuf/PixelBuf.c
#, c-format
msgid "byteorder is not an instance of ByteOrder (got a %s)"
msgid "byteorder is not a string"
msgstr ""

#: ports/atmel-samd/common-hal/busio/UART.c
Expand Down Expand Up @@ -2143,7 +2144,7 @@ msgstr "tidak ada modul yang bernama '%q'"
msgid "no reset pin available"
msgstr ""

#: py/runtime.c shared-bindings/_pixelbuf/__init__.c
#: py/runtime.c
msgid "no such attribute"
msgstr ""

Expand Down Expand Up @@ -2325,10 +2326,6 @@ msgstr "antrian meluap (overflow)"
msgid "rawbuf is not the same size as buf"
msgstr ""

#: shared-bindings/_pixelbuf/__init__.c
msgid "readonly attribute"
msgstr ""

#: py/builtinimport.c
msgid "relative import"
msgstr "relative import"
Expand Down Expand Up @@ -2631,10 +2628,6 @@ msgstr ""
msgid "window must be <= interval"
msgstr ""

#: shared-bindings/_pixelbuf/PixelBuf.c
msgid "write_args must be a list, tuple, or None"
msgstr ""

#: py/objstr.c
msgid "wrong number of arguments"
msgstr ""
Expand Down
37 changes: 15 additions & 22 deletions locale/circuitpython.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-12-12 15:33-0800\n"
"POT-Creation-Date: 2020-01-01 17:29-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -391,11 +391,6 @@ msgstr ""
msgid "Call super().__init__() before accessing native object."
msgstr ""

#: shared-bindings/_pixelbuf/PixelBuf.c
#, c-format
msgid "Can not use dotstar with %s"
msgstr ""

#: ports/nrf/common-hal/_bleio/Characteristic.c
msgid "Can't set CCCD on local Characteristic"
msgstr ""
Expand Down Expand Up @@ -594,6 +589,10 @@ msgstr ""
msgid "Expected a Characteristic"
msgstr ""

#: shared-bindings/_pixelbuf/__init__.c
msgid "Expected a PixelBuf instance"
msgstr ""

#: shared-bindings/_bleio/Characteristic.c
msgid "Expected a Service"
msgstr ""
Expand Down Expand Up @@ -734,6 +733,10 @@ msgstr ""
msgid "Invalid buffer size"
msgstr ""

#: shared-bindings/_pixelbuf/PixelBuf.c
msgid "Invalid byteorder string"
msgstr ""

#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
msgid "Invalid capture period. Valid range: 1 - 500"
msgstr ""
Expand Down Expand Up @@ -861,6 +864,10 @@ msgstr ""
msgid "Must be a %q subclass."
msgstr ""

#: shared-bindings/_pixelbuf/PixelBuf.c
msgid "Negative step not supported"
msgstr ""

#: ports/nrf/common-hal/_bleio/Characteristic.c
msgid "No CCCD for this Characteristic"
msgstr ""
Expand Down Expand Up @@ -959,10 +966,6 @@ msgid ""
"%d bpp given"
msgstr ""

#: shared-bindings/_pixelbuf/PixelBuf.c
msgid "Only slices with step=1 (aka None) are supported"
msgstr ""

#: shared-bindings/audiobusio/PDMIn.c
msgid "Oversample must be multiple of 8."
msgstr ""
Expand Down Expand Up @@ -1063,7 +1066,6 @@ msgid "Sample rate must be positive"
msgstr ""

#: ports/atmel-samd/common-hal/audioio/AudioOut.c
#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c
#, c-format
msgid "Sample rate too high. It must be less than %d"
msgstr ""
Expand Down Expand Up @@ -1438,8 +1440,7 @@ msgid "byte code not implemented"
msgstr ""

#: shared-bindings/_pixelbuf/PixelBuf.c
#, c-format
msgid "byteorder is not an instance of ByteOrder (got a %s)"
msgid "byteorder is not a string"
msgstr ""

#: ports/atmel-samd/common-hal/busio/UART.c
Expand Down Expand Up @@ -2119,7 +2120,7 @@ msgstr ""
msgid "no reset pin available"
msgstr ""

#: py/runtime.c shared-bindings/_pixelbuf/__init__.c
#: py/runtime.c
msgid "no such attribute"
msgstr ""

Expand Down Expand Up @@ -2300,10 +2301,6 @@ msgstr ""
msgid "rawbuf is not the same size as buf"
msgstr ""

#: shared-bindings/_pixelbuf/__init__.c
msgid "readonly attribute"
msgstr ""

#: py/builtinimport.c
msgid "relative import"
msgstr ""
Expand Down Expand Up @@ -2605,10 +2602,6 @@ msgstr ""
msgid "window must be <= interval"
msgstr ""

#: shared-bindings/_pixelbuf/PixelBuf.c
msgid "write_args must be a list, tuple, or None"
msgstr ""

#: py/objstr.c
msgid "wrong number of arguments"
msgstr ""
Expand Down
Loading