Skip to content

Fix output overflow and make help translatable #1325

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 2 commits into from
Nov 10, 2018
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
16 changes: 13 additions & 3 deletions lib/utils/stdout_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,21 @@
// Send "cooked" string of given length, where every occurrence of
// LF character is replaced with CR LF.
void mp_hal_stdout_tx_strn_cooked(const char *str, size_t len) {
while (len--) {
if (*str == '\n') {
bool last_cr = false;
while (len > 0) {
size_t i = 0;
if (str[0] == '\n' && !last_cr) {
mp_hal_stdout_tx_strn("\r", 1);
i = 1;
}
mp_hal_stdout_tx_strn(str++, 1);
// Lump all characters on the next line together.
while((last_cr || str[i] != '\n') && i < len) {
last_cr = str[i] == '\r';
i++;
}
mp_hal_stdout_tx_strn(str, i);
str = &str[i];
len -= i;
}
}

Expand Down
101 changes: 56 additions & 45 deletions locale/circuitpython.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-11-07 14:10-0500\n"
"POT-Creation-Date: 2018-11-09 16:20-0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -151,70 +151,70 @@ msgstr ""
msgid "script compilation not supported"
msgstr ""

#: main.c:153
#: main.c:154
msgid " output:\n"
msgstr ""

#: main.c:167 main.c:240
#: main.c:168 main.c:241
msgid ""
"Auto-reload is on. Simply save files over USB to run them or enter REPL to "
"disable.\n"
msgstr ""

#: main.c:169
#: main.c:170
msgid "Running in safe mode! Auto-reload is off.\n"
msgstr ""

#: main.c:171 main.c:242
#: main.c:172 main.c:243
msgid "Auto-reload is off.\n"
msgstr ""

#: main.c:185
#: main.c:186
msgid "Running in safe mode! Not running saved code.\n"
msgstr ""

#: main.c:201
#: main.c:202
msgid "WARNING: Your code filename has two extensions\n"
msgstr ""

#: main.c:249
#: main.c:250
msgid "You requested starting safe mode by "
msgstr ""

#: main.c:252
#: main.c:253
msgid "To exit, please reset the board without "
msgstr ""

#: main.c:259
#: main.c:260
msgid ""
"You are running in safe mode which means something really bad happened.\n"
msgstr ""

#: main.c:261
#: main.c:262
msgid "Looks like our core CircuitPython code crashed hard. Whoops!\n"
msgstr ""

#: main.c:262
#: main.c:263
msgid "Please file an issue here with the contents of your CIRCUITPY drive:\n"
msgstr ""

#: main.c:265
#: main.c:266
msgid ""
"The microcontroller's power dipped. Please make sure your power supply "
"provides\n"
msgstr ""

#: main.c:266
#: main.c:267
msgid ""
"enough power for the whole circuit and press reset (after ejecting "
"CIRCUITPY).\n"
msgstr ""

#: main.c:270
#: main.c:271
msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr ""

#: main.c:426
#: main.c:429
msgid "soft reboot\n"
msgstr ""

Expand Down Expand Up @@ -359,7 +359,7 @@ msgid "Not enough pins available"
msgstr ""

#: ports/atmel-samd/common-hal/busio/I2C.c:78
#: ports/atmel-samd/common-hal/busio/SPI.c:132
#: ports/atmel-samd/common-hal/busio/SPI.c:171
#: ports/atmel-samd/common-hal/busio/UART.c:119
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c:45
#: ports/nrf/common-hal/busio/I2C.c:82
Expand Down Expand Up @@ -403,7 +403,7 @@ msgid "No TX pin"
msgstr ""

#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c:170
#: ports/nrf/common-hal/digitalio/DigitalInOut.c:142
#: ports/nrf/common-hal/digitalio/DigitalInOut.c:147
msgid "Cannot get pull while in output mode"
msgstr ""

Expand Down Expand Up @@ -463,30 +463,10 @@ msgstr ""
msgid "calibration value out of range +/-127"
msgstr ""

#: ports/atmel-samd/common-hal/storage/__init__.c:48
msgid "Cannot remount '/' when USB is active."
msgstr ""

#: ports/atmel-samd/common-hal/touchio/TouchIn.c:75
msgid "No free GCLKs"
msgstr ""

#: ports/atmel-samd/common-hal/usb_hid/Device.c:78
#: ports/nrf/common-hal/usb_hid/Device.c:45
#, c-format
msgid "Buffer incorrect size. Should be %d bytes."
msgstr ""

#: ports/atmel-samd/common-hal/usb_hid/Device.c:82
#: ports/nrf/common-hal/usb_hid/Device.c:53
msgid "USB Busy"
msgstr ""

#: ports/atmel-samd/common-hal/usb_hid/Device.c:82
#: ports/nrf/common-hal/usb_hid/Device.c:59
msgid "USB Error"
msgstr ""

#: ports/esp8266/common-hal/analogio/AnalogIn.c:43
msgid "Pin %q does not have ADC capabilities"
msgstr ""
Expand Down Expand Up @@ -823,7 +803,7 @@ msgstr ""
msgid "All I2C peripherals are in use"
msgstr ""

#: ports/nrf/common-hal/busio/SPI.c:115
#: ports/nrf/common-hal/busio/SPI.c:133
msgid "All SPI peripherals are in use"
msgstr ""

Expand Down Expand Up @@ -958,6 +938,20 @@ msgstr ""
msgid "bad compile mode"
msgstr ""

#: py/builtinhelp.c:137
msgid "Plus any modules on the filesystem\n"
msgstr ""

#: py/builtinhelp.c:183
#, c-format
msgid ""
"Welcome to Adafruit CircuitPython %s!\n"
"\n"
"Please visit learn.adafruit.com/category/circuitpython for project guides.\n"
"\n"
"To list built-in modules please do `help(\"modules\")`.\n"
msgstr ""

#: py/builtinimport.c:336
msgid "cannot perform relative import"
msgstr ""
Expand Down Expand Up @@ -2440,27 +2434,27 @@ msgstr ""
msgid "Clock stretch too long"
msgstr ""

#: shared-module/bitbangio/SPI.c:45
#: shared-module/bitbangio/SPI.c:44
msgid "Clock pin init failed."
msgstr ""

#: shared-module/bitbangio/SPI.c:51
#: shared-module/bitbangio/SPI.c:50
msgid "MOSI pin init failed."
msgstr ""

#: shared-module/bitbangio/SPI.c:62
#: shared-module/bitbangio/SPI.c:61
msgid "MISO pin init failed."
msgstr ""

#: shared-module/bitbangio/SPI.c:122
#: shared-module/bitbangio/SPI.c:121
msgid "Cannot write without MOSI pin."
msgstr ""

#: shared-module/bitbangio/SPI.c:177
#: shared-module/bitbangio/SPI.c:176
msgid "Cannot read without MISO pin."
msgstr ""

#: shared-module/bitbangio/SPI.c:241
#: shared-module/bitbangio/SPI.c:240
msgid "Cannot transfer without MOSI and MISO pins."
msgstr ""

Expand Down Expand Up @@ -2494,10 +2488,27 @@ msgstr ""
msgid "Only true color (24 bpp or higher) BMP supported %x"
msgstr ""

#: shared-module/storage/__init__.c:155
msgid "Cannot remount '/' when USB is active."
msgstr ""

#: shared-module/struct/__init__.c:39
msgid "'S' and 'O' are not supported format types"
msgstr ""

#: shared-module/struct/__init__.c:83
msgid "too many arguments provided with the given format"
msgstr ""

#: shared-module/usb_hid/Device.c:45
#, c-format
msgid "Buffer incorrect size. Should be %d bytes."
msgstr ""

#: shared-module/usb_hid/Device.c:53
msgid "USB Busy"
msgstr ""

#: shared-module/usb_hid/Device.c:59
msgid "USB Error"
msgstr ""
Loading