Skip to content
Snippets Groups Projects
  1. Jul 28, 2017
  2. May 06, 2017
  3. May 02, 2017
    • Paul Sokolovsky's avatar
      py/modio: Implement uio.resource_stream(package, resource_path). · d7da2dba
      Paul Sokolovsky authored
      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.
      d7da2dba
  4. Oct 07, 2016
  5. Sep 21, 2016
  6. Jun 18, 2016
  7. May 17, 2016
    • Paul Sokolovsky's avatar
      py/stream: Support both "exact size" and "one underlying call" operations. · 7f7c84b1
      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.
      7f7c84b1
  8. May 02, 2016
  9. Mar 25, 2016
  10. Mar 24, 2016
  11. Nov 29, 2015
  12. Feb 15, 2015
  13. Jan 01, 2015
  14. Nov 29, 2014
  15. Jun 21, 2014
  16. Jun 19, 2014
  17. Jun 11, 2014
    • Paul Sokolovsky's avatar
      py: Rename builtin "io" to "_io". · fbdf2f1d
      Paul Sokolovsky authored
      Functionality we provide in builtin io module is fairly minimal. Some
      code, including CPython stdlib, depends on more functionality. So, there's
      a choice to either implement it in C, or move it _io, and let implement other
      functionality in Python. 2nd choice is pursued. This setup matches CPython
      too (_io is builtin, io is Python-level).
      fbdf2f1d
  18. May 24, 2014
  19. May 19, 2014
  20. May 15, 2014
  21. May 03, 2014
    • Damien George's avatar
      Add license header to (almost) all files. · 04b9147e
      Damien George authored
      Blanket wide to all .c and .h files.  Some files originating from ST are
      difficult to deal with (license wise) so it was left out of those.
      
      Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
      04b9147e
  22. Apr 26, 2014
  23. Apr 05, 2014
  24. Apr 03, 2014
    • Paul Sokolovsky's avatar
      py: Add "io" module. · 98a627dc
      Paul Sokolovsky authored
      So far just includes "open" function, which should be supplied by a port.
      
      TODO: Make the module #ifdef'ed.
      98a627dc
Loading