Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/adafruit/circuitpython in…
Browse files Browse the repository at this point in the history
…to en_ARR
  • Loading branch information
sommersoft committed Mar 8, 2019
2 parents c4d627a + 2de8236 commit 3a738af
Show file tree
Hide file tree
Showing 109 changed files with 13,548 additions and 18,086 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,6 @@
[submodule "tools/Tecate-bitmap-fonts"]
path = tools/Tecate-bitmap-fonts
url = https://github.com/Tecate/bitmap-fonts.git
[submodule "frozen/pew-pewpew-standalone-10.x"]
path = frozen/pew-pewpew-standalone-10.x
url = https://github.com/pewpew-game/pew-pewpew-standalone-10.x.git
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,10 @@ pseudoxml:
all-source:

locale/circuitpython.pot: all-source
find . -iname "*.c" | xargs xgettext -L C --keyword=translate -F -o circuitpython.pot -p locale
find . -iname "*.c" | xargs xgettext -L C -s --no-location --keyword=translate -o circuitpython.pot -p locale

translate: locale/circuitpython.pot
for po in $(shell ls locale/*.po); do msgmerge -U -F $$po locale/circuitpython.pot; done
for po in $(shell ls locale/*.po); do msgmerge -U $$po -s --no-fuzzy-matching --no-location locale/circuitpython.pot; done

check-translate: locale/circuitpython.pot $(wildcard locale/*.po)
$(PYTHON) tools/check_translations.py $^
4 changes: 4 additions & 0 deletions extmod/modujson.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,11 @@ STATIC mp_obj_t mod_ujson_loads(mp_obj_t obj) {
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_ujson_loads_obj, mod_ujson_loads);

STATIC const mp_rom_map_elem_t mp_module_ujson_globals_table[] = {
#if CIRCUITPY
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_json) },
#else
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_ujson) },
#endif
{ MP_ROM_QSTR(MP_QSTR_dump), MP_ROM_PTR(&mod_ujson_dump_obj) },
{ MP_ROM_QSTR(MP_QSTR_dumps), MP_ROM_PTR(&mod_ujson_dumps_obj) },
{ MP_ROM_QSTR(MP_QSTR_load), MP_ROM_PTR(&mod_ujson_load_obj) },
Expand Down
8 changes: 8 additions & 0 deletions extmod/modure.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,11 @@ STATIC MP_DEFINE_CONST_DICT(re_locals_dict, re_locals_dict_table);

STATIC const mp_obj_type_t re_type = {
{ &mp_type_type },
#if CIRCUITPY
.name = MP_QSTR_re,
#else
.name = MP_QSTR_ure,
#endif
.print = re_print,
.locals_dict = (void*)&re_locals_dict,
};
Expand Down Expand Up @@ -462,7 +466,11 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_re_sub_obj, 3, 5, mod_re_sub);
#endif

STATIC const mp_rom_map_elem_t mp_module_re_globals_table[] = {
#if CIRCUITPY
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_re) },
#else
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_ure) },
#endif
{ MP_ROM_QSTR(MP_QSTR_compile), MP_ROM_PTR(&mod_re_compile_obj) },
{ MP_ROM_QSTR(MP_QSTR_match), MP_ROM_PTR(&mod_re_match_obj) },
{ MP_ROM_QSTR(MP_QSTR_search), MP_ROM_PTR(&mod_re_search_obj) },
Expand Down
2 changes: 2 additions & 0 deletions extmod/vfs_fat.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#define FSUSER_NO_FILESYSTEM (0x0008) // the block device has no filesystem on it
// Device is writable over USB and read-only to MicroPython.
#define FSUSER_USB_WRITABLE (0x0010)
// Bit set when the above flag is checked before opening a file for write.
#define FSUSER_CONCURRENT_WRITE_PROTECTED (0x0020)

typedef struct _fs_user_mount_t {
mp_obj_base_t base;
Expand Down
3 changes: 2 additions & 1 deletion extmod/vfs_fat_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "py/mperrno.h"
#include "lib/oofatfs/ff.h"
#include "extmod/vfs_fat.h"
#include "supervisor/filesystem.h"

// this table converts from FRESULT to POSIX errno
const byte fresult_to_errno_table[20] = {
Expand Down Expand Up @@ -187,7 +188,7 @@ STATIC mp_obj_t file_open(fs_user_mount_t *vfs, const mp_obj_type_t *type, mp_ar
}
}
assert(vfs != NULL);
if ((vfs->flags & FSUSER_USB_WRITABLE) != 0 && (mode & FA_WRITE) != 0) {
if ((mode & FA_WRITE) != 0 && !filesystem_is_writable_by_python(vfs)) {
mp_raise_OSError(MP_EROFS);
}

Expand Down
1 change: 1 addition & 0 deletions frozen/pew-pewpew-standalone-10.x
2 changes: 1 addition & 1 deletion lib/tinyusb
3 changes: 3 additions & 0 deletions lib/utils/pyexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input
}
// source is a lexer, parse and compile the script
qstr source_name = lex->source_name;
if (input_kind == MP_PARSE_FILE_INPUT) {
mp_store_global(MP_QSTR___file__, MP_OBJ_NEW_QSTR(source_name));
}
mp_parse_tree_t parse_tree = mp_parse(lex, input_kind);
module_fun = mp_compile(&parse_tree, source_name, MP_EMIT_OPT_NONE, exec_flags & EXEC_FLAG_IS_REPL);
// Clear the parse tree because it has a heap pointer we don't need anymore.
Expand Down
Loading

0 comments on commit 3a738af

Please sign in to comment.