From 09e6127435e5afb5c9caa9298d68176679cc51ce Mon Sep 17 00:00:00 2001 From: Nick Moore Date: Thu, 11 Oct 2018 14:12:47 +1100 Subject: update translations? --- locale/circuitpython.pot | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'locale/circuitpython.pot') diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 232ad7c46..c47f57cf3 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-10-03 23:15+0700\n" +"POT-Creation-Date: 2018-10-09 23:01+1100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -151,70 +151,70 @@ msgstr "" msgid "script compilation not supported" msgstr "" -#: main.c:143 +#: main.c:153 msgid " output:\n" msgstr "" -#: main.c:157 main.c:230 +#: main.c:167 main.c:240 msgid "" "Auto-reload is on. Simply save files over USB to run them or enter REPL to " "disable.\n" msgstr "" -#: main.c:159 +#: main.c:169 msgid "Running in safe mode! Auto-reload is off.\n" msgstr "" -#: main.c:161 main.c:232 +#: main.c:171 main.c:242 msgid "Auto-reload is off.\n" msgstr "" -#: main.c:175 +#: main.c:185 msgid "Running in safe mode! Not running saved code.\n" msgstr "" -#: main.c:191 +#: main.c:201 msgid "WARNING: Your code filename has two extensions\n" msgstr "" -#: main.c:239 +#: main.c:249 msgid "You requested starting safe mode by " msgstr "" -#: main.c:242 +#: main.c:252 msgid "To exit, please reset the board without " msgstr "" -#: main.c:249 +#: main.c:259 msgid "" "You are running in safe mode which means something really bad happened.\n" msgstr "" -#: main.c:251 +#: main.c:261 msgid "Looks like our core CircuitPython code crashed hard. Whoops!\n" msgstr "" -#: main.c:252 +#: main.c:262 msgid "Please file an issue here with the contents of your CIRCUITPY drive:\n" msgstr "" -#: main.c:255 +#: main.c:265 msgid "" "The microcontroller's power dipped. Please make sure your power supply " "provides\n" msgstr "" -#: main.c:256 +#: main.c:266 msgid "" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" -#: main.c:260 +#: main.c:270 msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" -#: main.c:416 +#: main.c:426 msgid "soft reboot\n" msgstr "" @@ -702,10 +702,6 @@ msgstr "" msgid "All SPI peripherals are in use" msgstr "" -#: ports/nrf/common-hal/busio/SPI.c:176 -msgid "Baud rate too high for this SPI peripheral" -msgstr "" - #: ports/nrf/common-hal/busio/UART.c:48 #, c-format msgid "error = 0x%08lX" @@ -2153,6 +2149,10 @@ msgstr "" msgid "Stream missing readinto() or write() method." msgstr "" +#: shared-bindings/network/__init__.c:79 shared-bindings/socket/__init__.c:428 +msgid "no available NIC" +msgstr "" + #: shared-bindings/nvm/ByteArray.c:99 msgid "Slice and value different lengths." msgstr "" -- cgit v1.2.3 From a580e870c385c9cdd698f04eb6a6ee34aff2f5ab Mon Sep 17 00:00:00 2001 From: Nick Moore Date: Thu, 11 Oct 2018 16:27:43 +1100 Subject: update locale info --- locale/circuitpython.pot | 2 +- locale/fr.po | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'locale/circuitpython.pot') diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index fb6fa9ba1..be88a16f5 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-10-11 14:17+1100\n" +"POT-Creation-Date: 2018-10-11 16:27+1100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/fr.po b/locale/fr.po index a7b779ddb..d6f572069 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-10-11 14:17+1100\n" +"POT-Creation-Date: 2018-10-11 16:27+1100\n" "PO-Revision-Date: 2018-08-14 11:01+0200\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -2522,10 +2522,10 @@ msgstr "'S' et 'O' ne sont pas des types de format supportés" msgid "too many arguments provided with the given format" msgstr "trop d'arguments fournis avec ce format" -#, fuzzy -#~ msgid "palette must be displayio.Palette" -#~ msgstr "la palette doit être longue de 32 octets" - #, fuzzy #~ msgid "value_size must be power of two" #~ msgstr "'len' doit être un multiple de 4" + +#, fuzzy +#~ msgid "palette must be displayio.Palette" +#~ msgstr "la palette doit être longue de 32 octets" -- cgit v1.2.3 From a4a0cf826b9d39f14317e6021ac2a5c08d575fbd Mon Sep 17 00:00:00 2001 From: Nick Moore Date: Thu, 11 Oct 2018 17:02:29 +1100 Subject: fix doc comments, translations again --- locale/circuitpython.pot | 2 +- locale/fr.po | 10 +++++----- shared-bindings/wiznet/wiznet5k.c | 11 +++++++++-- shared-module/wiznet/wiznet5k.c | 10 ---------- 4 files changed, 15 insertions(+), 18 deletions(-) (limited to 'locale/circuitpython.pot') diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index be88a16f5..6c2a10891 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-10-11 16:27+1100\n" +"POT-Creation-Date: 2018-10-11 17:02+1100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/fr.po b/locale/fr.po index d6f572069..1658d90ce 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-10-11 16:27+1100\n" +"POT-Creation-Date: 2018-10-11 17:02+1100\n" "PO-Revision-Date: 2018-08-14 11:01+0200\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -2522,10 +2522,10 @@ msgstr "'S' et 'O' ne sont pas des types de format supportés" msgid "too many arguments provided with the given format" msgstr "trop d'arguments fournis avec ce format" -#, fuzzy -#~ msgid "value_size must be power of two" -#~ msgstr "'len' doit être un multiple de 4" - #, fuzzy #~ msgid "palette must be displayio.Palette" #~ msgstr "la palette doit être longue de 32 octets" + +#, fuzzy +#~ msgid "value_size must be power of two" +#~ msgstr "'len' doit être un multiple de 4" diff --git a/shared-bindings/wiznet/wiznet5k.c b/shared-bindings/wiznet/wiznet5k.c index b407dc5cb..32f100969 100644 --- a/shared-bindings/wiznet/wiznet5k.c +++ b/shared-bindings/wiznet/wiznet5k.c @@ -45,9 +45,16 @@ #include "shared-module/network/__init__.h" #include "shared-module/wiznet/wiznet5k.h" +//| .. currentmodule:: wiznet +//| +//| :class:`WIZNET5K` -- wrapper for Wiznet 5500 Ethernet interface +//| =============================================================== +//| +//| .. class:: WIZNET5K(spi, cs, rst) +//| +//| Create a new WIZNET5500 interface using the specified pins +//| -/// \classmethod \constructor(spi, pin_cs, pin_rst) -/// Create and return a WIZNET5K object. STATIC mp_obj_t wiznet5k_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) { // check arguments mp_arg_check_num(n_args, n_kw, 3, 3, false); diff --git a/shared-module/wiznet/wiznet5k.c b/shared-module/wiznet/wiznet5k.c index 1ae73a515..5c311bf49 100644 --- a/shared-module/wiznet/wiznet5k.c +++ b/shared-module/wiznet/wiznet5k.c @@ -50,16 +50,6 @@ #include "internet/dns/dns.h" #include "internet/dhcp/dhcp.h" -//| .. currentmodule:: wiznet -//| -//| :class:`WIZNET5K` -- wrapper for Wiznet 5500 Ethernet interface -//| =============================================================== -//| -//| .. class:: WIZNET5K(spi, cs, rst) -//| -//| Create a new WIZNET5500 interface using the specified pins -//| - typedef struct _wiznet5k_obj_t { mp_obj_base_t base; mp_uint_t cris_state; -- cgit v1.2.3 From 5bb12793a0c978fc731e29d0dee00cdf86b8234f Mon Sep 17 00:00:00 2001 From: Nick Moore Date: Thu, 11 Oct 2018 22:19:46 +1100 Subject: update documentation and translations again --- docs/library/usocket.rst | 6 +- locale/circuitpython.pot | 4 +- locale/de_DE.po | 4 +- locale/en_US.po | 4 +- locale/es.po | 4 +- locale/fil.po | 4 +- locale/fr.po | 12 ++-- locale/it_IT.po | 4 +- locale/pt_BR.po | 4 +- shared-bindings/network/__init__.c | 17 ++++-- shared-bindings/socket/__init__.c | 122 +++++++++++++++++++++++++++++++------ shared-bindings/wiznet/__init__.c | 2 +- shared-bindings/wiznet/wiznet5k.c | 17 +++++- 13 files changed, 154 insertions(+), 50 deletions(-) (limited to 'locale/circuitpython.pot') diff --git a/docs/library/usocket.rst b/docs/library/usocket.rst index 2751db6c4..2115085a3 100644 --- a/docs/library/usocket.rst +++ b/docs/library/usocket.rst @@ -138,16 +138,16 @@ Constants Note that you don't need to specify these in a call to `usocket.socket()`, because `SOCK_STREAM` socket type automatically selects `IPPROTO_TCP`, and `SOCK_DGRAM` - `IPPROTO_UDP`. Thus, the only real use of these constants - is as an argument to `setsockopt()`. + is as an argument to `usocket.socket.setsockopt()`. .. data:: usocket.SOL_* - Socket option levels (an argument to `setsockopt()`). The exact + Socket option levels (an argument to `usocket.socket.setsockopt()`). The exact inventory depends on a ``MicroPython port``. .. data:: usocket.SO_* - Socket options (an argument to `setsockopt()`). The exact + Socket options (an argument to `usocket.socket.setsockopt()`). The exact inventory depends on a ``MicroPython port``. Constants specific to WiPy: diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 6c2a10891..8fc817849 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-10-11 17:02+1100\n" +"POT-Creation-Date: 2018-10-11 22:08+1100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2292,7 +2292,7 @@ msgstr "" msgid "RTC calibration is not supported on this board" msgstr "" -#: shared-bindings/socket/__init__.c:428 shared-module/network/__init__.c:64 +#: shared-bindings/socket/__init__.c:516 shared-module/network/__init__.c:64 msgid "no available NIC" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 1672ef178..3f7b22702 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-10-11 14:16+1100\n" +"POT-Creation-Date: 2018-10-11 22:08+1100\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Sebastian Plamauer\n" "Language-Team: \n" @@ -2311,7 +2311,7 @@ msgstr "" msgid "RTC calibration is not supported on this board" msgstr "" -#: shared-bindings/socket/__init__.c:428 shared-module/network/__init__.c:64 +#: shared-bindings/socket/__init__.c:516 shared-module/network/__init__.c:64 msgid "no available NIC" msgstr "" diff --git a/locale/en_US.po b/locale/en_US.po index d26568310..8bc73ad5c 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-10-11 14:16+1100\n" +"POT-Creation-Date: 2018-10-11 22:08+1100\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -2292,7 +2292,7 @@ msgstr "" msgid "RTC calibration is not supported on this board" msgstr "" -#: shared-bindings/socket/__init__.c:428 shared-module/network/__init__.c:64 +#: shared-bindings/socket/__init__.c:516 shared-module/network/__init__.c:64 msgid "no available NIC" msgstr "" diff --git a/locale/es.po b/locale/es.po index df8803425..ee97a192c 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-10-11 14:16+1100\n" +"POT-Creation-Date: 2018-10-11 22:08+1100\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -2340,7 +2340,7 @@ msgstr "" msgid "RTC calibration is not supported on this board" msgstr "" -#: shared-bindings/socket/__init__.c:428 shared-module/network/__init__.c:64 +#: shared-bindings/socket/__init__.c:516 shared-module/network/__init__.c:64 msgid "no available NIC" msgstr "" diff --git a/locale/fil.po b/locale/fil.po index 6fe9adfe6..e432da717 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-10-11 14:16+1100\n" +"POT-Creation-Date: 2018-10-11 22:08+1100\n" "PO-Revision-Date: 2018-08-30 23:04-0700\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -2358,7 +2358,7 @@ msgstr "Hindi supportado ang RTC sa board na ito" msgid "RTC calibration is not supported on this board" msgstr "RTC calibration ay hindi supportado ng board na ito" -#: shared-bindings/socket/__init__.c:428 shared-module/network/__init__.c:64 +#: shared-bindings/socket/__init__.c:516 shared-module/network/__init__.c:64 msgid "no available NIC" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 1658d90ce..51d999a2c 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-10-11 17:02+1100\n" +"POT-Creation-Date: 2018-10-11 22:08+1100\n" "PO-Revision-Date: 2018-08-14 11:01+0200\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -2354,7 +2354,7 @@ msgstr "RTC non supportée sur cette carte" msgid "RTC calibration is not supported on this board" msgstr "calibration de la RTC non supportée sur cette carte" -#: shared-bindings/socket/__init__.c:428 shared-module/network/__init__.c:64 +#: shared-bindings/socket/__init__.c:516 shared-module/network/__init__.c:64 #, fuzzy msgid "no available NIC" msgstr "busio.UART n'est pas disponible" @@ -2522,10 +2522,10 @@ msgstr "'S' et 'O' ne sont pas des types de format supportés" msgid "too many arguments provided with the given format" msgstr "trop d'arguments fournis avec ce format" -#, fuzzy -#~ msgid "palette must be displayio.Palette" -#~ msgstr "la palette doit être longue de 32 octets" - #, fuzzy #~ msgid "value_size must be power of two" #~ msgstr "'len' doit être un multiple de 4" + +#, fuzzy +#~ msgid "palette must be displayio.Palette" +#~ msgstr "la palette doit être longue de 32 octets" diff --git a/locale/it_IT.po b/locale/it_IT.po index 907e9f8d1..b093a949a 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-10-11 14:15+1100\n" +"POT-Creation-Date: 2018-10-11 22:08+1100\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -2344,7 +2344,7 @@ msgstr "RTC non supportato su questa scheda" msgid "RTC calibration is not supported on this board" msgstr "calibrazione RTC non supportata su questa scheda" -#: shared-bindings/socket/__init__.c:428 shared-module/network/__init__.c:64 +#: shared-bindings/socket/__init__.c:516 shared-module/network/__init__.c:64 #, fuzzy msgid "no available NIC" msgstr "busio.UART non ancora implementato" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index e499821e1..c54983951 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-10-11 14:17+1100\n" +"POT-Creation-Date: 2018-10-11 22:08+1100\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -2299,7 +2299,7 @@ msgstr "O RTC não é suportado nesta placa" msgid "RTC calibration is not supported on this board" msgstr "A calibração RTC não é suportada nesta placa" -#: shared-bindings/socket/__init__.c:428 shared-module/network/__init__.c:64 +#: shared-bindings/socket/__init__.c:516 shared-module/network/__init__.c:64 msgid "no available NIC" msgstr "" diff --git a/shared-bindings/network/__init__.c b/shared-bindings/network/__init__.c index c5639b462..69f8bea60 100644 --- a/shared-bindings/network/__init__.c +++ b/shared-bindings/network/__init__.c @@ -36,18 +36,23 @@ #include "shared-bindings/network/__init__.h" +#if MICROPY_PY_NETWORK + //| :mod:`network` --- Network Interface Management //| =============================================== //| //| .. module:: network //| :synopsis: Network Interface Management //| :platform: SAMD - -#if MICROPY_PY_NETWORK - -/// \module network - network configuration -/// -/// This module provides a registry of configured NICs. +//| +//| This module provides a registry of configured NICs. +//| It is used by the 'socket' module to look up a suitable +//| NIC when a socket is created. +//| +//| .. function:: route +//| +//| Returns a list of all configured NICs. +//| STATIC mp_obj_t network_route(void) { return MP_OBJ_FROM_PTR(&MP_STATE_PORT(mod_network_nic_list)); diff --git a/shared-bindings/socket/__init__.c b/shared-bindings/socket/__init__.c index f6949b4bf..d860c40c8 100644 --- a/shared-bindings/socket/__init__.c +++ b/shared-bindings/socket/__init__.c @@ -44,11 +44,22 @@ //| :synopsis: TCP, UDP and RAW sockets //| :platform: SAMD21, SAMD51 //| -//| XXX TODO Write Docs. +//| Create TCP, UDP and RAW sockets for communicating over the Internet. +//| STATIC const mp_obj_type_t socket_type; -// constructor socket(family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None) +//| .. currentmodule:: socket +//| +//| .. class:: socket(family, type, proto, ...) +//| +//| Create a new socket +//| +//| :param ~int family: AF_INET or AF_INET6 +//| :param ~int type: SOCK_STREAM, SOCK_DGRAM or SOCK_RAW +//| :param ~int proto: IPPROTO_TCP, IPPROTO_UDP or IPPROTO_RAW (ignored) +//| + STATIC mp_obj_t socket_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 0, 4, false); @@ -87,7 +98,13 @@ STATIC void socket_select_nic(mod_network_socket_obj_t *self, const byte *ip) { } } -// method socket.bind(address) +//| .. method:: bind(address) +//| +//| Bind a socket to an address +//| +//| :param ~tuple address: tuple of (remote_address, remote_port) +//| + STATIC mp_obj_t socket_bind(mp_obj_t self_in, mp_obj_t addr_in) { mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -108,7 +125,13 @@ STATIC mp_obj_t socket_bind(mp_obj_t self_in, mp_obj_t addr_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_bind_obj, socket_bind); -// method socket.listen(backlog) +//| .. method:: listen(backlog) +//| +//| Set socket to listen for incoming connections +//| +//| :param ~int backlog: length of backlog queue for waiting connetions +//| + STATIC mp_obj_t socket_listen(mp_obj_t self_in, mp_obj_t backlog) { mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -127,7 +150,13 @@ STATIC mp_obj_t socket_listen(mp_obj_t self_in, mp_obj_t backlog) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_listen_obj, socket_listen); -// method socket.accept() +//| .. method:: accept() +//| +//| Accept a connection on a listening socket of type SOCK_STREAM, +//| creating a new socket of type SOCK_STREAM. +//| Returns a tuple of (new_socket, remote_address) +//| + STATIC mp_obj_t socket_accept(mp_obj_t self_in) { mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -159,7 +188,13 @@ STATIC mp_obj_t socket_accept(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(socket_accept_obj, socket_accept); -// method socket.connect(address) +//| .. method:: connect(address) +//| +//| Connect a socket to a remote address +//| +//| :param ~tuple address: tuple of (remote_address, remote_port) +//| + STATIC mp_obj_t socket_connect(mp_obj_t self_in, mp_obj_t addr_in) { mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -180,7 +215,14 @@ STATIC mp_obj_t socket_connect(mp_obj_t self_in, mp_obj_t addr_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_connect_obj, socket_connect); -// method socket.send(bytes) +//| .. method:: send(bytes) +//| +//| Send some bytes to the connected remote address. +//| Suits sockets of type SOCK_STREAM +//| +//| :param ~bytes bytes: some bytes to send +//| + STATIC mp_obj_t socket_send(mp_obj_t self_in, mp_obj_t buf_in) { mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); if (self->nic == MP_OBJ_NULL) { @@ -198,7 +240,14 @@ STATIC mp_obj_t socket_send(mp_obj_t self_in, mp_obj_t buf_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_send_obj, socket_send); -// method socket.recv(bufsize) +//| .. method:: recv(bufsize) +//| +//| Reads some bytes from the connected remote address. +//| Suits sockets of type SOCK_STREAM +//| Returns a bytes() of length <= bufsize +//| +//| :param ~int bufsize: maximum number of bytes to receive + STATIC mp_obj_t socket_recv(mp_obj_t self_in, mp_obj_t len_in) { mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); if (self->nic == MP_OBJ_NULL) { @@ -221,7 +270,15 @@ STATIC mp_obj_t socket_recv(mp_obj_t self_in, mp_obj_t len_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_recv_obj, socket_recv); -// method socket.sendto(bytes, address) +//| .. method:: sendto(bytes, address) +//| +//| Send some bytes to a specific address. +//| Suits sockets of type SOCK_DGRAM +//| +//| :param ~bytes bytes: some bytes to send +//| :param ~tuple address: tuple of (remote_address, remote_port) +//| + STATIC mp_obj_t socket_sendto(mp_obj_t self_in, mp_obj_t data_in, mp_obj_t addr_in) { mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -247,7 +304,18 @@ STATIC mp_obj_t socket_sendto(mp_obj_t self_in, mp_obj_t data_in, mp_obj_t addr_ } STATIC MP_DEFINE_CONST_FUN_OBJ_3(socket_sendto_obj, socket_sendto); -// method socket.recvfrom(bufsize) +//| .. method:: recvfrom(bufsize) +//| +//| Reads some bytes from the connected remote address. +//| Suits sockets of type SOCK_STREAM +//| +//| Returns a tuple containing +//| * a bytes() of length <= bufsize +//| * a remote_address, which is a tuple of ip address and port number +//| +//| :param ~int bufsize: maximum number of bytes to receive +//| + STATIC mp_obj_t socket_recvfrom(mp_obj_t self_in, mp_obj_t len_in) { mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); if (self->nic == MP_OBJ_NULL) { @@ -275,7 +343,11 @@ STATIC mp_obj_t socket_recvfrom(mp_obj_t self_in, mp_obj_t len_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_recvfrom_obj, socket_recvfrom); -// method socket.setsockopt(level, optname, value) +//| .. method:: setsockopt(level, optname, value) +//| +//| Sets socket options +//| + STATIC mp_obj_t socket_setsockopt(size_t n_args, const mp_obj_t *args) { mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(args[0]); @@ -305,10 +377,13 @@ STATIC mp_obj_t socket_setsockopt(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socket_setsockopt_obj, 4, 4, socket_setsockopt); -// method socket.settimeout(value) -// timeout=0 means non-blocking -// timeout=None means blocking -// otherwise, timeout is in seconds +//| .. method:: settimeout(value) +//| +//| Set the timeout value for this socket. +//| +//| :param ~int value: timeout in seconds. 0 means non-blocking. None means block indefinitely. +//| + STATIC mp_obj_t socket_settimeout(mp_obj_t self_in, mp_obj_t timeout_in) { mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); if (self->nic == MP_OBJ_NULL) { @@ -333,6 +408,13 @@ STATIC mp_obj_t socket_settimeout(mp_obj_t self_in, mp_obj_t timeout_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_settimeout_obj, socket_settimeout); +//| .. method:: setblocking(flag) +//| +//| Set the blocking behaviour of this socket. +//| +//| :param ~bool flag: False means non-blocking, True means block indefinitely. +//| + // method socket.setblocking(flag) STATIC mp_obj_t socket_setblocking(mp_obj_t self_in, mp_obj_t blocking) { if (mp_obj_is_true(blocking)) { @@ -386,8 +468,14 @@ STATIC const mp_obj_type_t socket_type = { .locals_dict = (mp_obj_dict_t*)&socket_locals_dict, }; -/******************************************************************************/ -// usocket module +//| .. function:: getaddrinfo(host, port) +//| +//| Gets the address information for a hostname and port +//| +//| Returns the appropriate family, socket type, socket protocol and +//| address information to call socket.socket() and socket.connect() with, +//| as a tuple. +//| STATIC mp_obj_t socket_getaddrinfo(mp_obj_t host_in, mp_obj_t port_in) { size_t hlen; diff --git a/shared-bindings/wiznet/__init__.c b/shared-bindings/wiznet/__init__.c index 342cb1052..e230deecc 100644 --- a/shared-bindings/wiznet/__init__.c +++ b/shared-bindings/wiznet/__init__.c @@ -42,7 +42,7 @@ //| :synopsis: Support for WizNet hardware //| :platform: SAMD //| -//| Doc content goes here +//| Support for WizNet hardware, including the WizNet 5500 Ethernet adaptor. //| //| Libraries //| diff --git a/shared-bindings/wiznet/wiznet5k.c b/shared-bindings/wiznet/wiznet5k.c index 32f100969..1dba5f380 100644 --- a/shared-bindings/wiznet/wiznet5k.c +++ b/shared-bindings/wiznet/wiznet5k.c @@ -53,6 +53,10 @@ //| .. class:: WIZNET5K(spi, cs, rst) //| //| Create a new WIZNET5500 interface using the specified pins +//| +//| :param spi: spi bus to use +//| :param cs: pin to use for Chip Select +//| :param rst: pin to sue for Reset //| STATIC mp_obj_t wiznet5k_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) { @@ -68,9 +72,10 @@ STATIC mp_obj_t wiznet5k_connected_get_value(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(wiznet5k_connected_get_value_obj, wiznet5k_connected_get_value); -//| attribute:: connected +//| .. attribute:: connected //| //| is this device physically connected? +//| const mp_obj_property_t wiznet5k_connected_obj = { .base.type = &mp_type_property, @@ -79,8 +84,14 @@ const mp_obj_property_t wiznet5k_connected_obj = { (mp_obj_t)&mp_const_none_obj}, }; -/// \method ifconfig([(ip, subnet, gateway, dns)]) -/// Get/set IP address, subnet mask, gateway and DNS. +//| .. method:: ifconfig(...) +//| +//| Called without parameters, returns a tuple of +//| (ip_address, subnet_mask, gateway_address, dns_server) +//| +//| Or can be called with the same tuple to set those parameters. +//| + STATIC mp_obj_t wiznet5k_ifconfig(size_t n_args, const mp_obj_t *args) { wiz_NetInfo netinfo; ctlnetwork(CN_GET_NETINFO, &netinfo); -- cgit v1.2.3 From c9279e8d3a4ee2a397cc1c5c9bf5bbc30a4c5216 Mon Sep 17 00:00:00 2001 From: Nick Moore Date: Thu, 25 Oct 2018 12:54:39 +1100 Subject: Update translations --- locale/circuitpython.pot | 2 +- locale/fr.po | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'locale/circuitpython.pot') diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index a75f2169b..b389ec24a 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-10-25 12:20+1100\n" +"POT-Creation-Date: 2018-10-25 12:53+1100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/fr.po b/locale/fr.po index 95aeef5e2..580b4809c 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-10-25 12:20+1100\n" +"POT-Creation-Date: 2018-10-25 12:53+1100\n" "PO-Revision-Date: 2018-08-14 11:01+0200\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -2523,10 +2523,10 @@ msgstr "'S' et 'O' ne sont pas des types de format supportés" msgid "too many arguments provided with the given format" msgstr "trop d'arguments fournis avec ce format" -#, fuzzy -#~ msgid "palette must be displayio.Palette" -#~ msgstr "la palette doit être longue de 32 octets" - #, fuzzy #~ msgid "value_size must be power of two" #~ msgstr "'len' doit être un multiple de 4" + +#, fuzzy +#~ msgid "palette must be displayio.Palette" +#~ msgstr "la palette doit être longue de 32 octets" -- cgit v1.2.3