Utilities/__init__.py

branch
5_2_x
changeset 1815
6ed2ac61a108
parent 1660
57f2bd52deb7
child 1840
7c1e74e196a9
equal deleted inserted replaced
1812:790aa44f5dcc 1815:6ed2ac61a108
1270 output = \ 1270 output = \
1271 str(proc.readAllStandardOutput(), 1271 str(proc.readAllStandardOutput(),
1272 Preferences.getSystem("IOEncoding"), 1272 Preferences.getSystem("IOEncoding"),
1273 'replace').splitlines() 1273 'replace').splitlines()
1274 1274
1275 syntaxerror = output[0] == "ERROR" 1275 if output:
1276 if syntaxerror: 1276 syntaxerror = output[0] == "ERROR"
1277 fn = output[1] 1277 if syntaxerror:
1278 line = output[2] 1278 fn = output[1]
1279 index = output[3] 1279 line = output[2]
1280 code = output[4] 1280 index = output[3]
1281 error = output[5] 1281 code = output[4]
1282 return (True, fn, line, index, code, error, []) 1282 error = output[5]
1283 return (True, fn, line, index, code, error, [])
1284 else:
1285 index = 6
1286 warnings = []
1287 while len(output) - index > 3:
1288 if output[index] == "FLAKES_ERROR":
1289 return (True, output[index + 1], output[index + 2], "",
1290 output[index + 3], [])
1291 else:
1292 warnings.append((output[index + 1], output[index + 2],
1293 output[index + 3]))
1294 index += 4
1295
1296 return (False, None, None, None, None, None, warnings)
1283 else: 1297 else:
1284 index = 6 1298 return (False, "", "", "", "", "", [])
1285 warnings = []
1286 while len(output) - index > 3:
1287 if output[index] == "FLAKES_ERROR":
1288 return (True, output[index + 1], output[index + 2], "",
1289 output[index + 3], [])
1290 else:
1291 warnings.append((output[index + 1], output[index + 2],
1292 output[index + 3]))
1293 index += 4
1294
1295 return (False, None, None, None, None, None, warnings)
1296 1299
1297 return (True, file, "1", "0", "", 1300 return (True, file, "1", "0", "",
1298 QCoreApplication.translate("Utilities", 1301 QCoreApplication.translate("Utilities",
1299 "Python2 interpreter did not finish within 30s."), 1302 "Python2 interpreter did not finish within 30s."),
1300 []) 1303 [])

eric ide

mercurial