Commit Graph

19 Commits

Author SHA1 Message Date
Damien George 93c4a6a3f7 all: Remove 'name' member from mp_obj_module_t struct.
One can instead lookup __name__ in the modules dict to get the value.
2016-09-22 00:23:16 +10:00
Radomir Dopieralski d29ca28288 esp8266/modous: Add os.umount method to unmount a filesystem.
This is an object-oriented approach, where uos is only a proxy for the
methods on the vfs object.  Some internals had to be exposed (the STATIC
keyword removed) for this to work.

Fixes #2338.
2016-08-26 12:45:21 +10:00
Paul Sokolovsky bcd0e9a7fa esp8266/moduos: Add rmdir() function. 2016-07-16 03:53:55 +03:00
Robert HH 4f3fbf09cc esp8266/moduos.c: Add stat() to the module uos of esp8266.
This implementation makes use of vfs.stat() and therefore has the same
properties. Known issues for all ports: uos.stat(".") on the top level
returns the error code 22, EINVAL. The same happens with
uos.stat("dirname/") where dirname IS the name of a directory.
2016-05-31 23:00:38 +03:00
Paul Sokolovsky 12401f337e esp8266/moduos: Add chdir() and getcwd() functions. 2016-05-29 19:44:24 +03:00
Robert HH a676a41cb7 esp8266/moduos.c: Addition of the rename method to module uos.
That one was missing in the module, even if it was available in the
vfs object. The change consist of adding the name and preparing the
call to the underlying vfs module, similar to what was already
implemented e.g. for remove.

Rename is useful by itself, or for instance for a safe file replace,
consisting of the sequence:

    write to a temp file
    delete the original file
    rename the temp file to the original file's name
2016-05-16 13:19:13 +02:00
Damien George 4f2ba9fbdc esp8266: Convert to use new MP_Exxx errno symbols.
These symbols are still defined in terms of the system Exxx symbols, and
can be switched to internal numeric definitions at a later stage.

Note that extmod/modlwip still uses many system Exxx symbols.
2016-05-10 23:30:39 +01:00
Paul Sokolovsky dde9abad16 esp8266/moduos: Add dupterm_notify() function.
Should be called to notify that current dupterm object has more input
data to read.
2016-04-17 18:09:52 +03:00
Damien George 091dcaea2f esp8266/moduos: Add uos.mkdir function. 2016-04-14 23:37:15 +01:00
Paul Sokolovsky c734de490a esp8266/main: mp_builtin_open(): Implement, using vfs_proxy_call(). 2016-04-10 16:59:19 +03:00
Paul Sokolovsky 8fc5e56a6a esp8266: Enable uos.dupterm() method. 2016-03-29 11:41:23 +03:00
Damien George 6ca17c1922 esp8266: Implement os.urandom function.
Uses what is suspected to be a hardware random number generator.
2016-03-29 10:29:57 +03:00
Paul Sokolovsky b4070ee8a4 esp8266: Allow to build without FatFs support again. 2016-03-28 21:35:41 +03:00
Paul Sokolovsky 9edd736ee6 esp8266/moduos: Add os.remove(), proxying to VFS object. 2016-03-28 12:50:07 +03:00
Paul Sokolovsky e8e116e7fc esp8266/moduos: Factor out VFS method proxy helper. 2016-03-28 12:44:36 +03:00
Paul Sokolovsky 8b08a0d9ed esp8266/moduos: Add listdir() proxy for MP_STATE_PORT(fs_user_mount)[0].
I.e. os.listdir(...) will redirect to
MP_STATE_PORT(fs_user_mount)[0].listdir(...).
2016-03-28 12:29:47 +03:00
Damien George 61230e007d esp8266/moduos: Use mp_rom_map_elem_t for static const dictionary. 2016-03-28 12:08:36 +03:00
Paul Sokolovsky 374654f2b8 esp8266: Enable FatFs support. 2016-03-27 17:13:47 +03:00
Josef Gajdusek 59610c4004 esp8266: Add uos module
Currently implements only .uname()
2015-05-26 22:18:07 +03:00