8000 Rename configuration variables controling Python features. · errordeveloper/micropython@ee3fd46 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit ee3fd46

Browse files
committed
Rename configuration variables controling Python features.
Now of the form MICROPY_PY_*. See issue micropython#35.
1 parent d0ceb04 commit ee3fd46

32 files changed

+161
-153
lines changed

bare-arm/mpconfigport.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
#define MICROPY_HELPER_REPL (0)
1313
#define MICROPY_HELPER_LEXER_UNIX (0)
1414
#define MICROPY_ENABLE_SOURCE_LINE (0)
15-
#define MICROPY_ENABLE_MOD_COLLECTIONS (0)
16-
#define MICROPY_ENABLE_MOD_MATH (0)
17-
#define MICROPY_ENABLE_MOD_CMATH (0)
18-
#define MICROPY_ENABLE_MOD_IO (0)
19-
#define MICROPY_ENABLE_MOD_STRUCT (0)
20-
#define MICROPY_ENABLE_MOD_SYS (0)
21-
#define MICROPY_ENABLE_PROPERTY (0)
15+
#define MICROPY_PY_COLLECTIONS (0)
16+
#define MICROPY_PY_MATH (0)
17+
#define MICROPY_PY_CMATH (0)
18+
#define MICROPY_PY_IO (0)
19+
#define MICROPY_PY_STRUCT (0)
20+
#define MICROPY_PY_SYS (0)
21+
#define MICROPY_PY_PROPERTY (0)
2222
#define MICROPY_CPYTHON_COMPAT (0)
2323
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_NONE)
2424
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_NONE)

