Skip to content

Commit f06709c

Browse files
committed
clarify read-only mac address; reuse translate msgs
1 parent 9629a0c commit f06709c

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
@@ -118,6 +118,11 @@ msgstr ""
118118
msgid "%q is %q"
119119
msgstr ""
120120

121+
#: ports/raspberrypi/common-hal/wifi/Radio.c
122+
#: shared-bindings/microcontroller/Processor.c
123+
msgid "%q is read-only for this board"
124+
msgstr ""
125+
121126
#: py/argcheck.c shared-bindings/usb_hid/Device.c
122127
msgid "%q length must be %d"
123128
msgstr ""
@@ -293,7 +298,7 @@ msgstr ""
293298
msgid "'%s' object doesn't support item deletion"
294299
msgstr ""
295300

296-
#: ports/raspberrypi/common-hal/wifi/Radio.c py/runtime.c
301+
#: py/runtime.c
297302
msgid "'%s' object has no attribute '%q'"
298303
msgstr ""
299304

@@ -1832,18 +1837,14 @@ msgid "Random number generation error"
18321837
msgstr ""
18331838

18341839
#: shared-bindings/memorymonitor/AllocationSize.c
1835-
#: shared-bindings/pulseio/PulseIn.c
1840+
#: shared-bindings/pulseio/PulseIn.c shared-module/displayio/Bitmap.c
18361841
msgid "Read-only"
18371842
msgstr ""
18381843

18391844
#: extmod/vfs_fat.c py/moduerrno.c
18401845
msgid "Read-only filesystem"
18411846
msgstr ""
18421847

1843-
#: shared-module/displayio/Bitmap.c
1844-
msgid "Read-only object"
1845-
msgstr ""
1846-
18471848
#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c
18481849
msgid "Received response was invalid"
18491850
msgstr ""
@@ -3047,10 +3048,6 @@ msgstr ""
30473048
msgid "format requires a dict"
30483049
msgstr ""
30493050

3050-
#: shared-bindings/microcontroller/Processor.c
3051-
msgid "frequency is read-only for this board"
3052-
msgstr ""
3053-
30543051
#: py/objdeque.c
30553052
msgid "full"
30563053
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)