Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Commit fbeb7df

Browse files
phhussonarchos-sa
authored andcommitted
Don't duplicate port path parsing
1 parent c74a7ee commit fbeb7df

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

adb/common_cli.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@
3030

3131
from adb import usb_exceptions
3232

33-
34-
class _PortPathAction(argparse.Action):
35-
def __call__(self, parser, namespace, values, option_string=None):
36-
setattr(
37-
namespace, self.dest,
38-
[int(i) for i in values.replace('/', ',').split(',')])
39-
40-
4133
class PositionalArg(argparse.Action):
4234
def __call__(self, parser, namespace, values, option_string=None):
4335
namespace.positional.append(values)
@@ -49,7 +41,7 @@ def GetDeviceArguments():
4941
'--timeout_ms', default=10000, type=int, metavar='10000',
5042
help='Timeout in milliseconds.')
5143
group.add_argument(
52-
'--port_path', action=_PortPathAction,
44+
'--port_path',
5345
help='USB port path integers (eg 1,2 or 2,1,1)')
5446
group.add_argument(
5547
'-s', '--serial',

0 commit comments

Comments
 (0)