1. 09 Dec, 2014 1 commit
    • Damien George's avatar
      py: Allow builtins to be overridden. · 78d702c3
      Damien George authored
      This patch adds a configuration option (MICROPY_CAN_OVERRIDE_BUILTINS)
      which, when enabled, allows to override all names within the builtins
      module.  A builtins override dict is created the first time the user
      assigns to a name in the builtins model, and then that dict is searched
      first on subsequent lookups.  Note that this implementation doesn't
      allow deleting of names.
      
      This patch also does some refactoring of builtins code, creating the
      modbuiltins.c file.
      
      Addresses issue #959.
      78d702c3
  2. 29 Nov, 2014 1 commit
  3. 22 Nov, 2014 1 commit
  4. 16 Nov, 2014 1 commit
  5. 25 Oct, 2014 1 commit
  6. 23 Oct, 2014 1 commit
  7. 22 Oct, 2014 1 commit
  8. 12 Oct, 2014 1 commit
  9. 11 Oct, 2014 2 commits
  10. 09 Oct, 2014 1 commit
  11. 07 Oct, 2014 1 commit
  12. 29 Sep, 2014 1 commit
  13. 17 Sep, 2014 1 commit
  14. 06 Sep, 2014 1 commit
  15. 03 Sep, 2014 2 commits
  16. 24 Aug, 2014 2 commits
  17. 23 Aug, 2014 1 commit
    • Paul Sokolovsky's avatar
      modtermios: Add "termios" unix module, subset of CPython's. · 4f9ebade
      Paul Sokolovsky authored
      Also provides setraw() function from "tty" module (which in CPython is
      implemented in Python). The idea here is that 95% of "termios" module usage
      is to set raw mode to allow access to normal serial devices. Then, instead
      of exporting gazillion termios symbols, it's better to implement it in C,
      and export minimal number of symbols (mostly baud rates and drain values).
      4f9ebade
  18. 12 Aug, 2014 1 commit
  19. 25 Jul, 2014 1 commit
    • Dave Hylands's avatar
      Add support for storing args during an exception raised by an irq. · 5b7fd20f
      Dave Hylands authored
      The user code should call micropython.alloc_emergency_exception_buf(size)
      where size is the size of the buffer used to print the argument
      passed to the exception.
      
      With the test code from #732, and a call to
      micropython.alloc_emergenncy_exception_buf(100) the following error is
      now printed:
      ```python
      >>> import heartbeat_irq
      Uncaught exception in Timer(4) interrupt handler
      Traceback (most recent call last):
        File "0://heartbeat_irq.py", line 14, in heartbeat_cb
      NameError: name 'led' is not defined
      ```
      5b7fd20f
  20. 19 Jul, 2014 1 commit
    • Damien George's avatar
      py: Add stream reading of n unicode chars; unicode support by default. · 1694bc73
      Damien George authored
      With unicode enabled, this patch allows reading a fixed number of
      characters from text-mode streams; eg file.read(5) will read 5 unicode
      chars, which can made of more than 5 bytes.
      
      For an ASCII stream (ie no chars > 127) it only needs to do 1 read.  If
      there are lots of non-ASCII chars in a stream, then it needs multiple
      reads of the underlying object.
      
      Adds a new test for this case.  Enables unicode support by default on
      unix and stmhal ports.
      1694bc73
  21. 13 Jul, 2014 1 commit
  22. 09 Jul, 2014 1 commit
  23. 03 Jul, 2014 2 commits
  24. 28 Jun, 2014 1 commit
  25. 20 Jun, 2014 1 commit
  26. 08 Jun, 2014 1 commit
  27. 07 Jun, 2014 2 commits
  28. 05 Jun, 2014 2 commits
  29. 01 Jun, 2014 1 commit
    • Damien George's avatar
      Rename bultins config variables to MICROPY_PY_BUILTINS_*. · fb510b3b
      Damien George authored
      This renames:
      MICROPY_PY_FROZENSET -> MICROPY_PY_BUILTINS_FROZENSET
      MICROPY_PY_PROPERTY -> MICROPY_PY_BUILTINS_PROPERTY
      MICROPY_PY_SLICE -> MICROPY_PY_BUILTINS_SLICE
      MICROPY_ENABLE_FLOAT -> MICROPY_PY_BUILTINS_FLOAT
      
      See issue #35 for discussion.
      fb510b3b
  30. 24 May, 2014 1 commit
  31. 21 May, 2014 1 commit
    • Damien George's avatar
      Tidy up some configuration options. · 58ebde46
      Damien George authored
      MP_ALLOC_* -> MICROPY_ALLOC_*
      MICROPY_PATH_MAX -> MICROPY_ALLOC_PATH_MAX
      MICROPY_ENABLE_REPL_HELPERS -> MICROPY_HELPER_REPL
      MICROPY_ENABLE_LEXER_UNIX -> MICROPY_HELPER_LEXER_UNIX
      MICROPY_EXTRA_* -> MICROPY_PORT_*
      
      See issue #35.
      58ebde46
  32. 19 May, 2014 1 commit
  33. 14 May, 2014 1 commit
    • Paul Sokolovsky's avatar
      unix: Add "_os" module with stat(). · 0c124c31
      Paul Sokolovsky authored
      stat() is bad function to use using FFI, because its ABI is largely private.
      To start with, Glibc .so doesn't even have "stat" symbol. Then, layout of
      struct stat is too implementation-dependent. So, introduce _os to deal
      with stat() and other similar cases.
      0c124c31
  34. 12 May, 2014 1 commit
    • stijn's avatar
      unix: Fix linker errors when time/ffi modules are disabled · f42dbb98
      stijn authored
      When disabling these via mpconfigport.mk or on the commandline,
      the correspoding build options are not set and the sources are not
      built so the modules should not be added to the
      MICROPY_EXTRA_BUILTIN_MODULES list since they are undefined.
      f42dbb98