1298 output = \ |
1298 output = \ |
1299 str(proc.readAllStandardOutput(), |
1299 str(proc.readAllStandardOutput(), |
1300 Preferences.getSystem("IOEncoding"), |
1300 Preferences.getSystem("IOEncoding"), |
1301 'replace').splitlines() |
1301 'replace').splitlines() |
1302 |
1302 |
1303 syntaxerror = output[0] == "ERROR" |
1303 if output: |
1304 if syntaxerror: |
1304 syntaxerror = output[0] == "ERROR" |
1305 fn = output[1] |
1305 if syntaxerror: |
1306 line = output[2] |
1306 fn = output[1] |
1307 index = output[3] |
1307 line = output[2] |
1308 code = output[4] |
1308 index = output[3] |
1309 error = output[5] |
1309 code = output[4] |
1310 return (True, fn, line, index, code, error, []) |
1310 error = output[5] |
|
1311 return (True, fn, line, index, code, error, []) |
|
1312 else: |
|
1313 index = 6 |
|
1314 warnings = [] |
|
1315 while len(output) - index > 3: |
|
1316 if output[index] == "FLAKES_ERROR": |
|
1317 return (True, output[index + 1], output[index + 2], "", |
|
1318 output[index + 3], []) |
|
1319 else: |
|
1320 warnings.append((output[index + 1], output[index + 2], |
|
1321 output[index + 3])) |
|
1322 index += 4 |
|
1323 |
|
1324 return (False, None, None, None, None, None, warnings) |
1311 else: |
1325 else: |
1312 index = 6 |
1326 return (False, "", "", "", "", "", []) |
1313 warnings = [] |
|
1314 while len(output) - index > 3: |
|
1315 if output[index] == "FLAKES_ERROR": |
|
1316 return (True, output[index + 1], output[index + 2], "", |
|
1317 output[index + 3], []) |
|
1318 else: |
|
1319 warnings.append((output[index + 1], output[index + 2], |
|
1320 output[index + 3])) |
|
1321 index += 4 |
|
1322 |
|
1323 return (False, None, None, None, None, None, warnings) |
|
1324 |
1327 |
1325 return (True, file, "1", "0", "", |
1328 return (True, file, "1", "0", "", |
1326 QCoreApplication.translate("Utilities", |
1329 QCoreApplication.translate("Utilities", |
1327 "Python2 interpreter did not finish within 30s."), |
1330 "Python2 interpreter did not finish within 30s."), |
1328 []) |
1331 []) |