Skip to content

Commit a3adcf0

Browse files
committed
clarify read-only mac address; reuse translate msgs
1 parent 4e31522 commit a3adcf0

File tree

5 files changed

+12
-15
lines changed

5 files changed

+12
-15
lines changed

locale/circuitpython.pot

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ msgstr ""
124124
msgid "%q is %q"
125125
msgstr ""
126126

127+
#: ports/raspberrypi/common-hal/wifi/Radio.c
128+
#: shared-bindings/microcontroller/Processor.c
129+
msgid "%q is read-only for this board"
130+
msgstr ""
131+
127132
#: py/argcheck.c shared-bindings/usb_hid/Device.c
128133
msgid "%q length must be %d"
129134
msgstr ""
@@ -298,7 +303,7 @@ msgstr ""
298303
msgid "'%s' object doesn't support item deletion"
299304
msgstr ""
300305

301-
#: ports/raspberrypi/common-hal/wifi/Radio.c py/runtime.c
306+
#: py/runtime.c
302307
msgid "'%s' object has no attribute '%q'"
303308
msgstr ""
304309

@@ -1856,18 +1861,14 @@ msgid "Random number generation error"
18561861
msgstr ""
18571862

18581863
#: shared-bindings/memorymonitor/AllocationSize.c
1859-
#: shared-bindings/pulseio/PulseIn.c
1864+
#: shared-bindings/pulseio/PulseIn.c shared-module/displayio/Bitmap.c
18601865
msgid "Read-only"
18611866
msgstr ""
18621867

18631868
#: extmod/vfs_fat.c py/moduerrno.c
18641869
msgid "Read-only filesystem"
18651870
msgstr ""
18661871

1867-
#: shared-module/displayio/Bitmap.c
1868-
msgid "Read-only object"
1869-
msgstr ""
1870-
18711872
#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c
18721873
msgid "Received response was invalid"
18731874
msgstr ""
@@ -3071,10 +3072,6 @@ msgstr ""
30713072
msgid "format requires a dict"
30723073
msgstr ""
30733074

3074-
#: shared-bindings/microcontroller/Processor.c
3075-
msgid "frequency is read-only for this board"
3076-
msgstr ""
3077-
30783075
#: py/objdeque.c
30793076
msgid "full"
30803077
msgstr ""

ports/raspberrypi/common-hal/wifi/Radio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ static inline void nw_put_le32(uint8_t *buf, uint32_t x) {
6464
buf[3] = x >> 24;
6565
}
6666

67-
NORETURN static void ro_attribute(int attr) {
68-
mp_raise_msg_varg(&mp_type_AttributeError, MP_ERROR_TEXT("'%s' object has no attribute '%q'"), "Radio", attr);
67+
NORETURN static void ro_attribute(qstr attr) {
68+
mp_raise_NotImplementedError_varg(translate("%q is read-only for this board"), attr);
6969
}
7070

7171
bool common_hal_wifi_radio_get_enabled(wifi_radio_obj_t *self) {

shared-bindings/microcontroller/Processor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ STATIC mp_obj_t mcu_processor_set_frequency(mp_obj_t self, mp_obj_t freq) {
7272
uint32_t value_of_freq = (uint32_t)mp_arg_validate_int_min(mp_obj_get_int(freq), 0, MP_QSTR_frequency);
7373
common_hal_mcu_processor_set_frequency(self, value_of_freq);
7474
#else
75-
mp_raise_msg(&mp_type_NotImplementedError,translate("frequency is read-only for this board"));
75+
mp_raise_NotImplementedError_varg(translate("%q is read-only for this board"), MP_QSTR_frequency);
7676
#endif
7777
return mp_const_none;
7878
}

shared-module/displayio/Bitmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ uint32_t common_hal_displayio_bitmap_get_pixel(displayio_bitmap_t *self, int16_t
117117

118118
void displayio_bitmap_set_dirty_area(displayio_bitmap_t *self, const displayio_area_t *dirty_area) {
119119
if (self->read_only) {
120-
mp_raise_RuntimeError(translate("Read-only object"));
120+
mp_raise_RuntimeError(translate("Read-only"));
121121
}
122122

123123
displayio_area_t area = *dirty_area;

0 commit comments

Comments
 (0)