diff options
author | Jim Mussared <jim.mussared@gmail.com> | 2022-09-29 00:45:34 +1000 |
---|---|---|
committer | Jim Mussared <jim.mussared@gmail.com> | 2022-10-01 22:44:24 +1000 |
commit | 12ca918eb2ac062f6e6df0772e528eef9d050cb7 (patch) | |
tree | 49be20380cce7d51d63a9dbf03b8628c622f1cb3 /tools/pyboard.py | |
parent | 68d094358ec71aa8cdec97e9e6fc3c6d46dedfbf (diff) |
tools/mpremote: Add `mpremote mip install` to install packages.
This supports the same package sources as the new `mip` tool.
- micropython-lib (by name)
- http(s) & github packages with json description
- directly downloading a .py/.mpy file
The version is specified with an optional `@version` on the end of the
package name. The target dir, index, and mpy/no-mpy can be set through
command line args.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'tools/pyboard.py')
-rwxr-xr-x | tools/pyboard.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/pyboard.py b/tools/pyboard.py index 60cc06508..043f4f06f 100755 --- a/tools/pyboard.py +++ b/tools/pyboard.py @@ -476,6 +476,13 @@ class Pyboard: t = str(self.eval("pyb.RTC().datetime()"), encoding="utf8")[1:-1].split(", ") return int(t[4]) * 3600 + int(t[5]) * 60 + int(t[6]) + def fs_exists(self, src): + try: + self.exec_("import uos\nuos.stat(%s)" % (("'%s'" % src) if src else "")) + return True + except PyboardError: + return False + def fs_ls(self, src): cmd = ( "import uos\nfor f in uos.ilistdir(%s):\n" |