@@ -46,24 +46,23 @@ def recordArgument(self, arg_name, value):
46
46
47
47
def __repr__ (self ):
48
48
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
52
51
return ''
53
52
54
53
def compare_args (self , other , file ):
55
54
myitems = self .values .items ()
56
55
otheritems = other .values .items ()
57
56
match = False
58
- for i in range ( len ( myitems ) ):
57
+ for i , my_item in enumerate ( my_items ):
59
58
if i >= len (otheritems ):
60
59
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 ]):
63
62
match = True
64
- self .notmatching_args .append (myitems [ i ] [0 ])
63
+ self .notmatching_args .append (myitem [0 ])
65
64
else :
66
- self .matching_args .append (myitems [ i ] [0 ])
65
+ self .matching_args .append (myitem [0 ])
67
66
68
67
self .print_list (self .matching_args , " Matching arguments " , file )
69
68
self .print_list (self .notmatching_args , " Not Matching arguments " , file )
@@ -108,9 +107,7 @@ def read_input(filename, dict):
108
107
109
108
f = open (LOG_FILE , "w" )
110
109
f .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 :
114
111
bp1 = f1_breakpoints .get (id )
115
112
if bp1 is None :
116
113
bp .setMissing ()
@@ -127,9 +124,7 @@ def read_input(filename, dict):
127
124
nf2_items = nf2_breakpoints .items ()
128
125
129
126
nfl = 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 :
133
128
bp1 = nf1_breakpoints .get (id )
134
129
if bp1 is None :
135
130
bp .setMissing ()
@@ -141,8 +136,8 @@ def read_input(filename, dict):
141
136
f1_matching_arg_count = 0
142
137
f1_notmatching_arg_count = 0
143
138
f1_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 ]
146
141
f1_arg_count = f1_arg_count + bp .getArgCount ()
147
142
f1_matching_arg_count = f1_matching_arg_count + bp .getMatchingArgCount ()
148
143
f1_notmatching_arg_count = f1_notmatching_arg_count + bp .getNotMatchingArgCount ()
@@ -152,8 +147,8 @@ def read_input(filename, dict):
152
147
nf1_matching_arg_count = 0
153
148
nf1_notmatching_arg_count = 0
154
149
nf1_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 ]
157
152
nf1_arg_count = nf1_arg_count + bp .getArgCount ()
158
153
nf1_matching_arg_count = nf1_matching_arg_count + bp .getMatchingArgCount ()
159
154
nf1_notmatching_arg_count = nf1_notmatching_arg_count + bp .getNotMatchingArgCount ()
0 commit comments