mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[mpy] Added os module
This commit is contained in:
@@ -148,6 +148,8 @@ port_src += $(addprefix python/port/,\
|
||||
mod/matplotlib/pyplot/plot_view.cpp \
|
||||
mod/time/modtime.c \
|
||||
mod/time/modtime_table.c \
|
||||
mod/os/modos.c \
|
||||
mod/os/modos_table.c \
|
||||
mod/turtle/modturtle.cpp \
|
||||
mod/turtle/modturtle_table.c \
|
||||
mod/turtle/turtle.cpp \
|
||||
|
||||
@@ -526,3 +526,5 @@ Q(SEEK_SET)
|
||||
Q(SEEK_CUR)
|
||||
Q(SEEK_END)
|
||||
|
||||
Q(os)
|
||||
|
||||
|
||||
3
python/port/mod/os/modos.cpp
Normal file
3
python/port/mod/os/modos.cpp
Normal file
@@ -0,0 +1,3 @@
|
||||
extern "C" {
|
||||
#include "modos.h"
|
||||
}
|
||||
1
python/port/mod/os/modos.h
Normal file
1
python/port/mod/os/modos.h
Normal file
@@ -0,0 +1 @@
|
||||
#include <py/obj.h>
|
||||
12
python/port/mod/os/modos_table.c
Normal file
12
python/port/mod/os/modos_table.c
Normal file
@@ -0,0 +1,12 @@
|
||||
#include "modos.h"
|
||||
|
||||
STATIC const mp_rom_map_elem_t modos_module_globals_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_os) },
|
||||
};
|
||||
|
||||
STATIC MP_DEFINE_CONST_DICT(modos_module_globals, modos_module_globals_table);
|
||||
|
||||
const mp_obj_module_t modos_module = {
|
||||
.base = { &mp_type_module },
|
||||
.globals = (mp_obj_dict_t*)&modos_module_globals,
|
||||
};
|
||||
@@ -131,6 +131,7 @@ extern const struct _mp_obj_module_t modkandinsky_module;
|
||||
extern const struct _mp_obj_module_t modmatplotlib_module;
|
||||
extern const struct _mp_obj_module_t modpyplot_module;
|
||||
extern const struct _mp_obj_module_t modtime_module;
|
||||
extern const struct _mp_obj_module_t modos_module;
|
||||
extern const struct _mp_obj_module_t modturtle_module;
|
||||
|
||||
#define MICROPY_PORT_BUILTIN_MODULES \
|
||||
@@ -139,5 +140,6 @@ extern const struct _mp_obj_module_t modturtle_module;
|
||||
{ MP_ROM_QSTR(MP_QSTR_matplotlib), MP_ROM_PTR(&modmatplotlib_module) }, \
|
||||
{ MP_ROM_QSTR(MP_QSTR_matplotlib_dot_pyplot), MP_ROM_PTR(&modpyplot_module) }, \
|
||||
{ MP_ROM_QSTR(MP_QSTR_time), MP_ROM_PTR(&modtime_module) }, \
|
||||
{ MP_ROM_QSTR(MP_QSTR_os), MP_ROM_PTR(&modos_module) }, \
|
||||
{ MP_ROM_QSTR(MP_QSTR_turtle), MP_ROM_PTR(&modturtle_module) }, \
|
||||
|
||||
|
||||
Reference in New Issue
Block a user