From 5d977056f7aa216eae09a22c3baaff73546f6ff1 Mon Sep 17 00:00:00 2001 From: Cqoicebordel Date: Mon, 29 Dec 2014 21:31:04 +0100 Subject: Flake8 and Twitter corrections Lots of Flake8 corrections Maybe we should change the rule to allow lines of 120 chars. It seems more usable. Big twitter correction : now it outputs the words in right order... --- searx/engines/searchcode_code.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'searx/engines/searchcode_code.py') diff --git a/searx/engines/searchcode_code.py b/searx/engines/searchcode_code.py index 2ba0e52f1..0f98352c1 100644 --- a/searx/engines/searchcode_code.py +++ b/searx/engines/searchcode_code.py @@ -11,7 +11,6 @@ from urllib import urlencode from json import loads import cgi -import re # engine dependent config categories = ['it'] @@ -33,7 +32,7 @@ def request(query, params): # get response from search-request def response(resp): results = [] - + search_results = loads(resp.text) # parse results @@ -41,21 +40,22 @@ def response(resp): href = result['url'] title = "" + result['name'] + " - " + result['filename'] content = result['repo'] + "
" - + lines = dict() for line, code in result['lines'].items(): lines[int(line)] = code content = content + '
'
         for line, code in sorted(lines.items()):
-            content = content + '"
-            
+
         content = content + "
' - content = content + str(line) + '' - # Replace every two spaces with ' &nbps;' to keep formatting while allowing the browser to break the line if necessary - content = content + cgi.escape(code).replace('\t', ' ').replace(' ', '  ').replace(' ', '  ') + content = content + '
' + content = content + str(line) + '' + # Replace every two spaces with ' &nbps;' to keep formatting + # while allowing the browser to break the line if necessary + content = content + cgi.escape(code).replace('\t', ' ').replace(' ', '  ').replace(' ', '  ') content = content + "
" - + # append result results.append({'url': href, 'title': title, -- cgit v1.2.3