@@ -516,7 +516,7 @@ def parseline(self, line):
516
516
elif line [0 ] == '?' :
517
517
line = 'help ' + line [1 :]
518
518
i , n = 0 , len (line )
519
- while i < n and line [i ] in self .identchars :
519
+ while i < n and line [i ] in self .identchars :
520
520
i = i + 1
521
521
cmd , arg = line [:i ], line [i :].strip ()
522
522
return cmd , arg , line
@@ -574,7 +574,7 @@ def do_help(self, argv):
574
574
doc = self .__class__ .__doc__ # try class docstring
575
575
if doc is None :
576
576
# Try to provide some reasonable useful default help.
577
- if self .cmdlooping :
577
+ if self .cmdlooping :
578
578
prefix = ""
579
579
else :
580
580
prefix = self .name + ' '
@@ -739,7 +739,7 @@ def _help_get_command_list(self):
739
739
token2canonical = self ._get_canonical_map ()
740
740
aliases = {}
741
741
for token , cmdname in token2canonical .items ():
742
- if token == cmdname :
742
+ if token == cmdname :
743
743
continue
744
744
aliases .setdefault (cmdname , []).append (token )
745
745
@@ -803,7 +803,7 @@ def _help_preprocess_help_list(self, help, cmdname=None):
803
803
helpnames = {}
804
804
token2cmdname = self ._get_canonical_map ()
805
805
for attr in self .get_names ():
806
- if not attr .startswith ("help_" ):
806
+ if not attr .startswith ("help_" ):
807
807
continue
808
808
helpname = attr [5 :]
809
809
if helpname not in token2cmdname :
@@ -854,9 +854,9 @@ def _help_preprocess_cmd_usage(self, help, cmdname=None):
854
854
855
855
# Adjust argcount for possible *args and **kwargs arguments.
856
856
argcount = co_argcount
857
- if co_flags & CO_FLAGS_ARGS :
857
+ if co_flags & CO_FLAGS_ARGS :
858
858
argcount += 1
859
- if co_flags & CO_FLAGS_KWARGS :
859
+ if co_flags & CO_FLAGS_KWARGS :
860
860
argcount += 1
861
861
862
862
# Determine the usage string.
@@ -937,9 +937,9 @@ def _get_canonical_map(self):
937
937
token2canonical = {}
938
938
cmd2funcname = {} # use a dict to strip duplicates
939
939
for attr in self .get_names ():
940
- if attr .startswith ("do_" ):
940
+ if attr .startswith ("do_" ):
941
941
cmdname = attr [3 :]
942
- elif attr .startswith ("_do_" ):
942
+ elif attr .startswith ("_do_" ):
943
943
cmdname = attr [4 :]
944
944
else :
945
945
continue
@@ -1371,12 +1371,12 @@ def line2argv(line):
1371
1371
i = - 1
1372
1372
while True :
1373
1373
i += 1
1374
- if i >= len (line ):
1374
+ if i >= len (line ):
1375
1375
break
1376
1376
ch = line [i ]
1377
1377
1378
1378
if ch == "\\ " : # escaped char always added to arg, regardless of state
1379
- if arg is None :
1379
+ if arg is None :
1380
1380
arg = ""
1381
1381
i += 1
1382
1382
arg += line [i ]
@@ -1394,19 +1394,19 @@ def line2argv(line):
1394
1394
arg += ch
1395
1395
elif state == "default" :
1396
1396
if ch == '"' :
1397
- if arg is None :
1397
+ if arg is None :
1398
1398
arg = ""
1399
1399
state = "double-quoted"
1400
1400
elif ch == "'" :
1401
- if arg is None :
1401
+ if arg is None :
1402
1402
arg = ""
1403
1403
state = "single-quoted"
1404
1404
elif ch in string .whitespace :
1405
1405
if arg is not None :
1406
1406
argv .append (arg )
1407
1407
arg = None
1408
1408
else :
1409
- if arg is None :
1409
+ if arg is None :
1410
1410
arg = ""
1411
1411
arg += ch
1412
1412
if arg is not None :
@@ -1485,7 +1485,7 @@ def _dedentlines(lines, tabsize=8, skip_first_line=False):
1485
1485
break
1486
1486
else :
1487
1487
continue # skip all-whitespace lines
1488
- if DEBUG :
1488
+ if DEBUG :
1489
1489
print ("dedent: indent=%d: %r" % (indent , line ))
1490
1490
if margin is None :
1491
1491
margin = indent
@@ -1496,7 +1496,7 @@ def _dedentlines(lines, tabsize=8, skip_first_line=False):
1496
1496
1497
1497
if margin is not None and margin > 0 :
1498
1498
for i , line in enumerate (lines ):
1499
- if i == 0 and skip_first_line :
1499
+ if i == 0 and skip_first_line :
1500
1500
continue
1501
1501
removed = 0
1502
1502
for j , ch in enumerate (line ):
@@ -1505,7 +1505,7 @@ def _dedentlines(lines, tabsize=8, skip_first_line=False):
1505
1505
elif ch == '\t ' :
1506
1506
removed += tabsize - (removed % tabsize )
1507
1507
elif ch in '\r \n ' :
1508
- if DEBUG :
1508
+ if DEBUG :
1509
1509
print ("dedent: %r: EOL -> strip up to EOL" % line )
1510
1510
lines [i ] = lines [i ][j :]
1511
1511
break
0 commit comments