Skip to content

Commit fc5f776

Browse files
authored
Merge pull request #2034 from rhooper/new-pixelbuf-api
Updates to pixelbuf API - Addresses #884
2 parents 32b8203 + 767ce1c commit fc5f776

28 files changed

+472
-683
lines changed

extmod/modbtree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ STATIC mp_obj_t btree_iternext(mp_obj_t self_in) {
247247
}
248248

249249
STATIC mp_obj_t btree_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) {
250-
mp_obj_btree_t *self = MP_OBJ_TO_PTR(self_in);
250+
mp_obj_btree_t *self = mp_instance_cast_to_native_base(self_in, &btree_type);
251251
if (value == MP_OBJ_NULL) {
252252
// delete
253253
DBT key;

extmod/moductypes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,8 @@ STATIC void uctypes_struct_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
518518
}
519519
}
520520

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

524524
if (value == MP_OBJ_NULL) {
525525
// delete

locale/ID.po

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2019-12-12 15:33-0800\n"
11+
"POT-Creation-Date: 2020-01-01 17:29-0500\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -396,11 +396,6 @@ msgstr ""
396396
msgid "Call super().__init__() before accessing native object."
397397
msgstr ""
398398

399-
#: shared-bindings/_pixelbuf/PixelBuf.c
400-
#, c-format
401-
msgid "Can not use dotstar with %s"
402-
msgstr ""
403-
404399
#: ports/nrf/common-hal/_bleio/Characteristic.c
405400
msgid "Can't set CCCD on local Characteristic"
406401
msgstr ""
@@ -605,6 +600,10 @@ msgstr ""
605600
msgid "Expected a Characteristic"
606601
msgstr ""
607602

603+
#: shared-bindings/_pixelbuf/__init__.c
604+
msgid "Expected a PixelBuf instance"
605+
msgstr ""
606+
608607
#: shared-bindings/_bleio/Characteristic.c
609608
msgid "Expected a Service"
610609
msgstr ""
@@ -745,6 +744,10 @@ msgstr ""
745744
msgid "Invalid buffer size"
746745
msgstr "Ukuran buffer tidak valid"
747746

747+
#: shared-bindings/_pixelbuf/PixelBuf.c
748+
msgid "Invalid byteorder string"
749+
msgstr ""
750+
748751
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
749752
msgid "Invalid capture period. Valid range: 1 - 500"
750753
msgstr ""
@@ -872,6 +875,10 @@ msgstr ""
872875
msgid "Must be a %q subclass."
873876
msgstr ""
874877

878+
#: shared-bindings/_pixelbuf/PixelBuf.c
879+
msgid "Negative step not supported"
880+
msgstr ""
881+
875882
#: ports/nrf/common-hal/_bleio/Characteristic.c
876883
msgid "No CCCD for this Characteristic"
877884
msgstr ""
@@ -971,10 +978,6 @@ msgid ""
971978
"%d bpp given"
972979
msgstr ""
973980

974-
#: shared-bindings/_pixelbuf/PixelBuf.c
975-
msgid "Only slices with step=1 (aka None) are supported"
976-
msgstr ""
977-
978981
#: shared-bindings/audiobusio/PDMIn.c
979982
msgid "Oversample must be multiple of 8."
980983
msgstr ""
@@ -1079,7 +1082,6 @@ msgid "Sample rate must be positive"
10791082
msgstr ""
10801083

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

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

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

2146-
#: py/runtime.c shared-bindings/_pixelbuf/__init__.c
2147+
#: py/runtime.c
21472148
msgid "no such attribute"
21482149
msgstr ""
21492150

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

2328-
#: shared-bindings/_pixelbuf/__init__.c
2329-
msgid "readonly attribute"
2330-
msgstr ""
2331-
23322329
#: py/builtinimport.c
23332330
msgid "relative import"
23342331
msgstr "relative import"
@@ -2631,10 +2628,6 @@ msgstr ""
26312628
msgid "window must be <= interval"
26322629
msgstr ""
26332630

2634-
#: shared-bindings/_pixelbuf/PixelBuf.c
2635-
msgid "write_args must be a list, tuple, or None"
2636-
msgstr ""
2637-
26382631
#: py/objstr.c
26392632
msgid "wrong number of arguments"
26402633
msgstr ""

locale/circuitpython.pot

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2019-12-12 15:33-0800\n"
11+
"POT-Creation-Date: 2020-01-01 17:29-0500\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -391,11 +391,6 @@ msgstr ""
391391
msgid "Call super().__init__() before accessing native object."
392392
msgstr ""
393393

394-
#: shared-bindings/_pixelbuf/PixelBuf.c
395-
#, c-format
396-
msgid "Can not use dotstar with %s"
397-
msgstr ""
398-
399394
#: ports/nrf/common-hal/_bleio/Characteristic.c
400395
msgid "Can't set CCCD on local Characteristic"
401396
msgstr ""
@@ -594,6 +589,10 @@ msgstr ""
594589
msgid "Expected a Characteristic"
595590
msgstr ""
596591

592+
#: shared-bindings/_pixelbuf/__init__.c
593+
msgid "Expected a PixelBuf instance"
594+
msgstr ""
595+
597596
#: shared-bindings/_bleio/Characteristic.c
598597
msgid "Expected a Service"
599598
msgstr ""
@@ -734,6 +733,10 @@ msgstr ""
734733
msgid "Invalid buffer size"
735734
msgstr ""
736735

736+
#: shared-bindings/_pixelbuf/PixelBuf.c
737+
msgid "Invalid byteorder string"
738+
msgstr ""
739+
737740
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
738741
msgid "Invalid capture period. Valid range: 1 - 500"
739742
msgstr ""
@@ -861,6 +864,10 @@ msgstr ""
861864
msgid "Must be a %q subclass."
862865
msgstr ""
863866

867+
#: shared-bindings/_pixelbuf/PixelBuf.c
868+
msgid "Negative step not supported"
869+
msgstr ""
870+
864871
#: ports/nrf/common-hal/_bleio/Characteristic.c
865872
msgid "No CCCD for this Characteristic"
866873
msgstr ""
@@ -959,10 +966,6 @@ msgid ""
959966
"%d bpp given"
960967
msgstr ""
961968

962-
#: shared-bindings/_pixelbuf/PixelBuf.c
963-
msgid "Only slices with step=1 (aka None) are supported"
964-
msgstr ""
965-
966969
#: shared-bindings/audiobusio/PDMIn.c
967970
msgid "Oversample must be multiple of 8."
968971
msgstr ""
@@ -1063,7 +1066,6 @@ msgid "Sample rate must be positive"
10631066
msgstr ""
10641067

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

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

14451446
#: ports/atmel-samd/common-hal/busio/UART.c
@@ -2119,7 +2120,7 @@ msgstr ""
21192120
msgid "no reset pin available"
21202121
msgstr ""
21212122

2122-
#: py/runtime.c shared-bindings/_pixelbuf/__init__.c
2123+
#: py/runtime.c
21232124
msgid "no such attribute"
21242125
msgstr ""
21252126

@@ -2300,10 +2301,6 @@ msgstr ""
23002301
msgid "rawbuf is not the same size as buf"
23012302
msgstr ""
23022303

2303-
#: shared-bindings/_pixelbuf/__init__.c
2304-
msgid "readonly attribute"
2305-
msgstr ""
2306-
23072304
#: py/builtinimport.c
23082305
msgid "relative import"
23092306
msgstr ""
@@ -2605,10 +2602,6 @@ msgstr ""
26052602
msgid "window must be <= interval"
26062603
msgstr ""
26072604

2608-
#: shared-bindings/_pixelbuf/PixelBuf.c
2609-
msgid "write_args must be a list, tuple, or None"
2610-
msgstr ""
2611-
26122605
#: py/objstr.c
26132606
msgid "wrong number of arguments"
26142607
msgstr ""

0 commit comments

Comments
 (0)