clarify read-only mac address; reuse translate msgs

This commit is contained in:
Dan Halbert 2022-12-19 10:44:06 -05:00
parent 4e31522d08
commit a3adcf0e1a
5 changed files with 12 additions and 15 deletions

View File

@ -124,6 +124,11 @@ msgstr ""
msgid "%q is %q"
msgstr ""
#: ports/raspberrypi/common-hal/wifi/Radio.c
#: shared-bindings/microcontroller/Processor.c
msgid "%q is read-only for this board"
msgstr ""
#: py/argcheck.c shared-bindings/usb_hid/Device.c
msgid "%q length must be %d"
msgstr ""
@ -298,7 +303,7 @@ msgstr ""
msgid "'%s' object doesn't support item deletion"
msgstr ""
#: ports/raspberrypi/common-hal/wifi/Radio.c py/runtime.c
#: py/runtime.c
msgid "'%s' object has no attribute '%q'"
msgstr ""
@ -1856,7 +1861,7 @@ msgid "Random number generation error"
msgstr ""
#: shared-bindings/memorymonitor/AllocationSize.c
#: shared-bindings/pulseio/PulseIn.c
#: shared-bindings/pulseio/PulseIn.c shared-module/displayio/Bitmap.c
msgid "Read-only"
msgstr ""
@ -1864,10 +1869,6 @@ msgstr ""
msgid "Read-only filesystem"
msgstr ""
#: shared-module/displayio/Bitmap.c
msgid "Read-only object"
msgstr ""
#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c
msgid "Received response was invalid"
msgstr ""
@ -3071,10 +3072,6 @@ msgstr ""
msgid "format requires a dict"
msgstr ""
#: shared-bindings/microcontroller/Processor.c
msgid "frequency is read-only for this board"
msgstr ""
#: py/objdeque.c
msgid "full"
msgstr ""

@ -1 +1 @@
Subproject commit 4ff7f348d0713ea8eca022f73a059b0fe0934531
Subproject commit 54c3f61c864c3d3ffd779042454554045b9dd9d2

View File

@ -64,8 +64,8 @@ static inline void nw_put_le32(uint8_t *buf, uint32_t x) {
buf[3] = x >> 24;
}
NORETURN static void ro_attribute(int attr) {
mp_raise_msg_varg(&mp_type_AttributeError, MP_ERROR_TEXT("'%s' object has no attribute '%q'"), "Radio", attr);
NORETURN static void ro_attribute(qstr attr) {
mp_raise_NotImplementedError_varg(translate("%q is read-only for this board"), attr);
}
bool common_hal_wifi_radio_get_enabled(wifi_radio_obj_t *self) {

View File

@ -72,7 +72,7 @@ STATIC mp_obj_t mcu_processor_set_frequency(mp_obj_t self, mp_obj_t freq) {
uint32_t value_of_freq = (uint32_t)mp_arg_validate_int_min(mp_obj_get_int(freq), 0, MP_QSTR_frequency);
common_hal_mcu_processor_set_frequency(self, value_of_freq);
#else
mp_raise_msg(&mp_type_NotImplementedError,translate("frequency is read-only for this board"));
mp_raise_NotImplementedError_varg(translate("%q is read-only for this board"), MP_QSTR_frequency);
#endif
return mp_const_none;
}

View File

@ -117,7 +117,7 @@ uint32_t common_hal_displayio_bitmap_get_pixel(displayio_bitmap_t *self, int16_t
void displayio_bitmap_set_dirty_area(displayio_bitmap_t *self, const displayio_area_t *dirty_area) {
if (self->read_only) {
mp_raise_RuntimeError(translate("Read-only object"));
mp_raise_RuntimeError(translate("Read-only"));
}
displayio_area_t area = *dirty_area;