summaryrefslogtreecommitdiffstatshomepage
path: root/unix
Commit message (Collapse)AuthorAge
* ports: Make new ports/ sub-directory and move all ports there.Damien George2017-09-06
| | | | | | This is to keep the top-level directory clean, to make it clear what is core and what is a port, and to allow the repository to grow with new ports in a sustainable way.
* all: Convert remaining "mp_uint_t n_args" to "size_t n_args".Damien George2017-08-30
| | | | This is to have consistency across the whole repository.
* all: Convert mp_uint_t to mp_unary_op_t/mp_binary_op_t where appropriateDamien George2017-08-29
| | | | | | | The unary-op/binary-op enums are already defined, and there are no arithmetic tricks used with these types, so it makes sense to use the correct enum type for arguments that take these values. It also reduces code size quite a bit for nan-boxing builds.
* all: Make static dicts use mp_rom_map_elem_t type and MP_ROM_xxx macros.Damien George2017-08-21
|
* extmod,unix: For uos.stat interpret st_size member as an unsigned int.Damien George2017-08-21
| | | | | This prevents large files (eg larger than 2gb on a 32-bit arch) from showing up as having a negative size. Fixes issue #3227.
* all: Raise exceptions via mp_raise_XXXJavier Candeira2017-08-13
| | | | | | | | - Changed: ValueError, TypeError, NotImplementedError - OSError invocations unchanged, because the corresponding utility function takes ints, not strings like the long form invocation. - OverflowError, IndexError and RuntimeError etc. not changed for now until we decide whether to add new utility functions.
* py/modsys: Initial implementation of sys.getsizeof().Paul Sokolovsky2017-08-11
| | | | | Implemented as a new MP_UNARY_OP. This patch adds support lists, dicts and instances.
* all: Make use of $(TOP) variable in Makefiles, instead of "..".Damien George2017-08-11
| | | | | $(TOP) is defined in py/mkenv.mk and should be used to refer to the top level of this repository.
* all: Use the name MicroPython consistently in commentsAlexander Steffen2017-07-31
| | | | | There were several different spellings of MicroPython present in comments, when there should be only one.
* unix/modjni: Convert to mp_rom_map_elem_t.Paul Sokolovsky2017-07-30
|
* all: Unify header guard usage.Alexander Steffen2017-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code conventions suggest using header guards, but do not define how those should look like and instead point to existing files. However, not all existing files follow the same scheme, sometimes omitting header guards altogether, sometimes using non-standard names, making it easy to accidentally pick a "wrong" example. This commit ensures that all header files of the MicroPython project (that were not simply copied from somewhere else) follow the same pattern, that was already present in the majority of files, especially in the py folder. The rules are as follows. Naming convention: * start with the words MICROPY_INCLUDED * contain the full path to the file * replace special characters with _ In addition, there are no empty lines before #ifndef, between #ifndef and one empty line before #endif. #endif is followed by a comment containing the name of the guard macro. py/grammar.h cannot use header guards by design, since it has to be included multiple times in a single C file. Several other files also do not need header guards as they are only used internally and guaranteed to be included only once: * MICROPY_MPHALPORT_H * mpconfigboard.h * mpconfigport.h * mpthreadport.h * pin_defs_*.h * qstrdefs*.h
* unix/Makefile: Disable assertions in the standard unix executable.Damien George2017-07-12
| | | | | | | | | | Reasons to disable: - the code is relatively robust so doesn't need full checking in the main executable, and the coverage build is used for full testing with assertions still enabled; - reduces code size noticeably, by 27k for x86-64 and 20k for x86; - allows to more easily track changes in code size, since assertions can skew things.
* unix/modsocket: Remove unnecessary asserts.Damien George2017-07-12
| | | | These checks are already made, and errors reported, by the uPy runtime.
* py/repl: Change mp_uint_t to size_t in repl helpers.Damien George2017-07-04
|
* tests/unix/extra_coverage: Add test for mp_vprintf with bad fmt spec.Damien George2017-06-30
|
* unix/mpconfigport.mk: Update descriptions of readline and TLS options.Paul Sokolovsky2017-06-17
|
* all: Make more use of mp_raise_{msg,TypeError,ValueError} helpers.Damien George2017-06-15
|
* unix/modtime: Replace strftime() with localtime().Paul Sokolovsky2017-06-11
| | | | | | Baremetal ports standardized on providing localtime(). localtime() offers more functionality, in particular, strftime() can be completely implemented in Python with localtime().
* unix/Makefile: replace references to make with $(MAKE)Tamas TEVESZ2017-06-08
| | | | | make is not always GNU make; the latter may go by different names. This helps builds on systems where the default make is not GNU make.
* unix: Convert to use core-provided version of built-in import().Damien George2017-06-01
|
* various: Spelling fixesVille Skyttä2017-05-29
|
* unix/Makefile: Don't add frozen bytecode to minimal build.Damien George2017-05-26
|
* unix: Move upip to frozen bytecode dir.Paul Sokolovsky2017-05-12
| | | | | For x86_64 build, this saves only 128 bytes on the final executable size, but still an improvement.
* unix/Makefile: Enable frozen bytecode modules dir.Paul Sokolovsky2017-05-12
|
* ports: Add ilistdir in uos module.Damien George2017-05-10
|
* unix/main: Implement -m option for packages.Paul Sokolovsky2017-05-09
|
* unix/main: Don't allow to specify too small heap size.Paul Sokolovsky2017-05-06
| | | | | | | | | This will lead to crash like: FATAL: uncaught NLR 80a5420 On x86_32, the minimum heap size is smaller, but not 2 times, so just use value which works for x86_64.
* py/modio: Implement uio.resource_stream(package, resource_path).Paul Sokolovsky2017-05-03
| | | | | | | | | | | | | | The with semantics of this function is close to pkg_resources.resource_stream() function from setuptools, which is the canonical way to access non-source files belonging to a package (resources), regardless of what medium the package uses (e.g. individual source files vs zip archive). In the case of MicroPython, this function allows to access resources which are frozen into the executable, besides accessing resources in the file system. This is initial stage of the implementation, which actually doesn't implement "package" part of the semantics, just accesses frozen resources from "root", or filesystem resource - from current dir.
* unix/main: Ignore SIGPIPE signal, instead make EPIPE arrive.Paul Sokolovsky2017-05-01
| | | | | | | | | | | | | Do not raise SIGPIPE, instead return EPIPE. Otherwise, e.g. writing to peer-closed socket will lead to sudden termination of MicroPython process. SIGPIPE is particularly nasty, because unix shell doesn't print anything for it, so the above looks like completely sudden and silent termination for unknown reason. Ignoring SIGPIPE is also what CPython does. Note that this may lead to problems using MicroPython scripts as pipe filters, but again, that's what CPython does. So, scripts which want to follow unix shell pipe semantics (where SIGPIPE means "pipe was requested to terminate, it's not an error"), should catch EPIPE themselves.
* unix: Remove obsolete MICROPY_FATFS macro.Damien George2017-04-26
| | | | | It doesn't do anything. The VFS feature is controlled by MICROPY_VFS and the FatFS driver, by MICROPY_VFS_FAT (which are set in mpconfigport.h).
* mpy-cross, unix, windows, stmhal: Enable return-if-else optimisation.Damien George2017-04-22
| | | | | | Prior to making this a config option it was previously available on these (and all other) ports, and it makes sense to keep it enabled for mpy-cross as well as ports that have a decent amount of space for the code.
* unix: Enabled high-quality float hashing in coverage build.Damien George2017-04-12
|
* unix, windows: Use core-provided KeyboardInterrupt exception object.Damien George2017-04-11
|
* all: Move BYTES_PER_WORD definition from ports to py/mpconfig.hDamien George2017-04-01
| | | | | It can still be overwritten by a port in mpconfigport.h but for almost all cases one can use the provided default.
* all: Use full path name when including mp-readline/timeutils/netutils.Damien George2017-03-31
| | | | | | | This follows the pattern of how all other headers are now included, and makes it explicit where the header file comes from. This patch also removes -I options from Makefile's that specify the mp-readline/timeutils/ netutils directories, which are no longer needed.
* unix: Convert mp_uint_t to size_t in alloc.c.Pavol Rusnak2017-03-31
|
* unix: Convert mp_uint_t to size_t for use of mp_obj_list_get.Damien George2017-03-29
|
* unix: Use mp_obj_str_get_str instead of mp_obj_str_get_data.Damien George2017-03-25
|
* all/Makefile: Remove -ansi from GCC flags, its ignored anyway.Krzysztof Blazewicz2017-03-23
| | | | | | The -ansi flag is used for C dialect selection and it is equivalent to -std=c90. Because it goes right before -std=gnu99 it is ignored as for conflicting flags GCC always uses the last one.
* unix/coverage: Enable scheduler and add tests for it.Damien George2017-03-20
|
* unix: Use mp_handle_pending() in time.sleep().Damien George2017-03-20
|
* tests: Improve binary.c test coverage.Rami Ali2017-03-14
|
* unix/main: Refactor to put lexer constructors all in one place.Damien George2017-03-14
| | | | | The lexer can now raise an exception on construction so it must go within an nlr handler block.
* unix/moduselect: Properly implement ipoll object iteration.Paul Sokolovsky2017-03-05
| | | | | TODO: There's another issue to care about: poll set being modified during iteration.
* unix: Remove remaining, obsolete traces of GNU readline support.Damien George2017-03-03
|
* unix/modmachine: Add Signal class to machine module.Damien George2017-03-02
|
* py: Add iter_buf to getiter type method.Damien George2017-02-16
| | | | | | | | | | | | | | | Allows to iterate over the following without allocating on the heap: - tuple - list - string, bytes - bytearray, array - dict (not dict.keys, dict.values, dict.items) - set, frozenset Allows to call the following without heap memory: - all, any, min, max, sum TODO: still need to allocate stack memory in bytecode for iter_buf.
* unix/moduselect: Implement ipoll() method with no-allocation policy.Paul Sokolovsky2017-02-13
| | | | | | | | | ipoll() allows to poll streams without allocating any memory: this method returns an iterator (a poll object itself), and the iterator yields preallocated "callee-owned tuple" with polling results for each active stream. The only operation a caller is allowed to do with this tuple is extracting values from it (storing the tuple as a whole somewhere is not allowed).
* py/objtype: Implement __delattr__ and __setattr__.dmazzella2017-02-09
| | | | | | This patch implements support for class methods __delattr__ and __setattr__ for customising attribute access. It is controlled by the config option MICROPY_PY_DELATTR_SETATTR and is disabled by default.
* unix/main: Properly handle MICROPYPATH starting with ':'.Paul Sokolovsky2017-02-07
| | | | In other words, where first path component is an empty string.