| ''' + file_py + ' | '
+ list_res = res.split('\n')
+ temp_dict = {}
+ keys = ['imported but unused statements', 'unable to detect undefined names', \
+ 'undefined name', 'redefinition of unused from line', \
+ 'import shadowed by loop variable', 'local variables referenced before assignment', \
+ 'duplicate argument in function definition', 'redefinition of function from line', \
+ 'future import after other statements']
+ map(lambda key:temp_dict.setdefault(key, 0), keys)
+ detail_str = ''
+ for line in list_res:
+ self.result_details += '''| ''' + line + ' | '
+ detail_str += line + '\n'
+ if line.find("imported but unused") != -1:
+ temp_dict['imported but unused statements'] += 1
+ elif line.find("*' used; unable to detect undefined names") != -1:
+ temp_dict['unable to detect undefined names'] += 1
+ elif line.find("undefined name") != -1:
+ temp_dict['undefined name'] += 1
+ elif line.find("redefinition of unused") != -1:
+ temp_dict['redefinition of unused from line'] += 1
+ elif line.find("shadowed by loop variable") != -1:
+ temp_dict['import shadowed by loop variable'] += 1
+ elif line.find("referenced before assignment") != -1:
+ temp_dict['local variables referenced before assignment'] += 1
+ elif line.find("in function definition") != -1:
+ temp_dict['duplicate argument in function definition'] += 1
+ elif line.find("redefinition of function") != -1:
+ temp_dict['redefinition of function from line'] += 1
+ elif line.find("after other statements") != -1:
+ temp_dict['future import after other statements'] += 1
+ final_str = '\n'
+ for t in temp_dict:
+ if str(temp_dict[t]) != '0':
+ final_str += '\n' + str(t) + ' : ' + str(temp_dict[t]) + '\n'
+ except:
+ self.result += _("Error! Is pyflakes correctly installed? (http://pypi.python.org/pypi/pyflakes/0.3.0)")+"\n"
+ break
+ try:
+ dict_py[file_py] = [file_py, final_str]
+ except:
+ dict_py[file_py] = [file_py, _("Unable to parse the result. Check the details.")]
+ self.result_details += ' | '
+ if not flag:
+ self.error = True
+ self.result = _("No python file found")
+ return None
+ self.result_details += '