Skip to content

Commit 8f2a460

Browse files
curiouswalaclaude
andcommitted
feat: add __main__.py, fix regex warning, document all commands in README
- Add ampy/__main__.py so the package can be invoked with python -m ampy (PR #121) - Fix SyntaxWarning: use raw string r"^COM(\d+)$" in windows_full_port_name (PR #129) - Document mkdir, rmdir, and reset commands in README command list, align column widths for readability (PR #115) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b30e223 commit 8f2a460

3 files changed

Lines changed: 13 additions & 6 deletions

File tree

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,14 @@ You should see usage information displayed like below:
5858
--help Show this message and exit.
5959

6060
Commands:
61-
get Retrieve a file from the board.
62-
ls List contents of a directory on the board.
63-
put Put a file on the board.
64-
rm Remove a file from the board.
65-
run Run a script and print its output.
61+
get Retrieve a file from the board.
62+
ls List contents of a directory on the board.
63+
mkdir Create a directory on the board.
64+
put Put a file or folder and its contents on the board.
65+
rm Remove a file from the board.
66+
rmdir Forcefully remove a folder and all its children from the board.
67+
run Run a script and print its output.
68+
reset Perform soft reset/reboot of the board.
6669

6770
If you'd like to install from the Github source then use the standard Python
6871
setup.py install (or develop mode):

ampy/__main__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from ampy.cli import cli
2+
3+
if __name__ == "__main__":
4+
cli()

ampy/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def windows_full_port_name(portname):
6363
# 9 are just referred to by COM1, COM2, etc. (wacky!) See this post for
6464
# more info and where this code came from:
6565
# http://eli.thegreenplace.net/2009/07/31/listing-all-serial-ports-on-windows-with-python/
66-
m = re.match("^COM(\d+)$", portname)
66+
m = re.match(r"^COM(\d+)$", portname)
6767
if m and int(m.group(1)) < 10:
6868
return portname
6969
else:

0 commit comments

Comments
 (0)