tools/mpy-tool.py: Support calling main() from an external script.
Signed-off-by: Volodymyr Shymanskyy <vshymanskyi@gmail.com> Signed-off-by: Angus Gratton <angus@redyak.com.au>
This commit is contained in:
committed by
Damien George
parent
e1b2f2e078
commit
6fba1e406b
@@ -1765,7 +1765,7 @@ def merge_mpy(compiled_modules, output_file):
|
|||||||
f.write(merged_mpy)
|
f.write(merged_mpy)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main(args=None):
|
||||||
global global_qstrs
|
global global_qstrs
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
@@ -1797,7 +1797,7 @@ def main():
|
|||||||
)
|
)
|
||||||
cmd_parser.add_argument("-o", "--output", default=None, help="output file")
|
cmd_parser.add_argument("-o", "--output", default=None, help="output file")
|
||||||
cmd_parser.add_argument("files", nargs="+", help="input .mpy files")
|
cmd_parser.add_argument("files", nargs="+", help="input .mpy files")
|
||||||
args = cmd_parser.parse_args()
|
args = cmd_parser.parse_args(args)
|
||||||
|
|
||||||
# set config values relevant to target machine
|
# set config values relevant to target machine
|
||||||
config.MICROPY_LONGINT_IMPL = {
|
config.MICROPY_LONGINT_IMPL = {
|
||||||
|
|||||||
Reference in New Issue
Block a user