<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/modio.c, branch 4.0.0-alpha.3</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=4.0.0-alpha.3</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=4.0.0-alpha.3'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2018-07-11T20:45:30+00:00</updated>
<entry>
<title>WIP: after merge; before testing</title>
<updated>2018-07-11T20:45:30+00:00</updated>
<author>
<name>Dan Halbert</name>
<email>halbert@halwitz.org</email>
</author>
<published>2018-07-11T20:45:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=7c219600a246d8956d0b23ea3f5d125a820e6b6a'/>
<id>urn:sha1:7c219600a246d8956d0b23ea3f5d125a820e6b6a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/modio: Add uio.IOBase class to allow to define user streams.</title>
<updated>2018-06-12T02:29:26+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-06-04T05:54:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=af0932a7793478f0b90b754d38955d69700b0bee'/>
<id>urn:sha1:af0932a7793478f0b90b754d38955d69700b0bee</id>
<content type='text'>
A user class derived from IOBase and implementing readinto/write/ioctl can
now be used anywhere a native stream object is accepted.

The mapping from C to Python is:

    stream_p-&gt;read  --&gt; readinto(buf)
    stream_p-&gt;write --&gt; write(buf)
    stream_p-&gt;ioctl --&gt; ioctl(request, arg)

Among other things it allows the user to:

- create an object which can be passed as the file argument to print:
  print(..., file=myobj), and then print will pass all the data to the
  object via the objects write method (same as CPython)
- pass a user object to uio.BufferedWriter to buffer the writes (same as
  CPython)
- use select.select on a user object
- register user objects with select.poll, in particular so user objects can
  be used with uasyncio
- create user files that can be returned from user filesystems, and import
  can import scripts from these user files

For example:

    class MyOut(io.IOBase):
        def write(self, buf):
            print('write', repr(buf))
            return len(buf)

    print('hello', file=MyOut())

The feature is enabled via MICROPY_PY_IO_IOBASE which is disabled by
default.
</content>
</entry>
<entry>
<title>py/modio: Use correct config macro to enable resource_stream function.</title>
<updated>2017-12-19T05:59:08+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-12-19T05:59:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=304a3bcc1cf4f272b62a6cd8f14583db84d84189'/>
<id>urn:sha1:304a3bcc1cf4f272b62a6cd8f14583db84d84189</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/objstr: Remove "make_qstr_if_not_already" arg from mp_obj_new_str.</title>
<updated>2017-11-16T02:17:51+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-11-16T02:17:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=4601759bf59e16b860a3f082e9aa4ea78356bf92'/>
<id>urn:sha1:4601759bf59e16b860a3f082e9aa4ea78356bf92</id>
<content type='text'>
This patch simplifies the str creation API to favour the common case of
creating a str object that is not forced to be interned.  To force
interning of a new str the new mp_obj_new_str_via_qstr function is added,
and should only be used if warranted.

Apart from simplifying the mp_obj_new_str function (and making it have the
same signature as mp_obj_new_bytes), this patch also reduces code size by a
bit (-16 bytes for bare-arm and roughly -40 bytes on the bare-metal archs).
</content>
</entry>
<entry>
<title>Initial merge of micropython v1.9.2 into circuitpython 2.0.0 (in development) master.</title>
<updated>2017-08-26T02:17:07+00:00</updated>
<author>
<name>Dan Halbert</name>
<email>halbert@halwitz.org</email>
</author>
<published>2017-08-26T02:17:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ef61b5ecb59e9b4e37e3e3c023c62d583c23eb16'/>
<id>urn:sha1:ef61b5ecb59e9b4e37e3e3c023c62d583c23eb16</id>
<content type='text'>
cpx build compiles and loads and works in repl; test suite not run yet
esp8266 not tested yet
</content>
</entry>
<entry>
<title>py: Pretend frozen files are stored under .frozen rather than the empty path.</title>
<updated>2017-08-10T22:46:17+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@chickadee.tech</email>
</author>
<published>2017-08-10T22:46:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=f6a702538a0b3dd72879d65e3acc32520d4371f5'/>
<id>urn:sha1:f6a702538a0b3dd72879d65e3acc32520d4371f5</id>
<content type='text'>
This makes it clear when frozen modules are loaded as opposed to the empty path
which represents the current working directory. Furthermore, by splitting the two
apart this allows one to control in what order frozen modules are loaded.

This is a prerequisite for #56.
</content>
</entry>
<entry>
<title>all: Use the name MicroPython consistently in comments</title>
<updated>2017-07-31T08:35:40+00:00</updated>
<author>
<name>Alexander Steffen</name>
<email>devel.20.webmeister@spamgourmet.com</email>
</author>
<published>2017-06-30T07:22:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=55f33240f3d7051d4213629e92437a36f1fac50e'/>
<id>urn:sha1:55f33240f3d7051d4213629e92437a36f1fac50e</id>
<content type='text'>
There were several different spellings of MicroPython present in comments,
when there should be only one.
</content>
</entry>
<entry>
<title>py/modio: BufferedWriter: Convert to mp_rom_map_elem_t.</title>
<updated>2017-07-28T18:54:59+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2017-07-28T18:41:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=456450437fc572d0296d52be0035e135ab6814d8'/>
<id>urn:sha1:456450437fc572d0296d52be0035e135ab6814d8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/modio: resource_stream: Implement "package" param handling.</title>
<updated>2017-05-06T15:42:35+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2017-05-06T15:42:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=4a4490ffcc906fe88e157dc926be54030c6fbf72'/>
<id>urn:sha1:4a4490ffcc906fe88e157dc926be54030c6fbf72</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/modio: Implement uio.resource_stream(package, resource_path).</title>
<updated>2017-05-02T22:47:08+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2017-05-02T22:47:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=d7da2dba07778fa3c0c7873b7c253bde48066e9c'/>
<id>urn:sha1:d7da2dba07778fa3c0c7873b7c253bde48066e9c</id>
<content type='text'>
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.
</content>
</entry>
</feed>
