Index: trunk/fundraiser-statistics/fundraiser-scripts/mine_landing_pages.py |
— | — | @@ -73,6 +73,9 @@ |
74 | 74 | print >> sys.stdout, "Could not execute delete statement, DIFF too large\ndiff = " + str(time_diff) + "\ntime_start = " + start + "\ntime_end = " + end + "\nResuming insert ..." |
75 | 75 | |
76 | 76 | |
| 77 | + count_correct = 0 |
| 78 | + count_total = 0 |
| 79 | + |
77 | 80 | # PROCESS LOG FILE |
78 | 81 | # ================ |
79 | 82 | line = logFile.readline() |
— | — | @@ -220,7 +223,7 @@ |
221 | 224 | |
222 | 225 | except: |
223 | 226 | landing_page = 'NONE' |
224 | | - country = mh.localize_IP(ip_add) + ' !' |
| 227 | + country = mh.localize_IP(cur, ip_add) |
225 | 228 | |
226 | 229 | else: # ...wikimediafoundation.org/wiki/... |
227 | 230 | |
— | — | @@ -241,12 +244,11 @@ |
242 | 245 | country = landing_path[3] |
243 | 246 | |
244 | 247 | except: |
245 | | - country = mh.localize_IP(ip_add) + ' !' |
| 248 | + country = mh.localize_IP(cur, ip_add) |
246 | 249 | |
247 | 250 | # If country is confused with the language use the ip |
248 | 251 | if country == country.lower(): |
249 | | - country = mh.localize_IP(ip_add) + ' !' |
250 | | - |
| 252 | + country = mh.localize_IP(cur, ip_add) |
251 | 253 | |
252 | 254 | # ensure fields exist |
253 | 255 | try: |
— | — | @@ -272,11 +274,9 @@ |
273 | 275 | print "Could not insert:\n" + insertStmt_lp + val |
274 | 276 | pass |
275 | 277 | |
276 | | - |
277 | 278 | line = logFile.readline() |
278 | 279 | |
| 280 | + |
279 | 281 | |
280 | | - |
281 | | - |
282 | 282 | |
283 | 283 | |