From 9d944c7fb20aa1c1d4ef914dd8e1802d90478971 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 17 Dec 2014 00:13:32 +0200 Subject: [PATCH] unix: Rename "time" module to "utime" to allow extensibility. Name choosen per latest conventions and for compatibiity with stmhal port. --- unix/modtime.c | 4 ++-- unix/mpconfigport.h | 2 +- unix/qstrdefsport.h | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/unix/modtime.c b/unix/modtime.c index 84f041fedf..7325525aa1 100644 --- a/unix/modtime.c +++ b/unix/modtime.c @@ -102,7 +102,7 @@ STATIC mp_obj_t mod_time_sleep(mp_obj_t arg) { STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_time_sleep_obj, mod_time_sleep); STATIC const mp_map_elem_t mp_module_time_globals_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_time) }, + { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_utime) }, { MP_OBJ_NEW_QSTR(MP_QSTR_clock), (mp_obj_t)&mod_time_clock_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_sleep), (mp_obj_t)&mod_time_sleep_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&mod_time_time_obj }, @@ -112,6 +112,6 @@ STATIC MP_DEFINE_CONST_DICT(mp_module_time_globals, mp_module_time_globals_table const mp_obj_module_t mp_module_time = { .base = { &mp_type_module }, - .name = MP_QSTR_time, + .name = MP_QSTR_utime, .globals = (mp_obj_dict_t*)&mp_module_time_globals, }; diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h index 4ed25d144f..a895aeab0c 100644 --- a/unix/mpconfigport.h +++ b/unix/mpconfigport.h @@ -100,7 +100,7 @@ extern const struct _mp_obj_module_t mp_module_ffi; #define MICROPY_PY_FFI_DEF #endif #if MICROPY_PY_TIME -#define MICROPY_PY_TIME_DEF { MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&mp_module_time }, +#define MICROPY_PY_TIME_DEF { MP_OBJ_NEW_QSTR(MP_QSTR_utime), (mp_obj_t)&mp_module_time }, #else #define MICROPY_PY_TIME_DEF #endif diff --git a/unix/qstrdefsport.h b/unix/qstrdefsport.h index fca5793c01..5bf764df76 100644 --- a/unix/qstrdefsport.h +++ b/unix/qstrdefsport.h @@ -49,6 +49,7 @@ Q(func) Q(var) Q(input) +Q(utime) Q(time) Q(clock) Q(sleep)