Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: whitequark/glasgow
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b209775efd6c
Choose a base ref
...
head repository: whitequark/glasgow
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: af0df1714e6a
Choose a head ref
  • 1 commit
  • 11 files changed
  • 1 contributor

Commits on Mar 8, 2019

  1. applet: sort out required=True in add_subparsers().

    In code that uses add_subparsers to choose an interact operation,
    where not specifying an operation argument would not perform any
    action at all (as opposed to some identification action), ideally,
    required=True should be added. However, this is only available on
    Python 3.7, so we can't use it just yet.
    whitequark committed Mar 8, 2019
    Copy the full SHA
    af0df17 View commit details
1 change: 1 addition & 0 deletions software/glasgow/applet/audio/yamaha_opl/__init__.py
Original file line number Diff line number Diff line change
@@ -710,6 +710,7 @@ async def run(self, device, args):

@classmethod
def add_interact_arguments(cls, parser):
# TODO(py3.7): add required=True
p_operation = parser.add_subparsers(dest="operation", metavar="OPERATION")

p_convert = p_operation.add_parser(
1 change: 1 addition & 0 deletions software/glasgow/applet/control/tps6598x/__init__.py
Original file line number Diff line number Diff line change
@@ -69,6 +69,7 @@ def register(arg):
def hex_bytes(arg):
return bytes.fromhex(arg)

# TODO(py3.7): add required=True
p_operation = parser.add_subparsers(dest="operation", metavar="OPERATION")

p_read_reg = p_operation.add_parser(
1 change: 1 addition & 0 deletions software/glasgow/applet/debug/mips/__init__.py
Original file line number Diff line number Diff line change
@@ -845,6 +845,7 @@ async def run(self, device, args):

@classmethod
def add_interact_arguments(cls, parser):
# TODO(py3.7): add required=True
p_operation = parser.add_subparsers(dest="operation", metavar="OPERATION")

p_dump_state = p_operation.add_parser(
3 changes: 2 additions & 1 deletion software/glasgow/applet/interface/i2c_master/__init__.py
Original file line number Diff line number Diff line change
@@ -285,7 +285,8 @@ async def run(self, device, args):

@classmethod
def add_interact_arguments(cls, parser):
p_operation = parser.add_subparsers(dest="operation", metavar="OPERATION", required=True)
# TODO(py3.7): add required=True
p_operation = parser.add_subparsers(dest="operation", metavar="OPERATION")

def add_scan_id_argument(parser):
parser.add_argument(
1 change: 1 addition & 0 deletions software/glasgow/applet/interface/jtag_probe/__init__.py
Original file line number Diff line number Diff line change
@@ -692,6 +692,7 @@ def add_interact_arguments(cls, parser):
"--max-dr-length", metavar="LENGTH", type=int, default=1024,
help="give up scanning DR after LENGTH bits")

# TODO(py3.7): add required=True
p_operation = parser.add_subparsers(dest="operation", metavar="OPERATION")

p_scan = p_operation.add_parser(
1 change: 1 addition & 0 deletions software/glasgow/applet/interface/uart/__init__.py
Original file line number Diff line number Diff line change
@@ -80,6 +80,7 @@ async def run(self, device, args):

@classmethod
def add_interact_arguments(cls, parser):
# TODO(py3.7): add required=True
p_operation = parser.add_subparsers(dest="operation", metavar="OPERATION")

p_tty = p_operation.add_parser(
3 changes: 2 additions & 1 deletion software/glasgow/applet/memory/_24x/__init__.py
Original file line number Diff line number Diff line change
@@ -136,7 +136,8 @@ def length(arg):
def hex_bytes(arg):
return bytes.fromhex(arg)

p_operation = parser.add_subparsers(dest="operation", metavar="OPERATION", required=True)
# TODO(py3.7): add required=True
p_operation = parser.add_subparsers(dest="operation", metavar="OPERATION")

p_read = p_operation.add_parser(
"read", help="read memory")
3 changes: 2 additions & 1 deletion software/glasgow/applet/memory/_25x/__init__.py
Original file line number Diff line number Diff line change
@@ -263,7 +263,8 @@ def hex_bytes(arg):
def bits(arg):
return int(arg, 2)

p_operation = parser.add_subparsers(dest="operation", metavar="OPERATION")
# TODO(py3.7): add required=True
p_operation = parser.add_subparsers(dest="operation", metavar="OPERATION", required=True)

p_identify = p_operation.add_parser(
"identify", help="identify memory using REMS and RDID commands")
2 changes: 2 additions & 0 deletions software/glasgow/applet/memory/floppy/__init__.py
Original file line number Diff line number Diff line change
@@ -845,6 +845,7 @@ async def run(self, device, args):

@classmethod
def add_interact_arguments(cls, parser):
# TODO(py3.7): add required=True
p_operation = parser.add_subparsers(dest="operation", metavar="OPERATION")

p_read_raw = p_operation.add_parser(
@@ -956,6 +957,7 @@ class MemoryFloppyAppletTool(GlasgowAppletTool, applet=MemoryFloppyApplet):

@classmethod
def add_arguments(cls, parser):
# TODO(py3.7): add required=True
p_operation = parser.add_subparsers(dest="operation", metavar="OPERATION")

p_index = p_operation.add_parser(
1 change: 1 addition & 0 deletions software/glasgow/applet/memory/onfi/__init__.py
Original file line number Diff line number Diff line change
@@ -375,6 +375,7 @@ def count(arg):
"-B", "--block-size", metavar="SIZE", type=size,
help="Flash block size, in pages (default: autodetect)")

# TODO(py3.7): add required=True
p_operation = parser.add_subparsers(dest="operation", metavar="OPERATION")

p_read = p_operation.add_parser(
1 change: 1 addition & 0 deletions software/glasgow/applet/program/mec16xx/__init__.py
Original file line number Diff line number Diff line change
@@ -170,6 +170,7 @@ async def run(self, device, args):

@classmethod
def add_interact_arguments(cls, parser):
# TODO(py3.7): add required=True
p_operation = parser.add_subparsers(dest="operation", metavar="OPERATION")

p_emergency_erase = p_operation.add_parser(