unix, stmhal: Consistently use "FileIO" as class name for file objects.
They correspond to io.FileIO in io module hierarchy (with small caveat that io.FileIO is raw file and works with bytes, not strings).
This commit is contained in:
parent
b8cf948550
commit
72d70cb045
|
@ -15,7 +15,7 @@ typedef struct _pyb_file_obj_t {
|
||||||
} pyb_file_obj_t;
|
} pyb_file_obj_t;
|
||||||
|
|
||||||
void file_obj_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) {
|
void file_obj_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) {
|
||||||
printf("<file %p>", self_in);
|
printf("<io.FileIO %p>", self_in);
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC machine_int_t file_read(mp_obj_t self_in, void *buf, machine_uint_t size, int *errcode) {
|
STATIC machine_int_t file_read(mp_obj_t self_in, void *buf, machine_uint_t size, int *errcode) {
|
||||||
|
@ -69,7 +69,7 @@ STATIC const mp_stream_p_t file_obj_stream_p = {
|
||||||
|
|
||||||
STATIC const mp_obj_type_t file_obj_type = {
|
STATIC const mp_obj_type_t file_obj_type = {
|
||||||
{ &mp_type_type },
|
{ &mp_type_type },
|
||||||
.name = MP_QSTR_File,
|
.name = MP_QSTR_FileIO,
|
||||||
.make_new = file_obj_make_new,
|
.make_new = file_obj_make_new,
|
||||||
.print = file_obj_print,
|
.print = file_obj_print,
|
||||||
.getiter = mp_identity,
|
.getiter = mp_identity,
|
||||||
|
|
|
@ -33,7 +33,7 @@ Q(SDcard)
|
||||||
Q(gpio)
|
Q(gpio)
|
||||||
Q(gpio_in)
|
Q(gpio_in)
|
||||||
Q(gpio_out)
|
Q(gpio_out)
|
||||||
Q(File)
|
Q(FileIO)
|
||||||
// Entries for sys.path
|
// Entries for sys.path
|
||||||
Q(0:/)
|
Q(0:/)
|
||||||
Q(0:/src)
|
Q(0:/src)
|
||||||
|
|
|
@ -130,7 +130,7 @@ STATIC const mp_stream_p_t rawfile_stream_p = {
|
||||||
|
|
||||||
STATIC const mp_obj_type_t rawfile_type = {
|
STATIC const mp_obj_type_t rawfile_type = {
|
||||||
{ &mp_type_type },
|
{ &mp_type_type },
|
||||||
.name = MP_QSTR_io_dot_FileIO,
|
.name = MP_QSTR_FileIO,
|
||||||
.print = fdfile_print,
|
.print = fdfile_print,
|
||||||
.make_new = fdfile_make_new,
|
.make_new = fdfile_make_new,
|
||||||
.getiter = mp_identity,
|
.getiter = mp_identity,
|
||||||
|
|
|
@ -27,7 +27,7 @@ Q(accept)
|
||||||
Q(recv)
|
Q(recv)
|
||||||
Q(setsockopt)
|
Q(setsockopt)
|
||||||
|
|
||||||
Q(io.FileIO)
|
Q(FileIO)
|
||||||
Q(ffimod)
|
Q(ffimod)
|
||||||
Q(ffifunc)
|
Q(ffifunc)
|
||||||
Q(fficallback)
|
Q(fficallback)
|
||||||
|
|
Loading…
Reference in New Issue