10000 Fix duplicated error messages by jonnybergdahl · Pull Request #10336 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content

Fix duplicated error messages #10336

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 3 commits into from
May 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ pseudoxml:
.PHONY: all-source
all-source:

TRANSLATE_CHECK_SUBMODULES=if ! [ -f extmod/ulab/README.md ]; then python tools/ci_fetch_deps.py translate; fi
TRANSLATE_CHECK_SUBMODULES=if ! [ -f extmod/ulab/README.md ]; then $(PYTHON) tools/ci_fetch_deps.py translate; fi
TRANSLATE_COMMAND=find $(TRANSLATE_SOURCES) -type d \( $(TRANSLATE_SOURCES_EXC) \) -prune -o -type f \( -iname "*.c" -o -iname "*.h" \) -print | (LC_ALL=C sort) | xgettext -x locale/synthetic.pot -f- -L C -s --add-location=file --keyword=MP_ERROR_TEXT -o - | sed -e '/"POT-Creation-Date: /d'
locale/circuitpython.pot: all-source
$(TRANSLATE_CHECK_SUBMODULES)
Expand Down
16 changes: 4 additions & 12 deletions locale/circuitpython.pot
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ msgstr ""
msgid "For RGB colorspaces, input bitmap must have 16 bits per pixel"
msgstr ""

#: ports/cxd56/common-hal/camera/Camera.c
#: ports/cxd56/common-hal/camera/Camera.c shared-module/audiocore/WaveFile.c
msgid "Format not supported"
msgstr ""

Expand Down Expand Up @@ -2300,10 +2300,6 @@ msgstr ""
msgid "Unsupported display bus type"
msgstr ""

#: shared-module/audiocore/WaveFile.c
msgid "Unsupported format"
msgstr ""

#: shared-bindings/hashlib/__init__.c
msgid "Unsupported hash algorithm"
msgstr ""
Expand Down Expand Up @@ -2360,8 +2356,10 @@ msgstr ""
msgid "Wi-Fi: "
msgstr ""

#: ports/espressif/common-hal/wifi/Radio.c
#: ports/raspberrypi/common-hal/wifi/Radio.c
msgid "Wifi is not enabled"
#: ports/zephyr-cp/common-hal/wifi/Radio.c
msgid "WiFi is not enabled"
msgstr ""

#: main.c
Expand Down Expand Up @@ -4392,12 +4390,6 @@ msgstr ""
msgid "width must be greater than zero"
msgstr ""

#: ports/espressif/common-hal/wifi/Radio.c
#: ports/raspberrypi/common-hal/wifi/Radio.c
#: ports/zephyr-cp/common-hal/wifi/Radio.c
msgid "wifi is not enabled"
msgstr ""

#: ports/raspberrypi/common-hal/wifi/Monitor.c
msgid "wifi.Monitor not available"
msgstr ""
Expand Down
4 changes: 2 additions & 2 deletions ports/espressif/common-hal/wifi/Radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self, u
mp_raise_RuntimeError(MP_ERROR_TEXT("Already scanning for wifi networks"));
}
if (!common_hal_wifi_radio_get_enabled(self)) {
mp_raise_RuntimeError(MP_ERROR_TEXT("wifi is not enabled"));
mp_raise_RuntimeError(MP_ERROR_TEXT("WiFi is not enabled"));
}
set_mode_station(self, true);

