- May 17, 2016
-
-
Paul Sokolovsky authored
Both read and write operations support variants where either a) a single call is made to the undelying stream implementation and returned buffer length may be less than requested, or b) calls are repeated until requested amount of data is collected, shorter amount is returned only in case of EOF or error. These operations are available from the level of C support functions to be used by other C modules to implementations of Python methods to be used in user-facing objects. The rationale of these changes is to allow to write concise and robust code to work with *blocking* streams of types prone to short reads, like serial interfaces and sockets. Particular object types may select "exact" vs "once" types of methods depending on their needs. E.g., for sockets, revc() and send() methods continue to be "once", while read() and write() thus converted to "exactly" versions. These changes don't affect non-blocking handling, e.g. trying "exact" method on the non-blocking socket will return as much data as available without blocking. No data available is continued to be signaled as None return value to read() and write(). From the point of view of CPython compatibility, this model is a cross between its io.RawIOBase and io.BufferedIOBase abstract classes. For blocking streams, it works as io.BufferedIOBase model (guaranteeing lack of short reads/writes), while for non-blocking - as io.RawIOBase, returning None in case of lack of data (instead of raising expensive exception, as required by io.BufferedIOBase). Such a cross-behavior should be optimal for MicroPython needs.
-
Paul Sokolovsky authored
This allows to enable the options which aren't enabled in the normal unix config (as unix port is no longer an enable-all port).
-
- May 16, 2016
-
-
Paul Sokolovsky authored
modwebrepl truncates password to 9 chars, and that led people to confusion.
-
Damien George authored
To use frozen bytecode make a subdirectory under the unix/ directory (eg frozen/), put .py files there, then run: make FROZEN_MPY_DIR=frozen Be sure to build from scratch. The .py files will then be available for importing.
-
Damien George authored
When an mpy file is frozen it must know the values of certain configuration variables. This patch provides an explicit check in the generated C file that the configuration variables are what they are supposed to be.
-
Paul Sokolovsky authored
That was the intent for the initial user setup, but didn't work before due to lwIP issues. Enable now that they're fixed.
-
Paul Sokolovsky authored
-
Robert HH authored
That one was missing in the module, even if it was available in the vfs object. The change consist of adding the name and preparing the call to the underlying vfs module, similar to what was already implemented e.g. for remove. Rename is useful by itself, or for instance for a safe file replace, consisting of the sequence: write to a temp file delete the original file rename the temp file to the original file's name
-
- May 15, 2016
-
-
Paul Sokolovsky authored
Calling it from lwIP accept callback will lead incorrect functioning and/or packet leaks if Python callback has any networking calls, due to lwIP non-reentrancy. So, instead schedule "poll" callback to do that, which will be called by lwIP when it does not perform networking activities. "Poll" callback is called infrequently though (docs say every 0.5s by default), so for better performance, lwIP needs to be patched to call poll callback soon after accept callback, but when current packet is already processed.
-
- May 14, 2016
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
It allows to "import foo.bar", but not "from foo import bar".
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
- May 13, 2016
-
-
Radomir Dopieralski authored
Since the ``stop`` parameter has been dropped.
-
Damien George authored
For example, the following code now works with a file on the SD card: f = open('test', 'rb') # test must be 1024 bytes or more in size f.seek(511) f.read(513) Also works for writing. Fixes issue #1863.
-
Damien George authored
-
Damien George authored
-
Damien George authored
It now supports \n, \r and \r\n as newline separators. Adds 56 bytes to stmhal and 80 bytes to unix x86-64. Fixes issue #1689.
-
Damien George authored
If custom C code uses the I2C busses then it needs access to these structures for i2c_init().
-
Damien George authored
This allows PYBv3 to use PWM for LED(1) and LED(2).
-
- May 12, 2016
-
-
Paul Sokolovsky authored
Address printed was truncated anyway and in general confusing to outsider. A line which dumps it is still left in the source, commented, for peculiar cases when it may be needed (e.g. when running under debugger).
-
Paul Sokolovsky authored
'=' is pretty natural character for tail, and gives less dense picture where it's easier to see what object types are actually there.
-
Paul Sokolovsky authored
-
Damien George authored
OSError's are now printed like: OSError: [Errno 1] EPERM but only if the string corresponding to the errno is found.
-
Paul Sokolovsky authored
Actual loading of .mpy files isn't tested.
-
Colin Hogben authored
In some compliation enviroments (e.g. mbed online compiler) with strict standards compliance, <math.h> does not define constants such as M_PI. Provide fallback definitions of M_E and M_PI where needed.
-
Damien George authored
If an OSError is raised with an integer argument, and that integer corresponds to an errno, then the string for the errno is used as the argument to the exception, instead of the integer. Only works if the uerrno module is enabled.
-
Damien George authored
-
Damien George authored
-
Damien George authored
-
Damien George authored
-
- May 11, 2016
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
These are typical consumers of large chunks of memory, so it's useful to see at least their number (how much memory isn't clearly shown, as the data for these objects is allocated elsewhere).
-
Damien George authored
-
Damien George authored
Fixes issue #2065.
-
- May 10, 2016
-
-
Damien George authored
The timeval struct can be defined by system C headers.
-
Damien George authored
-
Damien George authored
-