@@ -46,24 +46,23 @@ def recordArgument(self, arg_name, value):
4646
4747 def __repr__ (self ):
4848 print self .name
49- items = self .values .items ()
50- for i in range (len (items )):
51- print items [i ][0 ]," = " ,items [i ][1 ]
49+ for k , v in self .values .items ():
50+ print k , "=" , v
5251 return ''
5352
5453 def compare_args (self , other , file ):
5554 myitems = self .values .items ()
5655 otheritems = other .values .items ()
5756 match = False
58- for i in range ( len ( myitems ) ):
57+ for i , my_item in enumerate ( my_items ):
5958 if i >= len (otheritems ):
6059 match = True
61- self .missing_args .append (myitems [ i ] [0 ])
62- elif cmp (myitems [ i ] [1 ], otheritems [i ][1 ]):
60+ self .missing_args .append (myitem [0 ])
61+ elif cmp (myitem [1 ], otheritems [i ][1 ]):
6362 match = True
64- self .notmatching_args .append (myitems [ i ] [0 ])
63+ self .notmatching_args .append (myitem [0 ])
6564 else :
66- self .matching_args .append (myitems [ i ] [0 ])
65+ self .matching_args .append (myitem [0 ])
6766
6867 self .print_list (self .matching_args , " Matching arguments " , file )
6968 self .print_list (self .notmatching_args , " Not Matching arguments " , file )
@@ -108,9 +107,7 @@ def read_input(filename, dict):
108107
109108f = open (LOG_FILE , "w" )
110109f .write ("Log output\n " )
111- for f2bp in range (len (f2_items )):
112- id = f2_items [f2bp ][0 ]
113- bp = f2_items [f2bp ][1 ]
110+ for id , bp in f2_items :
114111 bp1 = f1_breakpoints .get (id )
115112 if bp1 is None :
116113 bp .setMissing ()
@@ -127,9 +124,7 @@ def read_input(filename, dict):
127124nf2_items = nf2_breakpoints .items ()
128125
129126nfl = open (NATIVE_LOG_FILE , "w" )
130- for nf2bp in range (len (nf2_items )):
131- id = nf2_items [nf2bp ][0 ]
132- bp = nf2_items [nf2bp ][1 ]
127+ for id , bp in nf2_items :
133128 bp1 = nf1_breakpoints .get (id )
134129 if bp1 is None :
135130 bp .setMissing ()
@@ -141,8 +136,8 @@ def read_input(filename, dict):
141136f1_matching_arg_count = 0
142137f1_notmatching_arg_count = 0
143138f1_missing_arg_count = 0
144- for idx in range ( len ( f1_items )) :
145- bp = f1_items [ idx ] [1 ]
139+ for f1_item in f1_items :
140+ bp = f1_item [1 ]
146141 f1_arg_count = f1_arg_count + bp .getArgCount ()
147142 f1_matching_arg_count = f1_matching_arg_count + bp .getMatchingArgCount ()
148143 f1_notmatching_arg_count = f1_notmatching_arg_count + bp .getNotMatchingArgCount ()
@@ -152,8 +147,8 @@ def read_input(filename, dict):
152147nf1_matching_arg_count = 0
153148nf1_notmatching_arg_count = 0
154149nf1_missing_arg_count = 0
155- for idx in range ( len ( nf1_items )) :
156- bp = nf1_items [ idx ] [1 ]
150+ for nf1_item in nf1_items :
151+ bp = nf1_item [1 ]
157152 nf1_arg_count = nf1_arg_count + bp .getArgCount ()
158153 nf1_matching_arg_count = nf1_matching_arg_count + bp .getMatchingArgCount ()
159154 nf1_notmatching_arg_count = nf1_notmatching_arg_count + bp .getNotMatchingArgCount ()
0 commit comments