Expand Down Expand Up @@ -319,7 +319,7 @@ mp_obj_t common_hal_wifi_radio_get_stations_ap(wifi_radio_obj_t *self) {

wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t *ssid, size_t ssid_len, uint8_t *password, size_t password_len, uint8_t channel, mp_float_t timeout, uint8_t *bssid, size_t bssid_len) {
if (!common_hal_wifi_radio_get_enabled(self)) {
mp_raise_RuntimeError(MP_ERROR_TEXT("wifi is not enabled"));
mp_raise_RuntimeError(MP_ERROR_TEXT("WiFi is not enabled"));
}
wifi_config_t *config = &self->sta_config;

Expand Down
8 changes: 4 additions & 4 deletions ports/raspberrypi/common-hal/wifi/Radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self, u
mp_raise_RuntimeError(MP_ERROR_TEXT("Already scanning for wifi networks"));
}
if (!common_hal_wifi_radio_get_enabled(self)) {
mp_raise_RuntimeError(MP_ERROR_TEXT("Wifi is not enabled"));
mp_raise_RuntimeError(MP_ERROR_TEXT("WiFi is not enabled"));
}
wifi_scannednetworks_obj_t *scan = mp_obj_malloc(wifi_scannednetworks_obj_t, &wifi_scannednetworks_type);
mp_obj_t args[] = { mp_const_empty_tuple, MP_OBJ_NEW_SMALL_INT(16) };
Expand Down Expand Up @@ -193,7 +193,7 @@ void common_hal_wifi_radio_stop_station(wifi_radio_obj_t *self) {

void common_hal_wifi_radio_start_ap(wifi_radio_obj_t *self, uint8_t *ssid, size_t ssid_len, uint8_t *password, size_t password_len, uint8_t channel, uint32_t authmode, uint8_t max_connections) {
if (!common_hal_wifi_radio_get_enabled(self)) {
mp_raise_RuntimeError(MP_ERROR_TEXT("Wifi is not enabled"));
mp_raise_RuntimeError(MP_ERROR_TEXT("WiFi is not enabled"));
}

/* TODO: If the AP is stopped once it cannot be restarted.
Expand Down Expand Up @@ -243,7 +243,7 @@ bool common_hal_wifi_radio_get_ap_active(wifi_radio_obj_t *self) {

void common_hal_wifi_radio_stop_ap(wifi_radio_obj_t *self) {
if (!common_hal_wifi_radio_get_enabled(self)) {
mp_raise_RuntimeError(MP_ERROR_TEXT("wifi is not enabled"));
mp_raise_RuntimeError(MP_ERROR_TEXT("WiFi is not enabled"));
}

cyw43_arch_disable_ap_mode();
Expand Down Expand Up @@ -321,7 +321,7 @@ static bool connection_unchanged(wifi_radio_obj_t *self, const uint8_t *ssid, si

wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t *ssid, size_t ssid_len, uint8_t *password, size_t password_len, uint8_t channel, mp_float_t timeout, uint8_t *bssid, size_t bssid_len) {
if (!common_hal_wifi_radio_get_enabled(self)) {
mp_raise_RuntimeError(MP_ERROR_TEXT("Wifi is not enabled"));
mp_raise_RuntimeError(MP_ERROR_TEXT("WiFi is not enabled"));
}

if (ssid_len > 32) {
Expand Down
6 changes: 3 additions & 3 deletions ports/zephyr-cp/common-hal/wifi/Radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self, u
mp_raise_RuntimeError(MP_ERROR_TEXT("Already scanning for wifi networks"));
}
if (!common_hal_wifi_radio_get_enabled(self)) {
printk("wifi is not enabled\n");
mp_raise_RuntimeError(MP_ERROR_TEXT("wifi is not enabled"));
printk("WiFi is not enabled\n");
mp_raise_RuntimeError(MP_ERROR_TEXT("WiFi is not enabled"));
}

wifi_scannednetworks_obj_t *scan = mp_obj_malloc(wifi_scannednetworks_obj_t, &wifi_scannednetworks_type);
Expand Down Expand Up @@ -349,7 +349,7 @@ mp_obj_t common_hal_wifi_radio_get_stations_ap(wifi_radio_obj_t *self) {

wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t *ssid, size_t ssid_len, uint8_t *password, size_t password_len, uint8_t channel, mp_float_t timeout, uint8_t *bssid, size_t bssid_len) {
if (!common_hal_wifi_radio_get_enabled(self)) {
mp_raise_RuntimeError(MP_ERROR_TEXT("wifi is not enabled"));
mp_raise_RuntimeError(MP_ERROR_TEXT("WiFi is not enabled"));
}
// wifi_config_t *config = &self->sta_config;

Expand Down
2 changes: 1 addition & 1 deletion shared-module/audiocore/WaveFile.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void common_hal_audioio_wavefile_construct(audioio_wavefile_obj_t *self,
(format.audio_format != 0xfffe ||
format.extended_audio_format != 1 ||
format.valid_bits_per_sample != format.bits_per_sample))) {
mp_raise_ValueError(MP_ERROR_TEXT("Unsupported format"));
mp_raise_ValueError(MP_ERROR_TEXT("Format not supported"));
}
// Get the sample_rate
self->base.sample_rate = format.sample_rate;
Expand Down
Loading
0