summaryrefslogtreecommitdiffstatshomepage
path: root/unix
Commit message (Collapse)AuthorAge
* unix: Add O_WRONLY | O_CREAT to open call when opening file for append ("a").Ari Suutari2015-06-21
| | | | To comply with Python semantics.
* py: Use a wrapper to explicitly check self argument of builtin methods.Damien George2015-06-20
| | | | | | | | | | | | | | | Previous to this patch a call such as list.append(1, 2) would lead to a seg fault. This is because list.append is a builtin method and the first argument to such methods is always assumed to have the correct type. Now, when a builtin method is extracted like this it is wrapped in a checker object which checks the the type of the first argument before calling the builtin function. This feature is contrelled by MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG and is enabled by default. See issue #1216.
* unix: Allow to cat a script into stdin from the command line.Damien George2015-06-04
| | | | See issue #1306.
* unix: Update .gitignore; now ignores coverage build.Damien George2015-06-03
|
* unix: Prepare upip frozen modules under build/.Paul Sokolovsky2015-06-03
|
* unix: Uncompress upip tarball to build directory.Paul Sokolovsky2015-06-03
|
* unix: Include upip as fronzen modules inside the standard interpreter.Paul Sokolovsky2015-06-02
| | | | | | | | | MicroPython doesn't come with standard library included, so it is important to be able to easily install needed package in a seamless manner. Bundling package manager (upip) inside an executable solves this issue. upip is bundled only with standard executable, not "minimal" or "fast" builds.
* unix: Print an extra newline to the output on ctrl-Dstijn2015-05-30
| | | | | This assures the terminal prints it's prompt on a fresh line instead of appending it to the uPy prompt after exit.
* unix: minimal: Don't use readline support.Paul Sokolovsky2015-05-30
| | | | | After switching to builtin readline support, "minimal" no longer builds, and minimal doesn't really need readline support.
* unix: Allow to override default sys.path value.Paul Sokolovsky2015-05-30
| | | | | | | Using MICROPY_PY_SYS_PATH_DEFAULT macro define. A usecase is building a distribution package, which should not have user home path by default in sys.path. In such case, MICROPY_PY_SYS_PATH_DEFAULT can be defined on make command-line (using CFLAGS_EXTRA).
* tests: Add special tests to test mp_printf function to improve coverage.Damien George2015-05-28
|
* unix: Add option to use uPy readline, and enable by default.Damien George2015-05-27
| | | | | | This gets uPy readline working with unix port, with tab completion and history. GNU readline is still supported, configure using MICROPY_USE_READLINE variable.
* unix: Factor out stdio and ctrl-C code to unix_mphal.c file.Damien George2015-05-27
|
* Revert "unix: Include stdio.h to allow easy debugging with printf()."Paul Sokolovsky2015-05-17
| | | | | This reverts commit 8fbabab1a80efa8b9c0654f63b2157d8f8299955. Turned to cause problems on MacOSX.
* unix: Add some extra coverage tests for vstr and attrtuple.Damien George2015-05-12
|
* unix: Include stdio.h to allow easy debugging with printf().Paul Sokolovsky2015-05-10
|
* unix: Print unhandled exception to stderr, like CPython does.Paul Sokolovsky2015-05-10
|
* unix: Fix thumb2 vs arm native emitter auto-detection.Paul Sokolovsky2015-05-08
| | | | Make thumb2 have priority over arm.
* unix: Make extra-coverage function callable from Python scripts.Damien George2015-05-08
| | | | | This allows the output of the extra-coverage tests to be checked using the normal run-tests script.
* unix: Add special function to improve coverage.Damien George2015-05-08
| | | | | | The function and corresponding command-line option are only enabled for the coverage build. They are used to exercise uPy features that can't be properly tested by Python scripts.
* modbuiltins: Add NotImplemented builtin constant.Paul Sokolovsky2015-05-04
| | | | | | | | | | | | From https://docs.python.org/3/library/constants.html#NotImplemented : "Special value which should be returned by the binary special methods (e.g. __eq__(), __lt__(), __add__(), __rsub__(), etc.) to indicate that the operation is not implemented with respect to the other type; may be returned by the in-place binary special methods (e.g. __imul__(), __iand__(), etc.) for the same purpose. Its truth value is true." Some people however appear to abuse it to mean "no value" when None is a legitimate value (don't do that).
* modmachine: Add new module to access hardware, starting with physical memory.Paul Sokolovsky2015-05-04
| | | | | Refactored from "stm" module, provides mem8, mem16, mem32 objects with array subscript syntax.
* unix/modffi.c: get_buffer is allowed to return NULL if len=0.Damien George2015-05-01
| | | | | This is consistent with the logic in mp_get_buffer, and the code here is an inlined version of that function.
* py: Replace py-version.sh with makeversionhdr.py, written in Python.Damien George2015-04-28
| | | | Also rename py-version.h to mpversion.h for consistency with mpconfig.h.
* unix/modffi: Support passing float/double args.Damien George2015-04-28
|
* modsys: Add basic sys.exc_info() implementation.Paul Sokolovsky2015-04-25
| | | | | | The implementation is very basic and non-compliant and provided solely for CPython compatibility. The function itself is bad Python2 heritage, its usage is discouraged.
* py: Overhaul and simplify printf/pfenv mechanism.Damien George2015-04-16
| | | | | | | | | | | | | | | | | | | | | | Previous to this patch the printing mechanism was a bit of a tangled mess. This patch attempts to consolidate printing into one interface. All (non-debug) printing now uses the mp_print* family of functions, mainly mp_printf. All these functions take an mp_print_t structure as their first argument, and this structure defines the printing backend through the "print_strn" function of said structure. Printing from the uPy core can reach the platform-defined print code via two paths: either through mp_sys_stdout_obj (defined pert port) in conjunction with mp_stream_write; or through the mp_plat_print structure which uses the MP_PLAT_PRINT_STRN macro to define how string are printed on the platform. The former is only used when MICROPY_PY_IO is defined. With this new scheme printing is generally more efficient (less layers to go through, less arguments to pass), and, given an mp_print_t* structure, one can call mp_print_str for efficiency instead of mp_printf("%s", ...). Code size is also reduced by around 200 bytes on Thumb2 archs.
* input.c: Fix line-endings after recent changes.Paul Sokolovsky2015-04-10
|
* unix: Automatically fix incompatible readline build options.stijn2015-04-09
|
* py: Add MICROPY_PY_BUILTINS_REVERSED, disable for minimal ports.Paul Sokolovsky2015-04-07
|
* py: Add MICROPY_PY_BUILTINS_ENUMERATE, disable for minimal ports.Paul Sokolovsky2015-04-06
|
* objstr: Add .splitlines() method.Paul Sokolovsky2015-04-04
| | | | | | | | | splitlines() occurs ~179 times in CPython3 standard library, so was deemed worthy to implement. The method has subtle semantic differences from just .split("\n"). It is also defined as working for any end-of-line combination, but this is currently not implemented - it works only with LF line-endings (which should be OK for text strings on any platforms, but not OK for bytes).
* unix: Add stackless config settings, for easy access.Paul Sokolovsky2015-04-03
|
* py: Add optional support for descriptors' __get__ and __set__ methods.stijn2015-03-26
| | | | Disabled by default. Enabled on unix and windows ports.
* unix: Remove -Wdouble-promotion from main build, and 2 from coverage.Damien George2015-03-22
| | | | | The 2 removed from coverage build are: -Wredundant-decls and -Wstrict-prototypes.
* unix: Bump stack limit and adjust for 64-bitness.Paul Sokolovsky2015-03-21
| | | | Without that, "import http.client" failed due to max recursion.
* py: Allow retrieving a function's __name__.stijn2015-03-20
| | | | Disabled by default. Enabled on unix and stmhal ports.
* unix: When using separate obj output dirs, make -B is no longer relevant.Paul Sokolovsky2015-03-21
|
* unix: Move compiler warnings from production build to coverage build.Damien George2015-03-20
|
* py: Implement core of OrderedDict type.Paul Sokolovsky2015-03-20
| | | | | | | | | | | | Given that there's already support for "fixed table" maps, which are essentially ordered maps, the implementation of OrderedDict just extends "fixed table" maps by adding an "is ordered" flag and add/remove operations, and reuses 95% of objdict code, just making methods tolerant to both dict and OrderedDict. Some things are missing so far, like CPython-compatible repr and comparison. OrderedDict is Disabled by default; enabled on unix and stmhal ports.
* unix: Enable extra compiler warnings.Damien George2015-03-19
| | | | To address issue #699.
* py: Add MICROPY_COMP_{DOUBLE,TRIPLE}_TUPLE_ASSIGN config options.Damien George2015-03-14
| | | | | | These allow to fine-tune the compiler to select whether it optimises tuple assignments of the form a, b = c, d and a, b, c = d, e, f. Sensible defaults are provided.
* unix: Support readline history saving to file, improves interactive usage.Paul Sokolovsky2015-03-13
|
* py: Add MICROPY_MALLOC_USES_ALLOCATED_SIZE to allow simpler malloc API.Damien George2015-03-03
|
* travis: Add automated coverage testing using coveralls.Damien George2015-03-01
|
* objarray: Implement array slice assignment.Paul Sokolovsky2015-02-27
| | | | | | | | | | | | | | | | This is rarely used feature which takes enough code to implement, so is controlled by MICROPY_PY_ARRAY_SLICE_ASSIGN config setting, default off. But otherwise it may be useful, as allows to update arbitrary-sized data buffers in-place. Slice is yet to implement, and actually, slice assignment implemented in such a way that RHS of assignment should be array of the exact same item typecode as LHS. CPython has it more relaxed, where RHS can be any sequence of compatible types (e.g. it's possible to assign list of int's to a bytearray slice). Overall, when all "slice write" features are implemented, it may cost ~1KB of code.
* modffi: Implement 'O' type handling for func arguments.Paul Sokolovsky2015-02-25
|
* py: Make math special functions configurable and disabled by default.Damien George2015-02-22
| | | | | | | The implementation of these functions is very large (order 4k) and they are rarely used, so we don't enable them by default. They are however enabled in stmhal and unix, since we have the room.
* modffi: Add toplevel func() function to create a function by pointer.Paul Sokolovsky2015-02-11
|
* py: Protect mp_parse and mp_compile with nlr push/pop block.Damien George2015-02-07
| | | | | | | | | | To enable parsing constants more efficiently, mp_parse should be allowed to raise an exception, and mp_compile can already raise a MemoryError. So these functions need to be protected by an nlr push/pop block. This patch adds that feature in all places. This allows to simplify how mp_parse and mp_compile are called: they now raise an exception if they have an error and so explicit checking is not needed anymore.