py/builtinimport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ mp_import_stat_t find_file(const char *file_str, uint file_len, vstr_t *dest) {
7373
// extract the list of paths
7474
uint path_num = 0;
7575
mp_obj_t *path_items;
76-
#if MICROPY_ENABLE_MOD_SYS
76+
#if MICROPY_PY_SYS
7777
mp_obj_list_get(mp_sys_path, &path_num, &path_items);
7878
#endif
7979

py/builtintables.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ STATIC const mp_map_elem_t mp_builtin_object_table[] = {
5353
#if MICROPY_ENABLE_FLOAT
5454
{ MP_OBJ_NEW_QSTR(MP_QSTR_float), (mp_obj_t)&mp_type_float },
5555
#endif
56-
#if MICROPY_ENABLE_FROZENSET
56+
#if MICROPY_PY_FROZENSET
5757
{ MP_OBJ_NEW_QSTR(MP_QSTR_frozenset), (mp_obj_t)&mp_type_frozenset },
5858
#endif
5959
{ MP_OBJ_NEW_QSTR(MP_QSTR_int), (mp_obj_t)&mp_type_int },
6060
{ MP_OBJ_NEW_QSTR(MP_QSTR_list), (mp_obj_t)&mp_type_list },
6161
{ MP_OBJ_NEW_QSTR(MP_QSTR_map), (mp_obj_t)&mp_type_map },
6262
{ MP_OBJ_NEW_QSTR(MP_QSTR_object), (mp_obj_t)&mp_type_object },
63-
#if MICROPY_ENABLE_PROPERTY
63+
#if MICROPY_PY_PROPERTY
6464
{ MP_OBJ_NEW_QSTR(MP_QSTR_property), (mp_obj_t)&mp_type_property },
6565
#endif
6666
{ MP_OBJ_NEW_QSTR(MP_QSTR_range), (mp_obj_t)&mp_type_range },
@@ -159,26 +159,26 @@ STATIC const mp_map_elem_t mp_builtin_module_table[] = {
159159
{ MP_OBJ_NEW_QSTR(MP_QSTR_micropython), (mp_obj_t)&mp_module_micropython },
160160

161161
{ MP_OBJ_NEW_QSTR(MP_QSTR_array), (mp_obj_t)&mp_module_array },
162-
#if MICROPY_ENABLE_MOD_IO
162+
#if MICROPY_PY_IO
163163
{ MP_OBJ_NEW_QSTR(MP_QSTR_io), (mp_obj_t)&mp_module_io },
164164
#endif
165-
#if MICROPY_ENABLE_MOD_COLLECTIONS
165+
#if MICROPY_PY_COLLECTIONS
166166
{ MP_OBJ_NEW_QSTR(MP_QSTR__collections), (mp_obj_t)&mp_module_collections },
167167
#endif
168-
#if MICROPY_ENABLE_MOD_STRUCT
168+
#if MICROPY_PY_STRUCT
169169
{ MP_OBJ_NEW_QSTR(MP_QSTR_struct), (mp_obj_t)&mp_module_struct },
170170
#endif
171171

172172
#if MICROPY_ENABLE_FLOAT
173173
{ MP_OBJ_NEW_QSTR(MP_QSTR_math), (mp_obj_t)&mp_module_math },
174-
#if MICROPY_ENABLE_MOD_CMATH
174+
#if MICROPY_PY_CMATH
175175
{ MP_OBJ_NEW_QSTR(MP_QSTR_cmath), (mp_obj_t)&mp_module_cmath },
176176
#endif
177177
#endif
178-
#if MICROPY_ENABLE_MOD_SYS
178+
#if MICROPY_PY_SYS
179179
{ MP_OBJ_NEW_QSTR(MP_QSTR_sys), (mp_obj_t)&mp_module_sys },
180180
#endif
181-
#if MICROPY_ENABLE_MOD_GC && MICROPY_ENABLE_GC
181+
#if MICROPY_PY_GC && MICROPY_ENABLE_GC
182182
{ MP_OBJ_NEW_QSTR(MP_QSTR_gc), (mp_obj_t)&mp_module_gc },
183183
#endif
184184

py/modcmath.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include "obj.h"
3333
#include "builtin.h"
3434

35-
#if MICROPY_ENABLE_FLOAT && MICROPY_ENABLE_MOD_CMATH
35+
#if MICROPY_ENABLE_FLOAT && MICROPY_PY_CMATH
3636

3737
// These are defined in modmath.c
3838
extern const mp_obj_float_t mp_math_e_obj;
@@ -154,4 +154,4 @@ const mp_obj_module_t mp_module_cmath = {
154154
.globals = (mp_obj_dict_t*)&mp_module_cmath_globals,
155155
};
156156

157-
#endif // MICROPY_ENABLE_FLOAT && MICROPY_ENABLE_MOD_CMATH
157+
#endif // MICROPY_ENABLE_FLOAT && MICROPY_PY_CMATH

py/modcollections.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include "obj.h"
3131
#include "builtin.h"
3232

33-
#if MICROPY_ENABLE_MOD_COLLECTIONS
33+
#if MICROPY_PY_COLLECTIONS
3434

3535
STATIC const mp_map_elem_t mp_module_collections_globals_table[] = {
3636
{ MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR__collections) },
@@ -54,4 +54,4 @@ const mp_obj_module_t mp_module_collections = {
5454
.globals = (mp_obj_dict_t*)&mp_module_collections_globals,
5555
};
5656

57-
#endif // MICROPY_ENABLE_MOD_COLLECTIONS
57+
#endif // MICROPY_PY_COLLECTIONS

py/modgc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include "objstr.h"
3636
#include "gc.h"
3737

38-
#if MICROPY_ENABLE_MOD_GC && MICROPY_ENABLE_GC
38+
#if MICROPY_PY_GC && MICROPY_ENABLE_GC
3939

4040
STATIC mp_obj_t py_gc_collect(void) {
4141
gc_collect();

py/modio.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include "obj.h"
3131
#include "builtin.h"
3232

33-
#if MICROPY_ENABLE_MOD_IO
33+
#if MICROPY_PY_IO
3434

3535
extern const mp_obj_type_t mp_type_fileio;
3636
extern const mp_obj_type_t mp_type_textio;
@@ -40,14 +40,14 @@ STATIC const mp_map_elem_t mp_module_io_globals_table[] = {
4040
// Note: mp_builtin_open_obj should be defined by port, it's not
4141
// part of the core.
4242
{ MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },
43-
#if MICROPY_MOD_IO_FILEIO
43+
#if MICROPY_PY_IO_FILEIO
4444
{ MP_OBJ_NEW_QSTR(MP_QSTR_FileIO), (mp_obj_t)&mp_type_fileio },
4545
#endif
4646
#if MICROPY_CPYTHON_COMPAT
4747
{ MP_OBJ_NEW_QSTR(MP_QSTR_TextIOWrapper), (mp_obj_t)&mp_type_textio },
4848
#endif
4949
{ MP_OBJ_NEW_QSTR(MP_QSTR_StringIO), (mp_obj_t)&mp_type_stringio },
50-
#if MICROPY_IO_BYTESIO
50+
#if MICROPY_PY_IO_BYTESIO
5151
{ MP_OBJ_NEW_QSTR(MP_QSTR_BytesIO), (mp_obj_t)&mp_type_bytesio },
5252
#endif
5353
};

py/modmath.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include "obj.h"
3333
#include "builtin.h"
3434

35-
#if MICROPY_ENABLE_FLOAT && MICROPY_ENABLE_MOD_MATH
35+
#if MICROPY_ENABLE_FLOAT && MICROPY_PY_MATH
3636

3737
//TODO: Change macros to check for overflow and raise OverflowError or RangeError
3838
#define MATH_FUN_1(py_name, c_name) \
@@ -184,4 +184,4 @@ const mp_obj_module_t mp_module_math = {
184184
.globals = (mp_obj_dict_t*)&mp_module_math_globals,
185185
};
186186

187-
#endif // MICROPY_ENABLE_FLOAT && MICROPY_ENABLE_MOD_MATH
187+
#endif // MICROPY_ENABLE_FLOAT && MICROPY_PY_MATH

py/modstruct.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#include "binary.h"
3838
#include "parsenum.h"
3939

40-
#if MICROPY_ENABLE_MOD_STRUCT
40+
#if MICROPY_PY_STRUCT
4141

4242
STATIC char get_fmt_type(const char **fmt) {
4343
char t = **fmt;

py/modsys.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include "objtuple.h"
3535
#include "objstr.h"
3636

37-
#if MICROPY_ENABLE_MOD_SYS
37+
#if MICROPY_PY_SYS
3838

3939
// These should be implemented by ports, specific types don't matter,
4040
// only addresses.
@@ -65,11 +65,11 @@ STATIC const mp_map_elem_t mp_module_sys_globals_table[] = {
6565
{ MP_OBJ_NEW_QSTR(MP_QSTR_byteorder), MP_OBJ_NEW_QSTR(MP_QSTR_big) },
6666
#endif
6767

68-
#if MICROPY_MOD_SYS_EXIT
68+
#if MICROPY_PY_SYS_EXIT
6969
{ MP_OBJ_NEW_QSTR(MP_QSTR_exit), (mp_obj_t)&mp_sys_exit_obj },
7070
#endif
7171

72-
#if MICROPY_MOD_SYS_STDFILES
72+
#if MICROPY_PY_SYS_STDFILES
7373
{ MP_OBJ_NEW_QSTR(MP_QSTR_stdin), (mp_obj_t)&mp_sys_stdin_obj },
7474
{ MP_OBJ_NEW_QSTR(MP_QSTR_stdout), (mp_obj_t)&mp_sys_stdout_obj },
7575
{ MP_OBJ_NEW_QSTR(MP_QSTR_stderr), (mp_obj_t)&mp_sys_stderr_obj },

0 commit comments

Comments
 (0)
0