@@ -230,7 +230,7 @@ def help_commands(self):
230
230
commands = ['' ]
231
231
for command in self .commands .values ():
232
232
h = _ (command .__doc__ ).split ('\n ' )[0 ]
233
- commands .append (' ' + h [7 :])
233
+ commands .append (' ' + h [7 :])
234
234
commands .sort ()
235
235
commands .append (_ (
236
236
"""Commands may be abbreviated as long as the abbreviation
@@ -550,7 +550,7 @@ def do_display(self, args):
550
550
raise UsageError (_ ('Not enough arguments supplied' ))
551
551
552
552
display_protected = self .settings ['display_protected' ]
553
- display_header = self .settings ['display_header' ]
553
+ display_header = self .settings ['display_header' ]
554
554
555
555
# decode the node designator
556
556
for designator in args [0 ].split (',' ):
@@ -627,7 +627,7 @@ class colon_separated(csv.excel):
627
627
sys .stdout .write ('Exporting %s WITHOUT the files\r \n ' %
628
628
classname )
629
629
630
- with open (os .path .join (export_dir , classname + '.csv' ), 'w' ) as f :
630
+ with open (os .path .join (export_dir , classname + '.csv' ), 'w' ) as f :
631
631
writer = csv .writer (f , colon_separated )
632
632
633
633
propnames = cl .export_propnames ()
@@ -676,7 +676,8 @@ class colon_separated(csv.excel):
676
676
cl .export_files (export_dir , nodeid )
677
677
678
678
# export the journals
679
- with open (os .path .join (export_dir , classname + '-journals.csv' ), 'w' ) as jf :
679
+ with open (os .path .join (export_dir ,
680
+ classname + '-journals.csv' ), 'w' ) as jf :
680
681
if self .verbose :
681
682
sys .stdout .write ("\n Exporting Journal for %s\n " %
682
683
classname )
@@ -766,7 +767,7 @@ def do_filter(self, args):
766
767
try :
767
768
output_items = cl .filter (None , ** props )
768
769
if self .print_designator :
769
- output_items = [ classname + i for i in output_items ]
770
+ output_items = [classname + i for i in output_items ]
770
771
771
772
if self .separator :
772
773
print (self .separator .join (output_items ))
@@ -815,7 +816,7 @@ def do_find(self, args):
815
816
try :
816
817
output_items = cl .find (** props )
817
818
if self .print_designator :
818
- output_items = [ classname + i for i in output_items ]
819
+ output_items = [classname + i for i in output_items ]
819
820
820
821
if self .separator :
821
822
print (self .separator .join (output_items ))
@@ -995,6 +996,7 @@ def do_history(self, args):
995
996
raw = 'raw' in args [1 :]
996
997
997
998
getclass = self .db .getclass
999
+
998
1000
def get_prop_name (key , prop_name ):
999
1001
# getclass and classname from enclosing method
1000
1002
klass = getclass (classname )
@@ -1064,7 +1066,7 @@ def format_report_class(_data):
1064
1066
"""Eat the empty data dictionary or None"""
1065
1067
return classname
1066
1068
1067
- def format_link (data ):
1069
+ def format_link (data ):
1068
1070
'''data = ('issue', '157', 'dependson')'''
1069
1071
# .Hint added issue23 to superseder
1070
1072
f = _ ("added %(class)s%(item_id)s to %(propname)s" )
@@ -1089,7 +1091,7 @@ def format_set(data):
1089
1091
# where assignedto is the property
1090
1092
# admin is the key name for value 1
1091
1093
_ ("%(prop)s was %(name)s(%(value)s)" ) % {
1092
- "prop" : prop , "name" : name , "value" : value })
1094
+ "prop" : prop , "name" : name , "value" : value })
1093
1095
else :
1094
1096
# use repr so strings with embedded \n etc. don't
1095
1097
# generate newlines in output. Try to keep each
@@ -1108,8 +1110,8 @@ def format_set(data):
1108
1110
else :
1109
1111
prop_class = get_prop_class (prop )
1110
1112
if prop_class : # noqa: SIM108
1111
- list_items = [ "%s%s" % (prop_class , v )
1112
- for v in value ]
1113
+ list_items = ["%s%s" % (prop_class , v )
1114
+ for v in value ]
1113
1115
else :
1114
1116
list_items = value
1115
1117
@@ -1128,7 +1130,7 @@ def format_set(data):
1128
1130
1129
1131
return '; ' .join (result )
1130
1132
1131
- def format_unlink (data ):
1133
+ def format_unlink (data ):
1132
1134
'''data = ('issue', '157', 'dependson')'''
1133
1135
return "removed %s%s from %s" % (data [0 ], data [1 ], data [2 ])
1134
1136
@@ -1252,10 +1254,10 @@ class colon_separated(csv.excel):
1252
1254
cl .import_journals (reader )
1253
1255
1254
1256
# (print to sys.stdout here to allow tests to squash it .. ugh)
1255
- print ('setting' , classname , maxid + 1 , file = sys .stdout )
1257
+ print ('setting' , classname , maxid + 1 , file = sys .stdout )
1256
1258
1257
1259
# set the id counter
1258
- self .db .setid (classname , str (maxid + 1 ))
1260
+ self .db .setid (classname , str (maxid + 1 ))
1259
1261
1260
1262
self .db_uncommitted = True
1261
1263
return 0
@@ -1487,7 +1489,7 @@ def do_list(self, args):
1487
1489
# create a list of propnames since user specified propname
1488
1490
proplist = []
1489
1491
try :
1490
- proplist = [ cl .get (nodeid , propname ) for nodeid in
1492
+ proplist = [cl .get (nodeid , propname ) for nodeid in
1491
1493
cl .getnodeids (retired = retired )]
1492
1494
except KeyError :
1493
1495
raise UsageError (_ ('%(classname)s has no property '
@@ -1638,15 +1640,15 @@ def do_perftest(self, args):
1638
1640
return
1639
1641
1640
1642
if props ['scheme' ].startswith ('PBKDF2' ):
1641
- (rounds , salt , _raw_salt , digest ) = password .pbkdf2_unpack (
1643
+ (rounds , _salt , _raw_salt , _digest ) = password .pbkdf2_unpack (
1642
1644
pw_hash )
1643
1645
else :
1644
1646
rounds = _ ("scheme does not support rounds." )
1645
1647
1646
1648
print (_ (
1647
1649
"Hash time: %(time)0.9f seconds, scheme: %(scheme)s, "
1648
1650
"rounds: %(rounds)s" ) %
1649
- {"time" : toc - tic , "scheme" : props ['scheme' ],
1651
+ {"time" : toc - tic , "scheme" : props ['scheme' ],
1650
1652
"rounds" : rounds })
1651
1653
1652
1654
def do_pragma (self , args ):
@@ -2348,8 +2350,7 @@ def interactive(self):
2348
2350
self .db .commit ()
2349
2351
2350
2352
# looks like histfile is saved with mode 600
2351
- if readline :
2352
- if self .history_features ('save_history' ):
2353
+ if readline and self .history_features ('save_history' ):
2353
2354
readline .write_history_file (histfile )
2354
2355
return 0
2355
2356
@@ -2405,7 +2406,7 @@ def main(self): # noqa: PLR0912, PLR0911
2405
2406
try :
2406
2407
self .do_pragma ([arg ])
2407
2408
except UsageError as e :
2408
- print ('\n %s\n ' % e )
2409
+ print ('\n %s\n ' % e )
2409
2410
elif opt == '-u' :
2410
2411
login_opt = arg .split (':' )
2411
2412
self .name = login_opt [0 ]
0 commit comments