From c58e5a236ae56b7e0c66c39f2234627234cf562b Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Sun, 5 Oct 2014 13:37:26 +0200 Subject: [PATCH 01/22] [fix] preferences button display --- searx/static/default/css/style.css | 2 +- searx/static/default/less/style.less | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/searx/static/default/css/style.css b/searx/static/default/css/style.css index 182a08e32..70265b072 100644 --- a/searx/static/default/css/style.css +++ b/searx/static/default/css/style.css @@ -77,5 +77,5 @@ tr:hover{background:#ddd} #preferences{top:10px;padding:0;border:0;background:url('../img/preference-icon.png') no-repeat;background-size:28px 28px;opacity:.8;width:28px;height:30px;display:block}#preferences *{display:none} #pagination{clear:both;width:40em} #apis{margin-top:8px;clear:both} -@media screen and (max-width:50em){#results{margin:auto;padding:0;width:90%} .github{display:none} .checkbox_container{display:block;width:90%}.checkbox_container label{border-bottom:0}}@media screen and (max-width:75em){#infoboxes{position:inherit;max-width:inherit}#infoboxes .infobox{clear:both}#infoboxes .infobox img{float:left;max-width:10em} #categories{font-size:90%;clear:both}#categories .checkbox_container{margin-top:2px;margin:auto} .right{display:none;postion:fixed !important;top:100px;right:0} #sidebar{position:static;max-width:50em;margin:0 0 2px 0;padding:0;float:none;border:none;width:auto}#sidebar input{border:0} #apis{display:none} #search_url{display:none} .result{border-top:1px solid #e8e7e6;margin:7px 0 6px 0}}.favicon{float:left;margin-right:4px;margin-top:2px} +@media screen and (max-width:50em){#results{margin:auto;padding:0;width:90%} .github{display:none} .checkbox_container{display:block;width:90%}.checkbox_container label{border-bottom:0} .right{display:none;postion:fixed !important;top:100px;right:0}}@media screen and (max-width:75em){#infoboxes{position:inherit;max-width:inherit}#infoboxes .infobox{clear:both}#infoboxes .infobox img{float:left;max-width:10em} #categories{font-size:90%;clear:both}#categories .checkbox_container{margin-top:2px;margin:auto} #sidebar{position:static;max-width:50em;margin:0 0 2px 0;padding:0;float:none;border:none;width:auto}#sidebar input{border:0} #apis{display:none} #search_url{display:none} .result{border-top:1px solid #e8e7e6;margin:7px 0 6px 0}}.favicon{float:left;margin-right:4px;margin-top:2px} .preferences_back{background:none repeat scroll 0 0 #3498db;border:0 none;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;cursor:pointer;display:inline-block;margin:2px 4px;padding:4px 6px}.preferences_back a{color:#fff} diff --git a/searx/static/default/less/style.less b/searx/static/default/less/style.less index 091728603..c43c0fe72 100644 --- a/searx/static/default/less/style.less +++ b/searx/static/default/less/style.less @@ -529,6 +529,14 @@ tr { border-bottom: 0; } } + + .right { + display: none; + postion: fixed !important; + top: 100px; + right: 0px; + } + } @media screen and (max-width: 75em) { @@ -558,13 +566,6 @@ tr { } } - .right { - display: none; - postion: fixed !important; - top: 100px; - right: 0px; - } - #sidebar { position: static; max-width: @results-width; From 032eb2354e781e3cf1ed707b1e8c2ca90b0a1638 Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Sun, 5 Oct 2014 17:13:39 +0200 Subject: [PATCH 02/22] add japanese translation --- searx/settings.yml | 1 + searx/translations/ja/LC_MESSAGES/messages.mo | Bin 0 -> 2477 bytes searx/translations/ja/LC_MESSAGES/messages.po | 215 ++++++++++++++++++ 3 files changed, 216 insertions(+) create mode 100644 searx/translations/ja/LC_MESSAGES/messages.mo create mode 100644 searx/translations/ja/LC_MESSAGES/messages.po diff --git a/searx/settings.yml b/searx/settings.yml index fb71b5ff2..8586b5069 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -166,3 +166,4 @@ locales: es : Español it : Italiano nl : Nederlands + ja : 日本語 (Japanese) diff --git a/searx/translations/ja/LC_MESSAGES/messages.mo b/searx/translations/ja/LC_MESSAGES/messages.mo new file mode 100644 index 0000000000000000000000000000000000000000..d91b5b1dae88607d17fb3e93b3e7031a3e3cc7b0 GIT binary patch literal 2477 zcmds%TZmgl7{|w2Z5y?=Md^br%$r->lP0}LNiTFSsYH@(NYaA%P-agi+0#8a6VJ@q z?NUXX;I)*Bx`oz4-Ck5!EtLu?ZXcwGAU+jDkSfY)vRj1pL8QJY{=ek3wNOFuNyABg z^WEqB&Sbt{v2c>%(~Ivae4oC9q?@113mCf#;&&e+}LT{s7(& z&V%It2T1v23sDnX4n7G=kox%y#KXRbaH}hBh-X(Y}W58dz1|b zBdf}vU;}~gOV79yJkYYtwG_TR!lhSrJgM2Btcbuh-0r$Nq*CLat3;XmQp2QKy5q|| zQIpr#+6XfEzQR5-o{@e<*pj=#s|KPfSx%Y}Rc1p$ZCLtTRc_?U!^$bU<~>^4Ygpcw z6^RYns9dxaYDVC7M0U5pirr1`DrB!OE6R_@E_}(g z!QRW<@w&;Qdc8>Fz=7VIMq2JE!;!1w-L;j45nK$bz;ttWmTVZcSjBPCKvjCu7cO&Z zn4M;hVKq@_wLs%tdvaXkXP@D98hiaO!^C>bQ7GB5XfY<4R<Mo$>6>GQtYD{W(C%GPe2N{l|m^M##{rw2-Wce+r_ z>>P>}WL^2j%IT_8w)%srwn{3+)49G(c6;C8U?E*B#_~H$)_^Z@gq3Fv;y9-Gxsw|-OCFDtaMO1|*4EAVnse8;YAmJjvi(tOJ; zrMJbh(YdusQq)p>ui#s<+3l_qSAKO{Ebj)GzqLd8HJ##Ky(8+a$<4gG+?t5xGP(54 z_LK2MY(U{(;b8+4b#!9ziq_U$;dq<5JtBM@ovneXSetJ8(MIu4u+pBb$~aajzG>Jo zvBx@Z-$=}DBE|c~uylDczCQMUybI>ueZO_~*gv`k+NY1tet0rGa5QWjyxm36KKyEX z>ZSkc9S|OvzIr6;u6q@P&B?Ga6*f+X&1n`k-VPh@gv}#t_KiusIVpK4Ir%*I(PKC`E!^WwwagwzTPNMR^zdQZ}<)q1Q literal 0 HcmV?d00001 diff --git a/searx/translations/ja/LC_MESSAGES/messages.po b/searx/translations/ja/LC_MESSAGES/messages.po new file mode 100644 index 000000000..510a77eae --- /dev/null +++ b/searx/translations/ja/LC_MESSAGES/messages.po @@ -0,0 +1,215 @@ +# Japanese translations for PROJECT. +# Copyright (C) 2014 ORGANIZATION +# This file is distributed under the same license as the PROJECT project. +# FIRST AUTHOR , 2014. +# +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2014-10-05 16:45+0200\n" +"PO-Revision-Date: 2014-10-05 16:38+0200\n" +"Last-Translator: FULL NAME \n" +"Language-Team: ja \n" +"Plural-Forms: nplurals=1; plural=0\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" + +#: searx/webapp.py:251 +msgid "{minutes} minute(s) ago" +msgstr "" + +#: searx/webapp.py:253 +msgid "{hours} hour(s), {minutes} minute(s) ago" +msgstr "" + +#: searx/engines/__init__.py:176 +msgid "Page loads (sec)" +msgstr "" + +#: searx/engines/__init__.py:180 +msgid "Number of results" +msgstr "" + +#: searx/engines/__init__.py:184 +msgid "Scores" +msgstr "" + +#: searx/engines/__init__.py:188 +msgid "Scores per result" +msgstr "" + +#: searx/engines/__init__.py:192 +msgid "Errors" +msgstr "" + +#: searx/templates/courgette/index.html:8 searx/templates/default/index.html:8 +msgid "about" +msgstr "に関する" + +#: searx/templates/courgette/index.html:9 searx/templates/default/index.html:9 +msgid "preferences" +msgstr "設定" + +#: searx/templates/courgette/preferences.html:5 +#: searx/templates/default/preferences.html:5 +msgid "Preferences" +msgstr "設定" + +#: searx/templates/courgette/preferences.html:9 +#: searx/templates/default/preferences.html:9 +msgid "Default categories" +msgstr "" + +#: searx/templates/courgette/preferences.html:15 +#: searx/templates/default/preferences.html:15 +msgid "Search language" +msgstr "" + +#: searx/templates/courgette/preferences.html:18 +#: searx/templates/default/preferences.html:18 +msgid "Automatic" +msgstr "" + +#: searx/templates/courgette/preferences.html:26 +#: searx/templates/default/preferences.html:26 +msgid "Interface language" +msgstr "" + +#: searx/templates/courgette/preferences.html:36 +#: searx/templates/default/preferences.html:36 +msgid "Autocomplete" +msgstr "" + +#: searx/templates/courgette/preferences.html:47 +#: searx/templates/default/preferences.html:47 +msgid "Method" +msgstr "" + +#: searx/templates/courgette/preferences.html:56 +#: searx/templates/default/preferences.html:56 +msgid "Themes" +msgstr "" + +#: searx/templates/courgette/preferences.html:66 +#: searx/templates/default/preferences.html:66 +msgid "Currently used search engines" +msgstr "" + +#: searx/templates/courgette/preferences.html:70 +#: searx/templates/default/preferences.html:70 +msgid "Engine name" +msgstr "" + +#: searx/templates/courgette/preferences.html:71 +#: searx/templates/default/preferences.html:71 +msgid "Category" +msgstr "" + +#: searx/templates/courgette/preferences.html:72 +#: searx/templates/courgette/preferences.html:83 +#: searx/templates/default/preferences.html:72 +#: searx/templates/default/preferences.html:83 +msgid "Allow" +msgstr "" + +#: searx/templates/courgette/preferences.html:72 +#: searx/templates/courgette/preferences.html:84 +#: searx/templates/default/preferences.html:72 +#: searx/templates/default/preferences.html:84 +msgid "Block" +msgstr "" + +#: searx/templates/courgette/preferences.html:92 +#: searx/templates/default/preferences.html:92 +msgid "" +"These settings are stored in your cookies, this allows us not to store " +"this data about you." +msgstr "" + +#: searx/templates/courgette/preferences.html:94 +#: searx/templates/default/preferences.html:94 +msgid "" +"These cookies serve your sole convenience, we don't use these cookies to " +"track you." +msgstr "" + +#: searx/templates/courgette/preferences.html:97 +#: searx/templates/default/preferences.html:97 +msgid "save" +msgstr "" + +#: searx/templates/courgette/preferences.html:98 +#: searx/templates/default/preferences.html:98 +msgid "back" +msgstr "" + +#: searx/templates/courgette/results.html:12 +#: searx/templates/default/results.html:12 +msgid "Search URL" +msgstr "" + +#: searx/templates/courgette/results.html:16 +#: searx/templates/default/results.html:16 +msgid "Download results" +msgstr "" + +#: searx/templates/courgette/results.html:34 +#: searx/templates/default/results.html:42 +msgid "Suggestions" +msgstr "提案" + +#: searx/templates/courgette/results.html:62 +#: searx/templates/default/results.html:78 +msgid "previous page" +msgstr "前のページ" + +#: searx/templates/courgette/results.html:73 +#: searx/templates/default/results.html:89 +msgid "next page" +msgstr "次のページ" + +#: searx/templates/courgette/search.html:3 +#: searx/templates/default/search.html:3 +msgid "Search for..." +msgstr "検索する..." + +#: searx/templates/courgette/stats.html:4 searx/templates/default/stats.html:4 +msgid "Engine stats" +msgstr "" + +#: searx/templates/default/results.html:34 +msgid "Answers" +msgstr "" + +# categories - manually added +# TODO - automatically add +msgid "files" +msgstr "ファイル" + +msgid "general" +msgstr "ウェブ" + +msgid "map" +msgstr "地図" + +msgid "music" +msgstr "音楽" + +msgid "social media" +msgstr "ソーシャルメディア" + +msgid "images" +msgstr "画像" + +msgid "videos" +msgstr "動画" + +msgid "it" +msgstr "情報技術" + +msgid "news" +msgstr "ニュース" + From 4da795895d3699e0c185a344806d60b40027cc4f Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Thu, 9 Oct 2014 19:26:02 +0200 Subject: [PATCH 03/22] [fix] default template handling --- searx/webapp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/searx/webapp.py b/searx/webapp.py index 74f8fad7e..18dc89a39 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -55,8 +55,8 @@ static_path, templates_path, themes =\ get_themes(settings['themes_path'] if settings.get('themes_path') else searx_dir) -default_theme = settings['default_theme'] if \ - settings.get('default_theme', None) else 'default' + +default_theme = settings['server'].get('default_theme', 'default') app = Flask( __name__, From 599c1137bbc2927c7f0d387ccd65daa2a30a6bf4 Mon Sep 17 00:00:00 2001 From: dalf Date: Sat, 11 Oct 2014 12:46:12 +0200 Subject: [PATCH 04/22] [fix] the bang was included in the search string --- searx/search.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/searx/search.py b/searx/search.py index 0aa9d500a..064c68844 100644 --- a/searx/search.py +++ b/searx/search.py @@ -311,9 +311,6 @@ class Search(object): if not self.request_data.get('q'): raise Exception('noquery') - # set query - self.query = self.request_data['q'] - # set pagenumber pageno_param = self.request_data.get('pageno', '1') if not pageno_param.isdigit() or int(pageno_param) < 1: @@ -322,8 +319,11 @@ class Search(object): self.pageno = int(pageno_param) # parse query, if tags are set, which change the serch engine or search-language - query_obj = Query(self.query, self.blocked_engines) - query_obj.parse_query() + query_obj = Query(self.request_data['q'], self.blocked_engines) + query_obj.parse_query() + + # set query + self.query = query_obj.getSearchQuery() # get last selected language in query, if possible # TODO support search with multible languages From 295b1699ced9b79f3b6e5e4375460ca6ddb64431 Mon Sep 17 00:00:00 2001 From: dalf Date: Sat, 11 Oct 2014 12:47:30 +0200 Subject: [PATCH 05/22] [mod] return only one result from the wikidata engine --- searx/engines/wikidata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searx/engines/wikidata.py b/searx/engines/wikidata.py index 8c8e7f219..9ba5fcd0b 100644 --- a/searx/engines/wikidata.py +++ b/searx/engines/wikidata.py @@ -2,7 +2,7 @@ import json from requests import get from urllib import urlencode -resultCount=2 +resultCount=1 urlSearch = 'https://www.wikidata.org/w/api.php?action=query&list=search&format=json&srnamespace=0&srprop=sectiontitle&{query}' urlDetail = 'https://www.wikidata.org/w/api.php?action=wbgetentities&format=json&props=labels%7Cinfo%7Csitelinks%7Csitelinks%2Furls%7Cdescriptions%7Cclaims&{query}' urlMap = 'https://www.openstreetmap.org/?lat={latitude}&lon={longitude}&zoom={zoom}&layers=M' From cac1761a54d4d72f9000e40cc04f05da3d78b7da Mon Sep 17 00:00:00 2001 From: dalf Date: Sat, 11 Oct 2014 15:49:50 +0200 Subject: [PATCH 06/22] [enh] infoboxes : if the result doesn't contain anything except one link, use the normal result template --- searx/engines/duckduckgo_definitions.py | 27 ++++++----- searx/engines/wikidata.py | 60 +++++++++++++++++-------- 2 files changed, 58 insertions(+), 29 deletions(-) diff --git a/searx/engines/duckduckgo_definitions.py b/searx/engines/duckduckgo_definitions.py index 3da7352a4..c008f22f7 100644 --- a/searx/engines/duckduckgo_definitions.py +++ b/searx/engines/duckduckgo_definitions.py @@ -116,15 +116,22 @@ def response(resp): if len(heading)>0: # TODO get infobox.meta.value where .label='article_title' - results.append({ - 'infobox': heading, - 'id': infobox_id, - 'entity': entity, - 'content': content, - 'img_src' : image, - 'attributes': attributes, - 'urls': urls, - 'relatedTopics': relatedTopics - }) + if image==None and len(attributes)==0 and len(urls)==1 and len(relatedTopics)==0 and len(content)==0: + results.append({ + 'url': urls[0]['url'], + 'title': heading, + 'content': content + }) + else: + results.append({ + 'infobox': heading, + 'id': infobox_id, + 'entity': entity, + 'content': content, + 'img_src' : image, + 'attributes': attributes, + 'urls': urls, + 'relatedTopics': relatedTopics + }) return results diff --git a/searx/engines/wikidata.py b/searx/engines/wikidata.py index 9ba5fcd0b..761f8f73c 100644 --- a/searx/engines/wikidata.py +++ b/searx/engines/wikidata.py @@ -33,17 +33,20 @@ def response(resp): return results def getDetail(jsonresponse, wikidata_id, language): - result = jsonresponse.get('entities', {}).get(wikidata_id, {}) - - title = result.get('labels', {}).get(language, {}).get('value', None) - if title == None: - title = result.get('labels', {}).get('en', {}).get('value', wikidata_id) results = [] urls = [] attributes = [] - description = result.get('descriptions', {}).get(language, {}).get('value', '') - if description == '': + result = jsonresponse.get('entities', {}).get(wikidata_id, {}) + + title = result.get('labels', {}).get(language, {}).get('value', None) + if title == None: + title = result.get('labels', {}).get('en', {}).get('value', None) + if title == None: + return results + + description = result.get('descriptions', {}).get(language, {}).get('value', None) + if description == None: description = result.get('descriptions', {}).get('en', {}).get('value', '') claims = result.get('claims', {}) @@ -52,11 +55,16 @@ def getDetail(jsonresponse, wikidata_id, language): urls.append({ 'title' : 'Official site', 'url': official_website }) results.append({ 'title': title, 'url' : official_website }) + wikipedia_link_count = 0 if language != 'en': - add_url(urls, 'Wikipedia (' + language + ')', get_wikilink(result, language + 'wiki')) + wikipedia_link_count += add_url(urls, 'Wikipedia (' + language + ')', get_wikilink(result, language + 'wiki')) wikipedia_en_link = get_wikilink(result, 'enwiki') - add_url(urls, 'Wikipedia (en)', wikipedia_en_link) - + wikipedia_link_count += add_url(urls, 'Wikipedia (en)', wikipedia_en_link) + if wikipedia_link_count == 0: + misc_language = get_wiki_firstlanguage(result, 'wiki') + if misc_language != None: + add_url(urls, 'Wikipedia (' + misc_language + ')', get_wikilink(result, misc_language + 'wiki')) + if language != 'en': add_url(urls, 'Wiki voyage (' + language + ')', get_wikilink(result, language + 'wikivoyage')) add_url(urls, 'Wiki voyage (en)', get_wikilink(result, 'enwikivoyage')) @@ -105,14 +113,20 @@ def getDetail(jsonresponse, wikidata_id, language): if date_of_death != None: attributes.append({'label' : 'Date of death', 'value' : date_of_death}) - - results.append({ - 'infobox' : title, - 'id' : wikipedia_en_link, - 'content' : description, - 'attributes' : attributes, - 'urls' : urls - }) + if len(attributes)==0 and len(urls)==2 and len(description)==0: + results.append({ + 'url': urls[0]['url'], + 'title': title, + 'content': description + }) + else: + results.append({ + 'infobox' : title, + 'id' : wikipedia_en_link, + 'content' : description, + 'attributes' : attributes, + 'urls' : urls + }) return results @@ -120,7 +134,9 @@ def getDetail(jsonresponse, wikidata_id, language): def add_url(urls, title, url): if url != None: urls.append({'title' : title, 'url' : url}) - + return 1 + else: + return 0 def get_mainsnak(claims, propertyName): propValue = claims.get(propertyName, {}) @@ -213,3 +229,9 @@ def get_wikilink(result, wikiid): elif url.startswith('//'): url = 'https:' + url return url + +def get_wiki_firstlanguage(result, wikipatternid): + for k in result.get('sitelinks', {}).keys(): + if k.endswith(wikipatternid) and len(k)==(2+len(wikipatternid)): + return k[0:2] + return None From 13f36e667572c57fb3e5f279102294cc36c07d49 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Sun, 12 Oct 2014 13:06:11 +0200 Subject: [PATCH 07/22] [enh] translation updates --- searx/translations/de/LC_MESSAGES/messages.mo | Bin 2387 -> 2549 bytes searx/translations/de/LC_MESSAGES/messages.po | 148 ++++++++++------- searx/translations/en/LC_MESSAGES/messages.mo | Bin 2278 -> 2492 bytes searx/translations/en/LC_MESSAGES/messages.po | 122 ++++++++++---- searx/translations/es/LC_MESSAGES/messages.mo | Bin 2458 -> 2600 bytes searx/translations/es/LC_MESSAGES/messages.po | 149 ++++++++++------- searx/translations/fr/LC_MESSAGES/messages.mo | Bin 2473 -> 2613 bytes searx/translations/fr/LC_MESSAGES/messages.po | 151 +++++++++++------- searx/translations/hu/LC_MESSAGES/messages.mo | Bin 2338 -> 2545 bytes searx/translations/hu/LC_MESSAGES/messages.po | 138 ++++++++++------ searx/translations/it/LC_MESSAGES/messages.mo | Bin 2439 -> 2566 bytes searx/translations/it/LC_MESSAGES/messages.po | 145 ++++++++++------- searx/translations/nl/LC_MESSAGES/messages.mo | Bin 2396 -> 2520 bytes searx/translations/nl/LC_MESSAGES/messages.po | 143 +++++++++++------ 14 files changed, 639 insertions(+), 357 deletions(-) diff --git a/searx/translations/de/LC_MESSAGES/messages.mo b/searx/translations/de/LC_MESSAGES/messages.mo index dc2922786b8213e7ab50c5343f040d1f84ac7244..553d3d9d06dffeb21c7bc5954c63921ac04cd07c 100644 GIT binary patch delta 1069 zcmZwEPe>F|9Ki9ntNX|NQ);M{*$@Q&t5y;G(;?JDm~4l(i+ZSKeeMqK&dBVHOG=1! z=+dbv>R_k5ltf^if+7l{z#uTZL=i?EIz$Fhp6dIvjV=vu-e=zLz2Eyct2N(i=ib$n zUR6A8yp6nWKwAHvm7r1~nlG^eSFsG=7vrBXO8YDB#Z9ci`VysfU@Mm65tRI67{*h` zxH&ae3|LrAhli4Q5hd|@v464Hzl7U}Kg3FWj@xk!W&9_U1-@YdH*pN(rGE}`3n}XE zR(npV`+P(QJU~f&f*eA0iidv(R8+e1V;762=Y#>GbqLP!Ak|gt0V>32j zJ@(@jZg~WwtgpT>st$jkOjyNkb3{ibJiUT;0H&8aZk4pMmiguvH zd#PldL6n<4jvQXa%lQBDksu%ojiBsMqin!M`M2khqApWO{{qT{OW2CbC|COyRev^X z7gWFJ+9^9XmDR4^YUGlxnNkB;J2j~WldewN&RI3+-wC?mxOOx4xNnrq2XoqAC|L_8 zr~IkX^~&CZv2LTYqpz#GE!OFu4(%x;(qqKB`(pPlgmwjLrnNI|XR~?t>7q4mradd| zUkeWfCjIsB(F#jjd6!l5t~u#m9DGaM;|b>2){dH->wu1A~JjF~ouGLFs}!**`M zcHDNOU^)h~7qm65EhBGg!!lDDI=q~bpf%(9k!V+S(wit|p46#~r5(R7+7uY_N1~&l v;iThge>r+)aN2f^*^KQu`Ey3X^_a5RYH2rSbEf6FnqYkEgP__P`k(l3ZPK$? delta 855 zcmYMxOK1~87{Kvq9%f^0)kJBnTGo@r2Q;=~tp_O@sb0JlJ$Ug!&f=lsrS#zcqYEy(` zRn;yU@zK#KIEKq81)okR#jQqoNqi1dIF2&^ z1jblj`BB1UhTQ(p2%&rv3NjXl`F4s7CGc5ww|hiW9rJP%NQ zWDaHim)OnvszD=*U$GN^AzP!8l-q?JNS8W*l6M%Tpi|h6V^KVbl6M8=D5@w0)T8l- zD22>NzQL+&-Fq6-xRq?F>?YEsYLWM&{wF94%p=FCUZHI50?Nbz_>x&l{A}ynpBu1qhX!-KdwX-{ zU2=Pxo`ZI7V6cConcUW5GO6L1ebS7kj_%RE_U(LF2;Fk%PHA5q*N&$Hb>@N&E_sV{ zMMwMPnV?W~%!gFP9J97$T_@0ieL|NO--e!Bbf&axCatc7eRZ~EYF2;ugf7o$26Pba dvo97(ZfIBBz$VYvwrl=a=S@C6ZaR}g{{XAOdfEU0 diff --git a/searx/translations/de/LC_MESSAGES/messages.po b/searx/translations/de/LC_MESSAGES/messages.po index bd4f44d0b..c28759470 100644 --- a/searx/translations/de/LC_MESSAGES/messages.po +++ b/searx/translations/de/LC_MESSAGES/messages.po @@ -1,152 +1,188 @@ -# English translations for . +# English translations for PROJECT. # Copyright (C) 2014 ORGANIZATION -# This file is distributed under the same license as the project. -# +# This file is distributed under the same license as the PROJECT project. +# # Translators: # pointhi, 2014 # stf , 2014 +# rike, 2014 msgid "" msgstr "" -"Project-Id-Version: searx\n" +"Project-Id-Version: searx\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2014-03-18 17:10+0100\n" -"PO-Revision-Date: 2014-03-15 18:40+0000\n" +"POT-Creation-Date: 2014-09-07 21:47+0200\n" +"PO-Revision-Date: 2014-09-08 07:00+0000\n" "Last-Translator: pointhi\n" -"Language-Team: German " -"(http://www.transifex.com/projects/p/searx/language/de/)\n" -"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"Language-Team: German (http://www.transifex.com/projects/p/searx/language/de/)\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 1.3\n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: searx/webapp.py:167 +#: searx/webapp.py:250 msgid "{minutes} minute(s) ago" -msgstr "" +msgstr "vor {minutes} Minute(n)" -#: searx/webapp.py:169 +#: searx/webapp.py:252 msgid "{hours} hour(s), {minutes} minute(s) ago" -msgstr "" +msgstr "vor {hours} Stunde(n), {minutes} Minute(n)" -#: searx/engines/__init__.py:311 +#: searx/engines/__init__.py:164 msgid "Page loads (sec)" msgstr "Ladezeit (sek)" -#: searx/engines/__init__.py:315 +#: searx/engines/__init__.py:168 msgid "Number of results" msgstr "Trefferanzahl" -#: searx/engines/__init__.py:319 +#: searx/engines/__init__.py:172 msgid "Scores" msgstr "Punkte" -#: searx/engines/__init__.py:323 +#: searx/engines/__init__.py:176 msgid "Scores per result" msgstr "Punkte pro Treffer" -#: searx/engines/__init__.py:327 +#: searx/engines/__init__.py:180 msgid "Errors" msgstr "Fehler" -#: searx/templates/index.html:7 +#: searx/templates/courgette/index.html:8 searx/templates/default/index.html:8 msgid "about" msgstr "Über uns" -#: searx/templates/index.html:8 +#: searx/templates/courgette/index.html:9 searx/templates/default/index.html:9 msgid "preferences" msgstr "Einstellungen" -#: searx/templates/preferences.html:5 +#: searx/templates/courgette/preferences.html:5 +#: searx/templates/default/preferences.html:5 msgid "Preferences" msgstr "Einstellungen" -#: searx/templates/preferences.html:9 +#: searx/templates/courgette/preferences.html:9 +#: searx/templates/default/preferences.html:9 msgid "Default categories" -msgstr "Standard Kategorien" +msgstr "Standardkategorien" -#: searx/templates/preferences.html:15 +#: searx/templates/courgette/preferences.html:15 +#: searx/templates/default/preferences.html:15 msgid "Search language" msgstr "Suchsprache" -#: searx/templates/preferences.html:18 +#: searx/templates/courgette/preferences.html:18 +#: searx/templates/default/preferences.html:18 msgid "Automatic" msgstr "Automatisch" -#: searx/templates/preferences.html:26 +#: searx/templates/courgette/preferences.html:26 +#: searx/templates/default/preferences.html:26 msgid "Interface language" msgstr "Oberflächensprache" -#: searx/templates/preferences.html:36 +#: searx/templates/courgette/preferences.html:36 +#: searx/templates/default/preferences.html:36 +msgid "Autocomplete" +msgstr "Autovervollständigung" + +#: searx/templates/courgette/preferences.html:47 +#: searx/templates/default/preferences.html:47 +msgid "Method" +msgstr "Methode" + +#: searx/templates/courgette/preferences.html:56 +#: searx/templates/default/preferences.html:56 +msgid "Themes" +msgstr "Designs" + +#: searx/templates/courgette/preferences.html:66 +#: searx/templates/default/preferences.html:66 msgid "Currently used search engines" msgstr "Aktuell benutzte Suchmaschinen" -#: searx/templates/preferences.html:40 +#: searx/templates/courgette/preferences.html:70 +#: searx/templates/default/preferences.html:70 msgid "Engine name" msgstr "Suchmaschinenname" -#: searx/templates/preferences.html:41 +#: searx/templates/courgette/preferences.html:71 +#: searx/templates/default/preferences.html:71 msgid "Category" msgstr "Kategorie" -#: searx/templates/preferences.html:42 searx/templates/preferences.html:53 +#: searx/templates/courgette/preferences.html:72 +#: searx/templates/courgette/preferences.html:83 +#: searx/templates/default/preferences.html:72 +#: searx/templates/default/preferences.html:83 msgid "Allow" msgstr "Erlauben" -#: searx/templates/preferences.html:42 searx/templates/preferences.html:54 +#: searx/templates/courgette/preferences.html:72 +#: searx/templates/courgette/preferences.html:84 +#: searx/templates/default/preferences.html:72 +#: searx/templates/default/preferences.html:84 msgid "Block" msgstr "Blockieren" -#: searx/templates/preferences.html:62 +#: searx/templates/courgette/preferences.html:92 +#: searx/templates/default/preferences.html:92 msgid "" -"These settings are stored in your cookies, this allows us not to store " -"this data about you." -msgstr "" -"Diese Informationen werden in Cookies gespeichert, damit wir keine ihrer " -"persönlichen Daten speichern müssen." +"These settings are stored in your cookies, this allows us not to store this " +"data about you." +msgstr "Diese Informationen werden in Cookies auf Ihrem Rechner gespeichert, damit wir keine Ihrer persönlichen Daten speichern müssen." -#: searx/templates/preferences.html:64 +#: searx/templates/courgette/preferences.html:94 +#: searx/templates/default/preferences.html:94 msgid "" "These cookies serve your sole convenience, we don't use these cookies to " "track you." -msgstr "" -"Diese Cookies dienen ihrer Gemütlichkeit, wir verwenden sie nicht zum " -"überwachen." +msgstr "Diese Cookies dienen einzig Ihrem Komfort, wir verwenden sie nicht, um Sie zu überwachen." -#: searx/templates/preferences.html:67 +#: searx/templates/courgette/preferences.html:97 +#: searx/templates/default/preferences.html:97 msgid "save" msgstr "Speichern" -#: searx/templates/preferences.html:68 +#: searx/templates/courgette/preferences.html:98 +#: searx/templates/default/preferences.html:98 msgid "back" msgstr "Zurück" -#: searx/templates/results.html:11 -msgid "Suggestions" -msgstr "Vorschläge" - -#: searx/templates/results.html:22 +#: searx/templates/courgette/results.html:12 +#: searx/templates/default/results.html:12 msgid "Search URL" msgstr "Such-URL" -#: searx/templates/results.html:26 +#: searx/templates/courgette/results.html:16 +#: searx/templates/default/results.html:16 msgid "Download results" msgstr "Ergebnisse herunterladen" -#: searx/templates/results.html:62 +#: searx/templates/courgette/results.html:34 +#: searx/templates/default/results.html:34 +msgid "Suggestions" +msgstr "Vorschläge" + +#: searx/templates/courgette/results.html:62 +#: searx/templates/default/results.html:62 msgid "previous page" msgstr "vorherige Seite" -#: searx/templates/results.html:73 +#: searx/templates/courgette/results.html:73 +#: searx/templates/default/results.html:73 msgid "next page" msgstr "nächste Seite" -#: searx/templates/search.html:3 +#: searx/templates/courgette/search.html:3 +#: searx/templates/default/search.html:3 msgid "Search for..." msgstr "Suche nach..." -#: searx/templates/stats.html:4 +#: searx/templates/courgette/stats.html:4 searx/templates/default/stats.html:4 msgid "Engine stats" -msgstr "Suchmaschienen Statistiken" +msgstr "Suchmaschinenstatistik" # categories - manually added # TODO - automatically add @@ -174,3 +210,5 @@ msgstr "IT" msgid "news" msgstr "Neuigkeiten" +msgid "map" +msgstr "Karte" diff --git a/searx/translations/en/LC_MESSAGES/messages.mo b/searx/translations/en/LC_MESSAGES/messages.mo index 4f81aa4ba394cfc41dd89df099eb228764197a10..13936f4fbffb7bc37a79193c3d0b25f32f45d709 100644 GIT binary patch delta 929 zcmbu*&r1|>7{~F)opswat#vB}U1C~YP8NNR-&>!G1Gq3s1_xV20_xtQLemGVAo{GLP zu3nxr&&wK({$GD1X0;3tupS-9EP+YX{}zm62HUU`Q#g!CyoJYc7PWo>WB3e-tJ;fj zVkMl|Kx)|*HsX6!qEDzq-%tsDg!B7Y$M^snFdj8KiA|{Z^Qibdj$r|B<12KiZ@YZx zBtMbceud*dc#QEsRDu{m+E@cp%aW*dr+H~z3#v0`QH48E8|n||2T>g;qVi2(2led^ zAIJe%KOQ`j4Q3Y2~aqHp#k66{j zXFhbYFQ}G(MJ3unCHjqubEvBMI#kQks1sg5wY(n{KZJ@OMYa3}s^y!g&c!*64pN_> z|7u+-{LzfmvNlwLcGSkYQ49M}3ooM96_DGm@KWI-YD43w`AJjGXJoycW-vbjvIa5;aeE1Tb*u5GP}A0^|`A>s^YT>t<8 delta 728 zcmZ9}&nv@m9LMoD+ic9Q4LKl`qNKKVAUP0DO3EZ8$^o?|QcG!*gIFZKDHl?5<3g13 z4{-1YC=L$Gg#)*pJYQ|4eEWPqkI!eH_xJPueBOJg$^=qxLHCjIwDQ*TMhi6idv*)W zJWThn7@hq51bxiUu>mhJh)-CFujt1wEX6Dqq1Tm*E60FY%9xGYjSE8{wfZ$!n1P;ot|^?p?4#!wfSMO7}2icexnrAsqV>E2K$?B;kJ-g;5< zL1f8>Pzgqnztbl3>(i+CIn+%TPzhF0iIe&DUDSmRQ2U(vC|DbV3w}`Pp3(YZv89Al v;o5g@T^ml1`^x!rw>UMPkMdBYBiz*#?(7bS+C$+Re^Fh5Q|(Isi`)JM^(;xM diff --git a/searx/translations/en/LC_MESSAGES/messages.po b/searx/translations/en/LC_MESSAGES/messages.po index 7141c4db5..7f2ef09e9 100644 --- a/searx/translations/en/LC_MESSAGES/messages.po +++ b/searx/translations/en/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2014-03-18 17:10+0100\n" +"POT-Creation-Date: 2014-10-01 19:24+0200\n" "PO-Revision-Date: 2014-01-30 15:22+0100\n" "Last-Translator: FULL NAME \n" "Language-Team: en \n" @@ -17,130 +17,181 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 1.3\n" -#: searx/webapp.py:167 +#: searx/webapp.py:251 msgid "{minutes} minute(s) ago" msgstr "" -#: searx/webapp.py:169 +#: searx/webapp.py:253 msgid "{hours} hour(s), {minutes} minute(s) ago" msgstr "" -#: searx/engines/__init__.py:311 +#: searx/engines/__init__.py:176 msgid "Page loads (sec)" msgstr "" -#: searx/engines/__init__.py:315 +#: searx/engines/__init__.py:180 msgid "Number of results" msgstr "" -#: searx/engines/__init__.py:319 +#: searx/engines/__init__.py:184 msgid "Scores" msgstr "" -#: searx/engines/__init__.py:323 +#: searx/engines/__init__.py:188 msgid "Scores per result" msgstr "" -#: searx/engines/__init__.py:327 +#: searx/engines/__init__.py:192 msgid "Errors" msgstr "" -#: searx/templates/index.html:7 +#: searx/templates/courgette/index.html:8 searx/templates/default/index.html:8 msgid "about" msgstr "" -#: searx/templates/index.html:8 +#: searx/templates/courgette/index.html:9 searx/templates/default/index.html:9 msgid "preferences" msgstr "" -#: searx/templates/preferences.html:5 +#: searx/templates/courgette/preferences.html:5 +#: searx/templates/default/preferences.html:5 msgid "Preferences" msgstr "" -#: searx/templates/preferences.html:9 +#: searx/templates/courgette/preferences.html:9 +#: searx/templates/default/preferences.html:9 msgid "Default categories" msgstr "" -#: searx/templates/preferences.html:15 +#: searx/templates/courgette/preferences.html:15 +#: searx/templates/default/preferences.html:15 msgid "Search language" msgstr "" -#: searx/templates/preferences.html:18 +#: searx/templates/courgette/preferences.html:18 +#: searx/templates/default/preferences.html:18 msgid "Automatic" msgstr "" -#: searx/templates/preferences.html:26 +#: searx/templates/courgette/preferences.html:26 +#: searx/templates/default/preferences.html:26 msgid "Interface language" msgstr "" -#: searx/templates/preferences.html:36 +#: searx/templates/courgette/preferences.html:36 +#: searx/templates/default/preferences.html:36 +msgid "Autocomplete" +msgstr "" + +#: searx/templates/courgette/preferences.html:47 +#: searx/templates/default/preferences.html:47 +msgid "Method" +msgstr "" + +#: searx/templates/courgette/preferences.html:56 +#: searx/templates/default/preferences.html:56 +msgid "Themes" +msgstr "" + +#: searx/templates/courgette/preferences.html:66 +#: searx/templates/default/preferences.html:66 msgid "Currently used search engines" msgstr "" -#: searx/templates/preferences.html:40 +#: searx/templates/courgette/preferences.html:70 +#: searx/templates/default/preferences.html:70 msgid "Engine name" msgstr "" -#: searx/templates/preferences.html:41 +#: searx/templates/courgette/preferences.html:71 +#: searx/templates/default/preferences.html:71 msgid "Category" msgstr "" -#: searx/templates/preferences.html:42 searx/templates/preferences.html:53 +#: searx/templates/courgette/preferences.html:72 +#: searx/templates/courgette/preferences.html:83 +#: searx/templates/default/preferences.html:73 +#: searx/templates/default/preferences.html:85 msgid "Allow" msgstr "" -#: searx/templates/preferences.html:42 searx/templates/preferences.html:54 +#: searx/templates/courgette/preferences.html:72 +#: searx/templates/courgette/preferences.html:84 +#: searx/templates/default/preferences.html:73 +#: searx/templates/default/preferences.html:86 msgid "Block" msgstr "" -#: searx/templates/preferences.html:62 +#: searx/templates/courgette/preferences.html:92 +#: searx/templates/default/preferences.html:94 msgid "" "These settings are stored in your cookies, this allows us not to store " "this data about you." msgstr "" -#: searx/templates/preferences.html:64 +#: searx/templates/courgette/preferences.html:94 +#: searx/templates/default/preferences.html:96 msgid "" "These cookies serve your sole convenience, we don't use these cookies to " "track you." msgstr "" -#: searx/templates/preferences.html:67 +#: searx/templates/courgette/preferences.html:97 +#: searx/templates/default/preferences.html:99 msgid "save" msgstr "" -#: searx/templates/preferences.html:68 +#: searx/templates/courgette/preferences.html:98 +#: searx/templates/default/preferences.html:100 msgid "back" msgstr "" -#: searx/templates/results.html:11 -msgid "Suggestions" -msgstr "" - -#: searx/templates/results.html:22 +#: searx/templates/courgette/results.html:12 +#: searx/templates/default/results.html:12 msgid "Search URL" msgstr "" -#: searx/templates/results.html:26 +#: searx/templates/courgette/results.html:16 +#: searx/templates/default/results.html:16 msgid "Download results" msgstr "" -#: searx/templates/results.html:62 +#: searx/templates/courgette/results.html:34 +#: searx/templates/default/results.html:34 +msgid "Suggestions" +msgstr "" + +#: searx/templates/courgette/results.html:62 +#: searx/templates/default/results.html:62 msgid "previous page" msgstr "" -#: searx/templates/results.html:73 +#: searx/templates/courgette/results.html:73 +#: searx/templates/default/results.html:73 msgid "next page" msgstr "" -#: searx/templates/search.html:3 +#: searx/templates/courgette/search.html:3 +#: searx/templates/default/search.html:3 msgid "Search for..." msgstr "" -#: searx/templates/stats.html:4 +#: searx/templates/courgette/stats.html:4 searx/templates/default/stats.html:4 msgid "Engine stats" msgstr "" +#: searx/templates/default/preferences.html:72 +msgid "Localization" +msgstr "" + +#: searx/templates/default/preferences.html:82 +msgid "Yes" +msgstr "" + +#: searx/templates/default/preferences.html:82 +msgid "No" +msgstr "" + # categories - manually added # TODO - automatically add msgid "files" @@ -167,3 +218,6 @@ msgstr "" msgid "news" msgstr "" +msgid "map" +msgstr "" + diff --git a/searx/translations/es/LC_MESSAGES/messages.mo b/searx/translations/es/LC_MESSAGES/messages.mo index 69c0fdfd8209b9fc4f71123da9b923ed1cfe24dd..2d0b16527fe5ef5cda1028b12282370c3101f08f 100644 GIT binary patch delta 999 zcmZwFPe>I(9KiAE{nr%J3?+;95cm(_J&`OsJq^03mpl{-GCdcc_4dtk-#$vE9?_wL zbcn5p=n_RF5*_Rmbjc0{20|b~A`;ahBCJCp5%vA)LYJ1=`Rx2=X6HAvdwci8`tn*` zp}c8CTMTqe%!=5YzQm03)^rf9z~gd9Ah|y zj4P|*AdtseI!Y)Lub@o474+W^`scBd_%p1=mso=amuGK!TRbqqvQoKvXB?nqa3M)veQ;<#x88a5v<4aC`W!358^yh)H2l`d>gdC z2JIiXmv|K~mjs)!EDv2gNJkoF!4Z@lj-w&*YmjRav$b?yxf8aVwVh>RMg$0yxFHpYqQqW$-HrgMs5o;v- zbS`JksdULR8RHakwr6iO9PLeHRBz5?&Z<7`+2h8YQholTkQW=Uy{sAYt?;FgWBYf) zD>+-R%fcGtGhkf>5oR64iPzQrBXe~RC|)EvR@ayjv-g)i#hEXx5rB7 z>@zw)<{GQtUR=mq>FK<7{kzd$i69&8-;Axs2Nvf%GiLnBxEt*)6*JoZ5E> y*oZi~p#7hT)5o$pV_P#>Q*w(JtgLZ$OR?3OvSyr#e95zkZ9N#GYJ2E^I{pGU3ZAwA delta 780 zcmYMxO=uHA6u|LkKALP|?S~ahqZpx(KnW(Mpyn3vD4~)-sS2`4)xtI*A5tiVNColG zQp_lbpa@myp@MkQLwgo)@gRCoL%azJN)br|_W#<2F0=F7H~V(y&CJ@+=wW^- zx(Q{Z$sC=obOCjOyQmX4kS5RQbVV;vfAkvT_!f_18y~QX9n>9KAxZ!92sM6=x}cXB zV}5zVLj+qmgk97v9iZG%JcU|$f$j)iajoD8@jcXnR$X7Y;~S_GeL`Kpch}#j1^vf* zj)yR1&Eh50mA^x3kPk?c&vfKU8}j9sh^4-ItuHSR`pd5!9oNqkex5_2{y0 ze9>aV;tWhNpj)?yl69QYocZQiF}J+8P1oBrO<$`wok*RHrp{zi$+2Y0Z2BXybRsz( zJ)O*qGr|?RU{`C2Ld7mt9lKVlWTM3xd)}EgeLdS|IPlT@4V10?v|YJ&GkU#boZty_ OKlsz!v1~K!&+Y&|XF|9KiAC{uy^o$$zD3!kj`|ja3B6Jh*x2l2Ejl@*v~-aJOchWpie@<8s5CmzTcbQyx)7X3oTDuE9=d% z8;UE%y_egskJa6L^C(wMHi=@E&EsO_V}@AWi+Dlbyy$lJ_-XH@0IN zX7B;0d=itauMAd~ghrGXcA*s1Lnk}!#}tmBydaPAsm`M;d>41)BGS|{-7b8EQoshb z;%Dr{-za(Qe76cksD1os!CsW3A4PfKco?5VDXfI@!U}4&$!;48Vepqd}Cbud3QQ6qZcBM4(>$PB33ad z#y&P2>`M=s1O3B;L#gyYFd6S0twsh0Q)#ZcqgKi9%X-#q$+mpg8#Xi3mSbkE@|5<> z5v!Cd6dczbopG#!eSms`7x7<-YF)vS(Oo~SO;6|Y+T#vB7+0&+*tNIf*}Qi2<7gsY qBNZ9RsXYbToHH$RKJS*j(m6A)%bxBo_4Jy-wPZ^|h0`*qQGWqu9F^Jt delta 802 zcmYMxPe>F|9Ki9P`^Ry$&GJtgR*ZO15@iQPW$};}ok9y2Bs}COX4*Q7yBl7D6%U>i z$%oKI5yV4amkp6FUV;vJ5HE!XOM-|l9f}TW2fx2|pyAE?y!V^m`!{d9>Q!a#b46%H zcp7=H@g|D2_y1W4h=l1bVg!xfU&Rvo8+aYJumV5eB|O41{D~Lv6pPUc7V<9QWs#iJ z)6fBJr~~exCf+Y3$RL)|pTH<)u^i`6^Otb|*Ki1bp>DV@Btnq{mG&Q^g^y6@AIAXe zi{~dyBSmJY^rX*G7nny~co`|OPNgT>M4c#)P52gT@GIu|i>Ijbye3KK*+JdFJJbX1 z;SJW8k2G}PAJi*|lBEmY#4Ff^I, 2014 # FIRST AUTHOR , 2014 -# rike , 2014 +# rike, 2014 msgid "" msgstr "" -"Project-Id-Version: searx\n" +"Project-Id-Version: searx\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2014-03-18 17:10+0100\n" -"PO-Revision-Date: 2014-03-16 07:40+0000\n" -"Last-Translator: Benjamin Sonntag \n" -"Language-Team: French " -"(http://www.transifex.com/projects/p/searx/language/fr/)\n" -"Plural-Forms: nplurals=2; plural=(n > 1)\n" +"POT-Creation-Date: 2014-09-07 21:47+0200\n" +"PO-Revision-Date: 2014-09-07 21:24+0000\n" +"Last-Translator: Adam Tauber \n" +"Language-Team: French (http://www.transifex.com/projects/p/searx/language/fr/)\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 1.3\n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: searx/webapp.py:167 +#: searx/webapp.py:250 msgid "{minutes} minute(s) ago" -msgstr "Il y a {minutes} minute(s)" +msgstr "il y a {minutes} minute(s)" -#: searx/webapp.py:169 +#: searx/webapp.py:252 msgid "{hours} hour(s), {minutes} minute(s) ago" -msgstr "Il y a {hours} heure(s), {minutes} minute(s)" +msgstr "il y a {hours} heure(s), {minutes} minute(s)" -#: searx/engines/__init__.py:311 +#: searx/engines/__init__.py:164 msgid "Page loads (sec)" msgstr "Chargement de la page (sec)" -#: searx/engines/__init__.py:315 +#: searx/engines/__init__.py:168 msgid "Number of results" msgstr "Nombre de résultats" -#: searx/engines/__init__.py:319 +#: searx/engines/__init__.py:172 msgid "Scores" msgstr "Score" -#: searx/engines/__init__.py:323 +#: searx/engines/__init__.py:176 msgid "Scores per result" msgstr "Score par résultat" -#: searx/engines/__init__.py:327 +#: searx/engines/__init__.py:180 msgid "Errors" msgstr "Erreurs" -#: searx/templates/index.html:7 +#: searx/templates/courgette/index.html:8 searx/templates/default/index.html:8 msgid "about" msgstr "À propos" -#: searx/templates/index.html:8 +#: searx/templates/courgette/index.html:9 searx/templates/default/index.html:9 msgid "preferences" msgstr "préférences" -#: searx/templates/preferences.html:5 +#: searx/templates/courgette/preferences.html:5 +#: searx/templates/default/preferences.html:5 msgid "Preferences" msgstr "Préférences" -#: searx/templates/preferences.html:9 +#: searx/templates/courgette/preferences.html:9 +#: searx/templates/default/preferences.html:9 msgid "Default categories" msgstr "Catégories par défaut" -#: searx/templates/preferences.html:15 +#: searx/templates/courgette/preferences.html:15 +#: searx/templates/default/preferences.html:15 msgid "Search language" msgstr "Langue de recherche" -#: searx/templates/preferences.html:18 +#: searx/templates/courgette/preferences.html:18 +#: searx/templates/default/preferences.html:18 msgid "Automatic" msgstr "Automatique" -#: searx/templates/preferences.html:26 +#: searx/templates/courgette/preferences.html:26 +#: searx/templates/default/preferences.html:26 msgid "Interface language" msgstr "Langue de l'interface" -#: searx/templates/preferences.html:36 -msgid "Currently used search engines" -msgstr "Moteurs actuellement utilisés" +#: searx/templates/courgette/preferences.html:36 +#: searx/templates/default/preferences.html:36 +msgid "Autocomplete" +msgstr "" -#: searx/templates/preferences.html:40 +#: searx/templates/courgette/preferences.html:47 +#: searx/templates/default/preferences.html:47 +msgid "Method" +msgstr "" + +#: searx/templates/courgette/preferences.html:56 +#: searx/templates/default/preferences.html:56 +msgid "Themes" +msgstr "" + +#: searx/templates/courgette/preferences.html:66 +#: searx/templates/default/preferences.html:66 +msgid "Currently used search engines" +msgstr "Moteurs de recherche actuellement utilisés" + +#: searx/templates/courgette/preferences.html:70 +#: searx/templates/default/preferences.html:70 msgid "Engine name" msgstr "Nom du moteur" -#: searx/templates/preferences.html:41 +#: searx/templates/courgette/preferences.html:71 +#: searx/templates/default/preferences.html:71 msgid "Category" msgstr "Catégorie" -#: searx/templates/preferences.html:42 searx/templates/preferences.html:53 +#: searx/templates/courgette/preferences.html:72 +#: searx/templates/courgette/preferences.html:83 +#: searx/templates/default/preferences.html:72 +#: searx/templates/default/preferences.html:83 msgid "Allow" msgstr "Autoriser" -#: searx/templates/preferences.html:42 searx/templates/preferences.html:54 +#: searx/templates/courgette/preferences.html:72 +#: searx/templates/courgette/preferences.html:84 +#: searx/templates/default/preferences.html:72 +#: searx/templates/default/preferences.html:84 msgid "Block" msgstr "Bloquer" -#: searx/templates/preferences.html:62 +#: searx/templates/courgette/preferences.html:92 +#: searx/templates/default/preferences.html:92 msgid "" -"These settings are stored in your cookies, this allows us not to store " -"this data about you." -msgstr "" -"Ces paramètres sont stockés dans vos cookies ; ceci nous permet de ne pas" -" collecter vos données." +"These settings are stored in your cookies, this allows us not to store this " +"data about you." +msgstr "Ces paramètres sont stockés dans vos cookies ; ceci nous permet de ne pas collecter vos données." -#: searx/templates/preferences.html:64 +#: searx/templates/courgette/preferences.html:94 +#: searx/templates/default/preferences.html:94 msgid "" "These cookies serve your sole convenience, we don't use these cookies to " "track you." -msgstr "" -"Ces cookies existent pour votre confort d'utilisation, nous ne les " -"utilisons pas pour vous espionner." +msgstr "Ces cookies existent pour votre confort d'utilisation, nous ne les utilisons pas pour vous espionner." -#: searx/templates/preferences.html:67 +#: searx/templates/courgette/preferences.html:97 +#: searx/templates/default/preferences.html:97 msgid "save" msgstr "enregistrer" -#: searx/templates/preferences.html:68 +#: searx/templates/courgette/preferences.html:98 +#: searx/templates/default/preferences.html:98 msgid "back" msgstr "retour" -#: searx/templates/results.html:11 -msgid "Suggestions" -msgstr "Suggestions" - -#: searx/templates/results.html:22 +#: searx/templates/courgette/results.html:12 +#: searx/templates/default/results.html:12 msgid "Search URL" msgstr "URL de recherche" -#: searx/templates/results.html:26 +#: searx/templates/courgette/results.html:16 +#: searx/templates/default/results.html:16 msgid "Download results" msgstr "Télécharger les résultats" -#: searx/templates/results.html:62 +#: searx/templates/courgette/results.html:34 +#: searx/templates/default/results.html:34 +msgid "Suggestions" +msgstr "Suggestions" + +#: searx/templates/courgette/results.html:62 +#: searx/templates/default/results.html:62 msgid "previous page" msgstr "page précédente" -#: searx/templates/results.html:73 +#: searx/templates/courgette/results.html:73 +#: searx/templates/default/results.html:73 msgid "next page" msgstr "page suivante" -#: searx/templates/search.html:3 +#: searx/templates/courgette/search.html:3 +#: searx/templates/default/search.html:3 msgid "Search for..." msgstr "Rechercher..." -#: searx/templates/stats.html:4 +#: searx/templates/courgette/stats.html:4 searx/templates/default/stats.html:4 msgid "Engine stats" msgstr "Statistiques du moteur" @@ -175,3 +210,5 @@ msgstr "Informatique" msgid "news" msgstr "actus" +msgid "map" +msgstr "" diff --git a/searx/translations/hu/LC_MESSAGES/messages.mo b/searx/translations/hu/LC_MESSAGES/messages.mo index 64beee1af1b26b5178bf512ab3e33d13a2fa0387..a60b3ee22987974afe45e620eedc90f7c12fbaf5 100644 GIT binary patch delta 1089 zcmYMxO-K}B7zgmTb$8X(KGe#rgy|6Y!8+q+Noy-^T6svc^ib^SZGBzGoiAo)T?=B# zOQ)oof(}s-LM&k)&?)KC9xAX10uKdJ2ZK6gm+(^kpLL{RW`6U$pU?ZugZj0G!b*Mc zHpA79XFncy3q}90r2u0ggzsQ2{0OVz7r*@ntU~+~Hp6vT4;w2O+X35P4eWt5{}c?v zF^F*mmhu}6Sci@rq={D{O}yjx&-?w4UfDiq6 z5mH4;kP`h0SyI!?JWJ+WGi~aYCR|YtbndEYc3d;lS=P^8kumLytlwJ*xZxq;PMYJM zRBir@4{I@r;O$ z39iSb!JLudw#p5uWzu!6xGd-M`3~3ShNDi18JZ(owmBuzt|MD=IYn9X*N`W3a%*Hn z%h_Cuo-}RUX^u;VRgRrRtVi1TOtcu%frQlA>ir4L)k;}aWJ*QnQfa~UE{7j)7No86 dX3dbuObJaG==K&XKUKM#<+&{ceyhH#1 delta 847 zcmYMxO=uHA6u|K@-)(KHsb3I<6%Q6lB-XY9kDxD_`rfI;u(yaC*rr zBMagv3(_bPbDI;?8SEuqz<#XbATFWI?_dER;W_+;QgGI%6ipTRNPHH9IE%7>2|eUj zWp~15q^Tw!Iq4OY1lLg#caWx*`N)Z$p=|ULhw(M;#&6i<7B_H!xXL8i=Nd`@ZIlCb zF+zT|Oh>M86?fq$lmzRz6aOMj?O?T>Jc3-E8bP`8ag;O{clmgzO?E4;v z@Pixw2ytO@^4|?r6#S3R63o{6bebEmP-x0G#4$-*_RT=e8U*CtO;k~P^DT*YA3L#&pc`@I*qFB ZjK}o7z-@gj_*j1r-qlN?kNSL1`yVbGa-RSI diff --git a/searx/translations/hu/LC_MESSAGES/messages.po b/searx/translations/hu/LC_MESSAGES/messages.po index 52fd2ee95..c34e56db9 100644 --- a/searx/translations/hu/LC_MESSAGES/messages.po +++ b/searx/translations/hu/LC_MESSAGES/messages.po @@ -1,145 +1,185 @@ -# Hungarian translations for PROJECT. +# English translations for PROJECT. # Copyright (C) 2014 ORGANIZATION # This file is distributed under the same license as the PROJECT project. -# FIRST AUTHOR , 2014. -# +# +# Translators: +# Adam Tauber , 2014 +# FIRST AUTHOR , 2014 msgid "" msgstr "" -"Project-Id-Version: PROJECT VERSION\n" +"Project-Id-Version: searx\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2014-03-18 17:10+0100\n" -"PO-Revision-Date: 2014-01-21 23:33+0100\n" -"Last-Translator: FULL NAME \n" -"Language-Team: hu \n" -"Plural-Forms: nplurals=1; plural=0\n" +"POT-Creation-Date: 2014-09-07 21:47+0200\n" +"PO-Revision-Date: 2014-09-07 21:30+0000\n" +"Last-Translator: Adam Tauber \n" +"Language-Team: Hungarian (http://www.transifex.com/projects/p/searx/language/hu/)\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 1.3\n" +"Language: hu\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: searx/webapp.py:167 +#: searx/webapp.py:250 msgid "{minutes} minute(s) ago" msgstr "{minutes} perce" -#: searx/webapp.py:169 +#: searx/webapp.py:252 msgid "{hours} hour(s), {minutes} minute(s) ago" msgstr "{hours} óra, {minutes} perce" -#: searx/engines/__init__.py:311 +#: searx/engines/__init__.py:164 msgid "Page loads (sec)" msgstr "Válaszidők (sec)" -#: searx/engines/__init__.py:315 +#: searx/engines/__init__.py:168 msgid "Number of results" msgstr "Találatok száma" -#: searx/engines/__init__.py:319 +#: searx/engines/__init__.py:172 msgid "Scores" msgstr "Pontszámok" -#: searx/engines/__init__.py:323 +#: searx/engines/__init__.py:176 msgid "Scores per result" msgstr "Pontszámok találatonként" -#: searx/engines/__init__.py:327 +#: searx/engines/__init__.py:180 msgid "Errors" msgstr "Hibák" -#: searx/templates/index.html:7 +#: searx/templates/courgette/index.html:8 searx/templates/default/index.html:8 msgid "about" msgstr "rólunk" -#: searx/templates/index.html:8 +#: searx/templates/courgette/index.html:9 searx/templates/default/index.html:9 msgid "preferences" msgstr "beállítások" -#: searx/templates/preferences.html:5 +#: searx/templates/courgette/preferences.html:5 +#: searx/templates/default/preferences.html:5 msgid "Preferences" msgstr "Beállítások" -#: searx/templates/preferences.html:9 +#: searx/templates/courgette/preferences.html:9 +#: searx/templates/default/preferences.html:9 msgid "Default categories" msgstr "Alapértelmezett kategóriák" -#: searx/templates/preferences.html:15 +#: searx/templates/courgette/preferences.html:15 +#: searx/templates/default/preferences.html:15 msgid "Search language" msgstr "Keresés nyelve" -#: searx/templates/preferences.html:18 +#: searx/templates/courgette/preferences.html:18 +#: searx/templates/default/preferences.html:18 msgid "Automatic" msgstr "Automatikus" -#: searx/templates/preferences.html:26 +#: searx/templates/courgette/preferences.html:26 +#: searx/templates/default/preferences.html:26 msgid "Interface language" msgstr "Felület nyelve" -#: searx/templates/preferences.html:36 +#: searx/templates/courgette/preferences.html:36 +#: searx/templates/default/preferences.html:36 +msgid "Autocomplete" +msgstr "Automatikus kiegészítés" + +#: searx/templates/courgette/preferences.html:47 +#: searx/templates/default/preferences.html:47 +msgid "Method" +msgstr "Method" + +#: searx/templates/courgette/preferences.html:56 +#: searx/templates/default/preferences.html:56 +msgid "Themes" +msgstr "Megjelenés" + +#: searx/templates/courgette/preferences.html:66 +#: searx/templates/default/preferences.html:66 msgid "Currently used search engines" msgstr "Jelenleg használt keresők" -#: searx/templates/preferences.html:40 +#: searx/templates/courgette/preferences.html:70 +#: searx/templates/default/preferences.html:70 msgid "Engine name" msgstr "Kereső neve" -#: searx/templates/preferences.html:41 +#: searx/templates/courgette/preferences.html:71 +#: searx/templates/default/preferences.html:71 msgid "Category" msgstr "Kategória" -#: searx/templates/preferences.html:42 searx/templates/preferences.html:53 +#: searx/templates/courgette/preferences.html:72 +#: searx/templates/courgette/preferences.html:83 +#: searx/templates/default/preferences.html:72 +#: searx/templates/default/preferences.html:83 msgid "Allow" msgstr "Engedélyezés" -#: searx/templates/preferences.html:42 searx/templates/preferences.html:54 +#: searx/templates/courgette/preferences.html:72 +#: searx/templates/courgette/preferences.html:84 +#: searx/templates/default/preferences.html:72 +#: searx/templates/default/preferences.html:84 msgid "Block" msgstr "Tiltás" -#: searx/templates/preferences.html:62 +#: searx/templates/courgette/preferences.html:92 +#: searx/templates/default/preferences.html:92 msgid "" -"These settings are stored in your cookies, this allows us not to store " -"this data about you." +"These settings are stored in your cookies, this allows us not to store this " +"data about you." msgstr "Ezek a beállítások csak a böngésző cookie-jaiban tárolódnak." -#: searx/templates/preferences.html:64 +#: searx/templates/courgette/preferences.html:94 +#: searx/templates/default/preferences.html:94 msgid "" "These cookies serve your sole convenience, we don't use these cookies to " "track you." -msgstr "" -"Ezek a cookie-k csak kényelmi funkciókat látnak el, nem használjuk a " -"felhasználók követésére." +msgstr "Ezek a cookie-k csak kényelmi funkciókat látnak el, nem használjuk a felhasználók követésére." -#: searx/templates/preferences.html:67 +#: searx/templates/courgette/preferences.html:97 +#: searx/templates/default/preferences.html:97 msgid "save" msgstr "mentés" -#: searx/templates/preferences.html:68 +#: searx/templates/courgette/preferences.html:98 +#: searx/templates/default/preferences.html:98 msgid "back" msgstr "vissza" -#: searx/templates/results.html:11 -msgid "Suggestions" -msgstr "Javaslatok" - -#: searx/templates/results.html:22 +#: searx/templates/courgette/results.html:12 +#: searx/templates/default/results.html:12 msgid "Search URL" msgstr "Keresési URL" -#: searx/templates/results.html:26 +#: searx/templates/courgette/results.html:16 +#: searx/templates/default/results.html:16 msgid "Download results" msgstr "Találatok letöltése" -#: searx/templates/results.html:62 +#: searx/templates/courgette/results.html:34 +#: searx/templates/default/results.html:34 +msgid "Suggestions" +msgstr "Javaslatok" + +#: searx/templates/courgette/results.html:62 +#: searx/templates/default/results.html:62 msgid "previous page" msgstr "előző oldal" -#: searx/templates/results.html:73 +#: searx/templates/courgette/results.html:73 +#: searx/templates/default/results.html:73 msgid "next page" msgstr "következő oldal" -#: searx/templates/search.html:3 +#: searx/templates/courgette/search.html:3 +#: searx/templates/default/search.html:3 msgid "Search for..." msgstr "Keresés..." -#: searx/templates/stats.html:4 +#: searx/templates/courgette/stats.html:4 searx/templates/default/stats.html:4 msgid "Engine stats" msgstr "Kereső statisztikák" @@ -169,3 +209,5 @@ msgstr "it" msgid "news" msgstr "hírek" +msgid "map" +msgstr "térkép" diff --git a/searx/translations/it/LC_MESSAGES/messages.mo b/searx/translations/it/LC_MESSAGES/messages.mo index ffd0dc9e551f6f7da996d8ff51ef23d90ec8a466..77b5503d049561af1a88285631f37367cf837453 100644 GIT binary patch delta 965 zcmZwEO=uHA6u|LmzEdsQ4{e}|BPys>NUPAa>LKP(JoI7(l~#03rZ$*lW84rW)F?`O z@#G@((3?dR5f4=l6)&DDR1t(+ilPNQc+l#t7xn+r1urhM``b4=Z{E!8RQqH{?PFWu zuHx$E-oouPN%Zep^eGi2e1q%pJx1}9*Z&P8#4ETJSFsH{{Yq`by|@k!q2v!@2u~p6 zYHGymC}1le$|#9bD2dbF_gU}zBW$MsCAQ!KZooRq_^&7he&H~#;s_1});97GY3fNM zt||4DmoOdkD2cC-O{mvMu3AJnfpD z5@$K((-@_``pu{qMp%XHY&%NgK9oWSa3>zYO?V#L@e0b$Z{ud1LCKrLE}Zw`I?6Bk zfIDynrA`O`ttJJw@gghRgYpZKNK?aJJc_cT0+Oq$coJ{oIb8C-A7(OM)iIQLk9+Z` zr$IT{0~Mbr!T6M<(Lb0>8eV(k9|&P$T;J6#?}5CzPxc~{B@sIbc=!I zmj3GD7{~Ev|GB%`nyHnr2`d>1vda!b6n4pwjv^?D2>n6w4~UDBe-6TmfnJQj z7mt-t9STpW2Mat1B6L#lBxs?xh=hm^BGLDU0}b!IpLu4UdEV!pnW>(wDjrlu7mVXN z=M~P5kfQ&`T-Yo|_#Bhyg7_sSh~Ho>E@35p!3x~RGW?0>@B~XR9y!Y^#|vgftK&j1 z_^20JP>F443D$|F!~>YZr+6NxQTg-Oj<2vAf1w&~jhZp6gGq50#_=JlejkQe--d#O zVPx1ilXg0ZT3`mX@H{eXkx4sxhbr_D8*mLT;~~D~E1sb0ye3H-c#q0oVbcB2SkL;l z$;Czdj#a2OwZm$>g!RZHyNzkQi~7_L@G1_Y7Fa+PUPLwW0r|wXf!e@s5Fes8@EePr zT!i?MkFX2%;1e=zi%A8ygLp6S2>G4%1J&3uQp^6J7W|89sDhUjr%}Hki>mJj@tq`n zHgMw}H`H+ft$A>;Fz&vFU%1i8lsk>=xSi;?l%Mr(WxShBUcNE!x%F7O)X(N`WIVsg t&o3Xvu7zA(eAVs8$5QQ29*^|&XL<`Gxm?b5Co=9?;@C|j@4K2<^FIO`R$l-B diff --git a/searx/translations/it/LC_MESSAGES/messages.po b/searx/translations/it/LC_MESSAGES/messages.po index b83ef440d..4eeb15fa4 100644 --- a/searx/translations/it/LC_MESSAGES/messages.po +++ b/searx/translations/it/LC_MESSAGES/messages.po @@ -1,149 +1,184 @@ -# English translations for . +# English translations for PROJECT. # Copyright (C) 2014 ORGANIZATION -# This file is distributed under the same license as the project. -# +# This file is distributed under the same license as the PROJECT project. +# # Translators: # dp , 2014 msgid "" msgstr "" -"Project-Id-Version: searx\n" +"Project-Id-Version: searx\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2014-03-18 17:10+0100\n" -"PO-Revision-Date: 2014-03-05 13:30+0000\n" +"POT-Creation-Date: 2014-09-07 21:47+0200\n" +"PO-Revision-Date: 2014-09-08 08:19+0000\n" "Last-Translator: dp \n" -"Language-Team: Italian " -"(http://www.transifex.com/projects/p/searx/language/it/)\n" -"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"Language-Team: Italian (http://www.transifex.com/projects/p/searx/language/it/)\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 1.3\n" +"Language: it\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: searx/webapp.py:167 +#: searx/webapp.py:250 msgid "{minutes} minute(s) ago" -msgstr "" +msgstr "di {minutes} minuti fa" -#: searx/webapp.py:169 +#: searx/webapp.py:252 msgid "{hours} hour(s), {minutes} minute(s) ago" -msgstr "" +msgstr "di {ore} h e {minutes} minuti fa" -#: searx/engines/__init__.py:311 +#: searx/engines/__init__.py:164 msgid "Page loads (sec)" msgstr " Caricamento della pagina (secondi)" -#: searx/engines/__init__.py:315 +#: searx/engines/__init__.py:168 msgid "Number of results" msgstr "Risultati ottenuti" -#: searx/engines/__init__.py:319 +#: searx/engines/__init__.py:172 msgid "Scores" msgstr "Punteggio" -#: searx/engines/__init__.py:323 +#: searx/engines/__init__.py:176 msgid "Scores per result" msgstr "Punteggio per risultato" -#: searx/engines/__init__.py:327 +#: searx/engines/__init__.py:180 msgid "Errors" msgstr "Errori" -#: searx/templates/index.html:7 +#: searx/templates/courgette/index.html:8 searx/templates/default/index.html:8 msgid "about" msgstr "informazioni" -#: searx/templates/index.html:8 +#: searx/templates/courgette/index.html:9 searx/templates/default/index.html:9 msgid "preferences" msgstr "preferenze" -#: searx/templates/preferences.html:5 +#: searx/templates/courgette/preferences.html:5 +#: searx/templates/default/preferences.html:5 msgid "Preferences" msgstr "Preferenze" -#: searx/templates/preferences.html:9 +#: searx/templates/courgette/preferences.html:9 +#: searx/templates/default/preferences.html:9 msgid "Default categories" msgstr "Categorie predefinite" -#: searx/templates/preferences.html:15 +#: searx/templates/courgette/preferences.html:15 +#: searx/templates/default/preferences.html:15 msgid "Search language" msgstr "Lingua di ricerca" -#: searx/templates/preferences.html:18 +#: searx/templates/courgette/preferences.html:18 +#: searx/templates/default/preferences.html:18 msgid "Automatic" msgstr "Automatico" -#: searx/templates/preferences.html:26 +#: searx/templates/courgette/preferences.html:26 +#: searx/templates/default/preferences.html:26 msgid "Interface language" msgstr "Linguaggio dell'interfaccia" -#: searx/templates/preferences.html:36 +#: searx/templates/courgette/preferences.html:36 +#: searx/templates/default/preferences.html:36 +msgid "Autocomplete" +msgstr "Completamento automatico" + +#: searx/templates/courgette/preferences.html:47 +#: searx/templates/default/preferences.html:47 +msgid "Method" +msgstr "Metodo" + +#: searx/templates/courgette/preferences.html:56 +#: searx/templates/default/preferences.html:56 +msgid "Themes" +msgstr "Grafica" + +#: searx/templates/courgette/preferences.html:66 +#: searx/templates/default/preferences.html:66 msgid "Currently used search engines" msgstr "Motori di ricerca attualmente in uso" -#: searx/templates/preferences.html:40 +#: searx/templates/courgette/preferences.html:70 +#: searx/templates/default/preferences.html:70 msgid "Engine name" msgstr "Nome del motore" -#: searx/templates/preferences.html:41 +#: searx/templates/courgette/preferences.html:71 +#: searx/templates/default/preferences.html:71 msgid "Category" msgstr "Categoria" -#: searx/templates/preferences.html:42 searx/templates/preferences.html:53 +#: searx/templates/courgette/preferences.html:72 +#: searx/templates/courgette/preferences.html:83 +#: searx/templates/default/preferences.html:72 +#: searx/templates/default/preferences.html:83 msgid "Allow" msgstr "Autorizza" -#: searx/templates/preferences.html:42 searx/templates/preferences.html:54 +#: searx/templates/courgette/preferences.html:72 +#: searx/templates/courgette/preferences.html:84 +#: searx/templates/default/preferences.html:72 +#: searx/templates/default/preferences.html:84 msgid "Block" msgstr "Blocca" -#: searx/templates/preferences.html:62 +#: searx/templates/courgette/preferences.html:92 +#: searx/templates/default/preferences.html:92 msgid "" -"These settings are stored in your cookies, this allows us not to store " -"this data about you." -msgstr "" -"Queste impostazioni sono salvate nei tuoi cookie, consentendoci di non " -"conservare dati su di te." +"These settings are stored in your cookies, this allows us not to store this " +"data about you." +msgstr "Queste impostazioni sono salvate nei tuoi cookie, consentendoci di non conservare dati su di te." -#: searx/templates/preferences.html:64 +#: searx/templates/courgette/preferences.html:94 +#: searx/templates/default/preferences.html:94 msgid "" "These cookies serve your sole convenience, we don't use these cookies to " "track you." -msgstr "" -"I cookie sono funzionali ad un servizio migliore. Non usiamo i cookie per" -" sorvegliarti." +msgstr "I cookie sono funzionali ad un servizio migliore. Non usiamo i cookie per sorvegliarti." -#: searx/templates/preferences.html:67 +#: searx/templates/courgette/preferences.html:97 +#: searx/templates/default/preferences.html:97 msgid "save" msgstr "salva" -#: searx/templates/preferences.html:68 +#: searx/templates/courgette/preferences.html:98 +#: searx/templates/default/preferences.html:98 msgid "back" msgstr "indietro" -#: searx/templates/results.html:11 -msgid "Suggestions" -msgstr "Suggerimenti" - -#: searx/templates/results.html:22 +#: searx/templates/courgette/results.html:12 +#: searx/templates/default/results.html:12 msgid "Search URL" msgstr "URL della ricerca" -#: searx/templates/results.html:26 +#: searx/templates/courgette/results.html:16 +#: searx/templates/default/results.html:16 msgid "Download results" msgstr "Scarica i risultati" -#: searx/templates/results.html:62 +#: searx/templates/courgette/results.html:34 +#: searx/templates/default/results.html:34 +msgid "Suggestions" +msgstr "Suggerimenti" + +#: searx/templates/courgette/results.html:62 +#: searx/templates/default/results.html:62 msgid "previous page" msgstr "pagina precedente" -#: searx/templates/results.html:73 +#: searx/templates/courgette/results.html:73 +#: searx/templates/default/results.html:73 msgid "next page" msgstr "pagina successiva" -#: searx/templates/search.html:3 +#: searx/templates/courgette/search.html:3 +#: searx/templates/default/search.html:3 msgid "Search for..." -msgstr "" +msgstr "Cerca…" -#: searx/templates/stats.html:4 +#: searx/templates/courgette/stats.html:4 searx/templates/default/stats.html:4 msgid "Engine stats" msgstr "Statistiche dei motori" @@ -173,3 +208,5 @@ msgstr "it" msgid "news" msgstr "notizie" +msgid "map" +msgstr "mappe" diff --git a/searx/translations/nl/LC_MESSAGES/messages.mo b/searx/translations/nl/LC_MESSAGES/messages.mo index 6f456e165244cd76289a050a5f3261a3f3be4ee1..2d55fb3522fd13932d96c0a68adf22f17d2a302d 100644 GIT binary patch delta 931 zcmZwEPe>F|9Ki9P`+v=?+=w+a7(8U8ORgrOLa<7B2ruTvwv1sNba8fP*=CA}Sd1Wu zZbQ_e=+Z?bA}WZeix5;8M8Ogz5kV0_P~D_MeSbR8rQyx{%#<|(vd5| z)6Lt#>o#fh?^z9rL;wgQyAPNRCY6aXgAM_z-pH8CK1vqyu#Wom6y559)~w zpq}g~>VJol+`lg1Fb(P?>RnEwPFO6VHzYCFXR88cmL&Z(V|G5>bRjZIkYyffb7kxz@>Z1|P!LKV(D~Bki{J(ti1_B2SEabsI-m}NTC>e5mtmc70NzB zIwV1M2rEJlv6n6iMo_Rp&_PQIPlAL;k?8wl2OQqK&->5(=l$P%^CP>JDgDfNPmSv$ z_c`v7Iz`9V5WmFp_y#lh8BgIhp1^%PiHBH^L9&+Dge_(zyTCvn z^rAi(KqX$QCD?UrB)*GjoW^FHL*uxsexxv(^3;iqq0YrLH-2eap diff --git a/searx/translations/nl/LC_MESSAGES/messages.po b/searx/translations/nl/LC_MESSAGES/messages.po index 78d848387..46c975c77 100644 --- a/searx/translations/nl/LC_MESSAGES/messages.po +++ b/searx/translations/nl/LC_MESSAGES/messages.po @@ -1,149 +1,184 @@ -# English translations for . +# English translations for PROJECT. # Copyright (C) 2014 ORGANIZATION -# This file is distributed under the same license as the project. -# +# This file is distributed under the same license as the PROJECT project. +# # Translators: # André Koot , 2014 msgid "" msgstr "" -"Project-Id-Version: searx\n" +"Project-Id-Version: searx\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2014-03-18 17:10+0100\n" -"PO-Revision-Date: 2014-03-15 20:20+0000\n" +"POT-Creation-Date: 2014-09-07 21:47+0200\n" +"PO-Revision-Date: 2014-09-09 15:33+0000\n" "Last-Translator: André Koot \n" -"Language-Team: Dutch " -"(http://www.transifex.com/projects/p/searx/language/nl/)\n" -"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"Language-Team: Dutch (http://www.transifex.com/projects/p/searx/language/nl/)\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 1.3\n" +"Language: nl\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: searx/webapp.py:167 +#: searx/webapp.py:250 msgid "{minutes} minute(s) ago" -msgstr "" +msgstr "{minutes} min geleden" -#: searx/webapp.py:169 +#: searx/webapp.py:252 msgid "{hours} hour(s), {minutes} minute(s) ago" -msgstr "" +msgstr "{hours} uur, {minutes} min geleden" -#: searx/engines/__init__.py:311 +#: searx/engines/__init__.py:164 msgid "Page loads (sec)" msgstr "Pagina laadt (sec)" -#: searx/engines/__init__.py:315 +#: searx/engines/__init__.py:168 msgid "Number of results" msgstr "Aantal zoekresultaten" -#: searx/engines/__init__.py:319 +#: searx/engines/__init__.py:172 msgid "Scores" msgstr "Scores" -#: searx/engines/__init__.py:323 +#: searx/engines/__init__.py:176 msgid "Scores per result" msgstr "Scores per zoekresultaat" -#: searx/engines/__init__.py:327 +#: searx/engines/__init__.py:180 msgid "Errors" msgstr "Fouten" -#: searx/templates/index.html:7 +#: searx/templates/courgette/index.html:8 searx/templates/default/index.html:8 msgid "about" msgstr "over" -#: searx/templates/index.html:8 +#: searx/templates/courgette/index.html:9 searx/templates/default/index.html:9 msgid "preferences" msgstr "voorkeuren" -#: searx/templates/preferences.html:5 +#: searx/templates/courgette/preferences.html:5 +#: searx/templates/default/preferences.html:5 msgid "Preferences" msgstr "Voorkeuren" -#: searx/templates/preferences.html:9 +#: searx/templates/courgette/preferences.html:9 +#: searx/templates/default/preferences.html:9 msgid "Default categories" msgstr "Standaardcategorieën" -#: searx/templates/preferences.html:15 +#: searx/templates/courgette/preferences.html:15 +#: searx/templates/default/preferences.html:15 msgid "Search language" msgstr "Zoektaal" -#: searx/templates/preferences.html:18 +#: searx/templates/courgette/preferences.html:18 +#: searx/templates/default/preferences.html:18 msgid "Automatic" msgstr "Automatisch" -#: searx/templates/preferences.html:26 +#: searx/templates/courgette/preferences.html:26 +#: searx/templates/default/preferences.html:26 msgid "Interface language" msgstr "Interfacetaal" -#: searx/templates/preferences.html:36 +#: searx/templates/courgette/preferences.html:36 +#: searx/templates/default/preferences.html:36 +msgid "Autocomplete" +msgstr "Auto-aanvullen" + +#: searx/templates/courgette/preferences.html:47 +#: searx/templates/default/preferences.html:47 +msgid "Method" +msgstr "Methode" + +#: searx/templates/courgette/preferences.html:56 +#: searx/templates/default/preferences.html:56 +msgid "Themes" +msgstr "Thema's" + +#: searx/templates/courgette/preferences.html:66 +#: searx/templates/default/preferences.html:66 msgid "Currently used search engines" msgstr "Momenteel gebruikte zoekmachines" -#: searx/templates/preferences.html:40 +#: searx/templates/courgette/preferences.html:70 +#: searx/templates/default/preferences.html:70 msgid "Engine name" msgstr "Naam zoekmachine" -#: searx/templates/preferences.html:41 +#: searx/templates/courgette/preferences.html:71 +#: searx/templates/default/preferences.html:71 msgid "Category" msgstr "Categorie" -#: searx/templates/preferences.html:42 searx/templates/preferences.html:53 +#: searx/templates/courgette/preferences.html:72 +#: searx/templates/courgette/preferences.html:83 +#: searx/templates/default/preferences.html:72 +#: searx/templates/default/preferences.html:83 msgid "Allow" msgstr "Toestaan" -#: searx/templates/preferences.html:42 searx/templates/preferences.html:54 +#: searx/templates/courgette/preferences.html:72 +#: searx/templates/courgette/preferences.html:84 +#: searx/templates/default/preferences.html:72 +#: searx/templates/default/preferences.html:84 msgid "Block" msgstr "Blokkeren" -#: searx/templates/preferences.html:62 +#: searx/templates/courgette/preferences.html:92 +#: searx/templates/default/preferences.html:92 msgid "" -"These settings are stored in your cookies, this allows us not to store " -"this data about you." -msgstr "" -"Deze instellingen worden bewaard in je cookies. Hierdoor hoeven wij niets" -" over jou te bewaren." +"These settings are stored in your cookies, this allows us not to store this " +"data about you." +msgstr "Deze instellingen worden bewaard in je cookies. Hierdoor hoeven wij niets over jou te bewaren." -#: searx/templates/preferences.html:64 +#: searx/templates/courgette/preferences.html:94 +#: searx/templates/default/preferences.html:94 msgid "" "These cookies serve your sole convenience, we don't use these cookies to " "track you." -msgstr "" -"Deze cookies zijn alleen voor je eigen gemak, we gebruiken deze cookies " -"niet om je te volgen." +msgstr "Deze cookies zijn alleen voor je eigen gemak, we gebruiken deze cookies niet om je te volgen." -#: searx/templates/preferences.html:67 +#: searx/templates/courgette/preferences.html:97 +#: searx/templates/default/preferences.html:97 msgid "save" msgstr "bewaren" -#: searx/templates/preferences.html:68 +#: searx/templates/courgette/preferences.html:98 +#: searx/templates/default/preferences.html:98 msgid "back" msgstr "terug" -#: searx/templates/results.html:11 -msgid "Suggestions" -msgstr "Suggesties" - -#: searx/templates/results.html:22 +#: searx/templates/courgette/results.html:12 +#: searx/templates/default/results.html:12 msgid "Search URL" msgstr "Zoek URL" -#: searx/templates/results.html:26 +#: searx/templates/courgette/results.html:16 +#: searx/templates/default/results.html:16 msgid "Download results" msgstr "Downloaden zoekresultaten" -#: searx/templates/results.html:62 +#: searx/templates/courgette/results.html:34 +#: searx/templates/default/results.html:34 +msgid "Suggestions" +msgstr "Suggesties" + +#: searx/templates/courgette/results.html:62 +#: searx/templates/default/results.html:62 msgid "previous page" msgstr "vorige pagina" -#: searx/templates/results.html:73 +#: searx/templates/courgette/results.html:73 +#: searx/templates/default/results.html:73 msgid "next page" msgstr "volgende pagina" -#: searx/templates/search.html:3 +#: searx/templates/courgette/search.html:3 +#: searx/templates/default/search.html:3 msgid "Search for..." msgstr "Zoeken naar..." -#: searx/templates/stats.html:4 +#: searx/templates/courgette/stats.html:4 searx/templates/default/stats.html:4 msgid "Engine stats" msgstr "Zoekmachinestatistieken" @@ -173,3 +208,5 @@ msgstr "it" msgid "news" msgstr "nieuws" +msgid "map" +msgstr "kaart" From b0bb94fd377da826b2b720e65e558fbeb932bc4c Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Sun, 12 Oct 2014 14:33:03 +0200 Subject: [PATCH 08/22] [fix] wikidata: using only the first url --- searx/engines/wikidata.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/searx/engines/wikidata.py b/searx/engines/wikidata.py index 761f8f73c..7877e1198 100644 --- a/searx/engines/wikidata.py +++ b/searx/engines/wikidata.py @@ -64,7 +64,7 @@ def getDetail(jsonresponse, wikidata_id, language): misc_language = get_wiki_firstlanguage(result, 'wiki') if misc_language != None: add_url(urls, 'Wikipedia (' + misc_language + ')', get_wikilink(result, misc_language + 'wiki')) - + if language != 'en': add_url(urls, 'Wiki voyage (' + language + ')', get_wikilink(result, language + 'wikivoyage')) add_url(urls, 'Wiki voyage (en)', get_wikilink(result, 'enwikivoyage')) @@ -163,7 +163,8 @@ def get_string(claims, propertyName, defaultValue=None): if len(result) == 0: return defaultValue else: - return ', '.join(result) + #TODO handle multiple urls + return result[0] def get_time(claims, propertyName, defaultValue=None): From e1b76c6811c7a182fef09acc529cfb50a110be6d Mon Sep 17 00:00:00 2001 From: kernc Date: Mon, 13 Oct 2014 14:51:15 +0200 Subject: [PATCH 09/22] Search Music also on YouTube YouTube hosts a lot of music and should be enabled for Music search by default. --- searx/engines/youtube.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searx/engines/youtube.py b/searx/engines/youtube.py index a3c3980af..794028845 100644 --- a/searx/engines/youtube.py +++ b/searx/engines/youtube.py @@ -13,7 +13,7 @@ from urllib import urlencode from dateutil import parser # engine dependent config -categories = ['videos'] +categories = ['videos', 'music'] paging = True language_support = True From 9b9f097adbf39d7908931203e9d8966748900bde Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Sun, 14 Sep 2014 11:09:44 +0200 Subject: [PATCH 10/22] Implementing https rewrite support #71 * parsing XML-Files which contain target, exclusions and rules * convert regex if required (is a little hack, probably does not work for all rules) * check if target rule apply for http url, and use the rules to rewrite it * add pice of code, to check if domain name has not changed during rewrite (should be rewritten, using publicsuffix instead of little hack) --- searx/__init__.py | 8 +++ searx/https_rewrite.py | 141 ++++++++++++++++++++++++++++++++++++++--- searx/webapp.py | 52 +++++++++++++-- 3 files changed, 187 insertions(+), 14 deletions(-) diff --git a/searx/__init__.py b/searx/__init__.py index 375a5414a..0acc61447 100644 --- a/searx/__init__.py +++ b/searx/__init__.py @@ -1,5 +1,6 @@ from os import environ from os.path import realpath, dirname, join, abspath +from searx.https_rewrite import load_https_rules try: from yaml import load except: @@ -15,6 +16,13 @@ if 'SEARX_SETTINGS_PATH' in environ: else: settings_path = join(searx_dir, 'settings.yml') +if 'SEARX_HTTPS_REWRITE_PATH' in environ: + https_rewrite_path = environ['SEARX_HTTPS_REWRITE_PATH'] +else: + https_rewrite_path = join(searx_dir, 'https_rules') with open(settings_path) as settings_yaml: settings = load(settings_yaml) + +# loade https rules +load_https_rules(https_rewrite_path) diff --git a/searx/https_rewrite.py b/searx/https_rewrite.py index 44ada9450..814eda2de 100644 --- a/searx/https_rewrite.py +++ b/searx/https_rewrite.py @@ -1,14 +1,139 @@ +''' +searx is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +searx is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with searx. If not, see < http://www.gnu.org/licenses/ >. + +(C) 2013- by Adam Tauber, +''' + import re +from lxml import etree +from os import listdir +from os.path import isfile, join + # https://gitweb.torproject.org/\ # pde/https-everywhere.git/tree/4.0:/src/chrome/content/rules # HTTPS rewrite rules -https_rules = ( - # from - (re.compile(r'^http://(www\.|m\.|)?xkcd\.(?:com|org)/', re.I | re.U), - # to - r'https://\1xkcd.com/'), - (re.compile(r'^https?://(?:ssl)?imgs\.xkcd\.com/', re.I | re.U), - r'https://sslimgs.xkcd.com/'), -) +https_rules = [] + + +# load single ruleset from a xml file +def load_single_https_ruleset(filepath): + ruleset = () + + # init parser + parser = etree.XMLParser() + + # load and parse xml-file + try: + tree = etree.parse(filepath, parser) + except: + # TODO, error message + return () + + # get root node + root = tree.getroot() + + #print(etree.tostring(tree)) + + # check if root is a node with the name ruleset + # TODO improve parsing + if root.tag != 'ruleset': + return () + + # check if rule is deactivated by default + if root.attrib.get('default_off'): + return () + + # check if rule does only work for specific platforms + if root.attrib.get('platform'): + return () + + hosts = [] + rules = [] + exclusions = [] + + # parse childs from ruleset + for ruleset in root: + # this child define a target + if ruleset.tag == 'target': + # check if required tags available + if not ruleset.attrib.get('host'): + continue + + # convert host-rule to valid regex + host = ruleset.attrib.get('host').replace('.', '\.').replace('*', '.*') + + # append to host list + hosts.append(host) + + # this child define a rule + elif ruleset.tag == 'rule': + # check if required tags available + if not ruleset.attrib.get('from')\ + or not ruleset.attrib.get('to'): + continue + + # TODO hack, which convert a javascript regex group into a valid python regex group + rule_from = ruleset.attrib.get('from').replace('$', '\\') + rule_to = ruleset.attrib.get('to').replace('$', '\\') + + # TODO, not working yet because of the hack above, currently doing that in webapp.py + #rule_from_rgx = re.compile(rule_from, re.I) + + # append rule + rules.append((rule_from, rule_to)) + + # this child define an exclusion + elif ruleset.tag == 'exclusion': + # check if required tags available + if not ruleset.attrib.get('pattern'): + continue + + exclusion_rgx = re.compile(ruleset.attrib.get('pattern')) + + # append exclusion + exclusions.append(exclusion_rgx) + + # convert list of possible hosts to a simple regex + # TODO compress regex to improve performance + try: + target_hosts = re.compile('^(' + '|'.join(hosts) + ')', re.I | re.U) + except: + return () + + # return ruleset + return (target_hosts, rules, exclusions) + + +# load all https rewrite rules +def load_https_rules(rules_path): + # add / to path if not set yet + if rules_path[-1:] != '/': + rules_path += '/' + + # search all xml files which are stored in the https rule directory + xml_files = [ join(rules_path,f) for f in listdir(rules_path) if isfile(join(rules_path,f)) and f[-4:] == '.xml' ] + + # load xml-files + for ruleset_file in xml_files: + # calculate rewrite-rules + ruleset = load_single_https_ruleset(ruleset_file) + + # skip if no ruleset returned + if not ruleset: + continue + + # append ruleset + https_rules.append(ruleset) diff --git a/searx/webapp.py b/searx/webapp.py index 2bf3afaf4..7952415af 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -49,6 +49,9 @@ from searx.languages import language_codes from searx.search import Search from searx.autocomplete import backends as autocomplete_backends +from urlparse import urlparse +import re + static_path, templates_path, themes =\ get_themes(settings['themes_path'] @@ -197,16 +200,53 @@ def index(): if not search.paging and engines[result['engine']].paging: search.paging = True + # check if HTTPS rewrite is required if settings['server']['https_rewrite']\ and result['parsed_url'].scheme == 'http': - for http_regex, https_url in https_rules: - if http_regex.match(result['url']): - result['url'] = http_regex.sub(https_url, result['url']) - # TODO result['parsed_url'].scheme - break + skip_https_rewrite = False + + # check if HTTPS rewrite is possible + for target, rules, exclusions in https_rules: + + # check if target regex match with url + if target.match(result['url']): + # process exclusions + for exclusion in exclusions: + # check if exclusion match with url + if exclusion.match(result['url']): + skip_https_rewrite = True + break + + # skip https rewrite if required + if skip_https_rewrite: + break + + # process rules + for rule in rules: + # TODO, precompile rule + p = re.compile(rule[0]) + # rewrite url if possible + new_result_url = p.sub(rule[1], result['url']) + + # parse new url + new_parsed_url = urlparse(new_result_url) + + # continiue if nothing was rewritten + if result['url'] == new_result_url: + continue + + # get domainname from result + # TODO, does only work correct with TLD's like asdf.com, not for asdf.com.de + # TODO, using publicsuffix instead of this rewrite rule + old_result_domainname = '.'.join(result['parsed_url'].hostname.split('.')[-2:]) + new_result_domainname = '.'.join(new_parsed_url.hostname.split('.')[-2:]) + + # check if rewritten hostname is the same, to protect against wrong or malicious rewrite rules + if old_result_domainname == new_result_domainname: + # set new url + result['url'] = new_result_url - # HTTPS rewrite if search.request_data.get('format', 'html') == 'html': if 'content' in result: result['content'] = highlight_content(result['content'], From 6e6dbc1bb4a3e6f8746ea3677cdbc190c762b511 Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Sun, 14 Sep 2014 13:24:40 +0200 Subject: [PATCH 11/22] update settings_robot.yml --- searx/settings_robot.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/searx/settings_robot.yml b/searx/settings_robot.yml index 98944a811..bb91dce8f 100644 --- a/searx/settings_robot.yml +++ b/searx/settings_robot.yml @@ -4,6 +4,9 @@ server: debug : False request_timeout : 3.0 # seconds base_url: False + themes_path : "" + default_theme : default + https_rewrite : True engines: - name : general_dummy From 0616d26feb0f96b3d4fd6b2744ae0288c9fed96b Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Sun, 14 Sep 2014 14:17:12 +0200 Subject: [PATCH 12/22] improve https rewriting --- searx/__init__.py | 6 ++++-- searx/webapp.py | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/searx/__init__.py b/searx/__init__.py index 0acc61447..d4fc7f0bb 100644 --- a/searx/__init__.py +++ b/searx/__init__.py @@ -24,5 +24,7 @@ else: with open(settings_path) as settings_yaml: settings = load(settings_yaml) -# loade https rules -load_https_rules(https_rewrite_path) +# load https rules only if https rewrite is enabled +if settings.get('server', {}).get('https_rewrite'): + # loade https rules + load_https_rules(https_rewrite_path) diff --git a/searx/webapp.py b/searx/webapp.py index 7952415af..d9dc5f710 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -247,6 +247,9 @@ def index(): # set new url result['url'] = new_result_url + # target has matched, do not search over the other rules + break + if search.request_data.get('format', 'html') == 'html': if 'content' in result: result['content'] = highlight_content(result['content'], From bb126da0fb49d1c9640eeb3371d0bbcf005bcd2b Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Wed, 15 Oct 2014 14:47:03 +0200 Subject: [PATCH 13/22] improve https rewrite code --- searx/https_rewrite.py | 2 ++ searx/webapp.py | 12 ++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/searx/https_rewrite.py b/searx/https_rewrite.py index 814eda2de..18405d87a 100644 --- a/searx/https_rewrite.py +++ b/searx/https_rewrite.py @@ -137,3 +137,5 @@ def load_https_rules(rules_path): # append ruleset https_rules.append(ruleset) + + print(' * {n} https-rules loaded'.format(n=len(https_rules))) diff --git a/searx/webapp.py b/searx/webapp.py index d9dc5f710..25c99d94c 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -224,10 +224,14 @@ def index(): # process rules for rule in rules: - # TODO, precompile rule - p = re.compile(rule[0]) - # rewrite url if possible - new_result_url = p.sub(rule[1], result['url']) + try: + # TODO, precompile rule + p = re.compile(rule[0]) + + # rewrite url if possible + new_result_url = p.sub(rule[1], result['url']) + except: + break # parse new url new_parsed_url = urlparse(new_result_url) From 1e3e6465845236b027ce8df9ab5fcc78ffe3f1d1 Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Wed, 15 Oct 2014 14:52:27 +0200 Subject: [PATCH 14/22] import basic https rules from https-everywhere repository * licenced under GPLv3+ * downloaded from https://github.com/EFForg/https-everywhere --- searx/https_rules/00README | 17 + searx/https_rules/Bing.xml | 56 + searx/https_rules/Dailymotion.xml | 69 + searx/https_rules/Deviantart.xml | 53 + searx/https_rules/DuckDuckGo.xml | 38 + searx/https_rules/Flickr.xml | 44 + searx/https_rules/Github-Pages.xml | 11 + searx/https_rules/Github.xml | 94 + searx/https_rules/Google-mismatches.xml | 26 + searx/https_rules/Google.org.xml | 14 + searx/https_rules/GoogleAPIs.xml | 143 ++ searx/https_rules/GoogleCanada.xml | 6 + searx/https_rules/GoogleImages.xml | 65 + searx/https_rules/GoogleMainSearch.xml | 78 + searx/https_rules/GoogleMaps.xml | 67 + searx/https_rules/GoogleMelange.xml | 6 + searx/https_rules/GoogleSearch.xml | 135 ++ searx/https_rules/GoogleServices.xml | 345 ++++ searx/https_rules/GoogleShopping.xml | 28 + searx/https_rules/GoogleSorry.xml | 7 + searx/https_rules/GoogleTranslate.xml | 8 + searx/https_rules/GoogleVideos.xml | 83 + searx/https_rules/GoogleWatchBlog.xml | 17 + searx/https_rules/Google_App_Engine.xml | 21 + searx/https_rules/Googleplex.com.xml | 16 + searx/https_rules/OpenStreetMap.xml | 15 + searx/https_rules/Rawgithub.com.xml | 14 + searx/https_rules/Soundcloud.xml | 101 + searx/https_rules/ThePirateBay.xml | 36 + searx/https_rules/Torproject.xml | 18 + searx/https_rules/Twitter.xml | 169 ++ searx/https_rules/Vimeo.xml | 75 + searx/https_rules/WikiLeaks.xml | 13 + searx/https_rules/Wikimedia.xml | 107 + searx/https_rules/Yahoo.xml | 2450 +++++++++++++++++++++++ searx/https_rules/YouTube.xml | 46 + 36 files changed, 4491 insertions(+) create mode 100644 searx/https_rules/00README create mode 100644 searx/https_rules/Bing.xml create mode 100644 searx/https_rules/Dailymotion.xml create mode 100644 searx/https_rules/Deviantart.xml create mode 100644 searx/https_rules/DuckDuckGo.xml create mode 100644 searx/https_rules/Flickr.xml create mode 100644 searx/https_rules/Github-Pages.xml create mode 100644 searx/https_rules/Github.xml create mode 100644 searx/https_rules/Google-mismatches.xml create mode 100644 searx/https_rules/Google.org.xml create mode 100644 searx/https_rules/GoogleAPIs.xml create mode 100644 searx/https_rules/GoogleCanada.xml create mode 100644 searx/https_rules/GoogleImages.xml create mode 100644 searx/https_rules/GoogleMainSearch.xml create mode 100644 searx/https_rules/GoogleMaps.xml create mode 100644 searx/https_rules/GoogleMelange.xml create mode 100644 searx/https_rules/GoogleSearch.xml create mode 100644 searx/https_rules/GoogleServices.xml create mode 100644 searx/https_rules/GoogleShopping.xml create mode 100644 searx/https_rules/GoogleSorry.xml create mode 100644 searx/https_rules/GoogleTranslate.xml create mode 100644 searx/https_rules/GoogleVideos.xml create mode 100644 searx/https_rules/GoogleWatchBlog.xml create mode 100644 searx/https_rules/Google_App_Engine.xml create mode 100644 searx/https_rules/Googleplex.com.xml create mode 100644 searx/https_rules/OpenStreetMap.xml create mode 100644 searx/https_rules/Rawgithub.com.xml create mode 100644 searx/https_rules/Soundcloud.xml create mode 100644 searx/https_rules/ThePirateBay.xml create mode 100644 searx/https_rules/Torproject.xml create mode 100644 searx/https_rules/Twitter.xml create mode 100644 searx/https_rules/Vimeo.xml create mode 100644 searx/https_rules/WikiLeaks.xml create mode 100644 searx/https_rules/Wikimedia.xml create mode 100644 searx/https_rules/Yahoo.xml create mode 100644 searx/https_rules/YouTube.xml diff --git a/searx/https_rules/00README b/searx/https_rules/00README new file mode 100644 index 000000000..fcd8a7724 --- /dev/null +++ b/searx/https_rules/00README @@ -0,0 +1,17 @@ + diff --git a/searx/https_rules/Bing.xml b/searx/https_rules/Bing.xml new file mode 100644 index 000000000..8b403f108 --- /dev/null +++ b/searx/https_rules/Bing.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + diff --git a/searx/https_rules/Dailymotion.xml b/searx/https_rules/Dailymotion.xml new file mode 100644 index 000000000..743100cb7 --- /dev/null +++ b/searx/https_rules/Dailymotion.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/searx/https_rules/Deviantart.xml b/searx/https_rules/Deviantart.xml new file mode 100644 index 000000000..7830fc20f --- /dev/null +++ b/searx/https_rules/Deviantart.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/searx/https_rules/DuckDuckGo.xml b/searx/https_rules/DuckDuckGo.xml new file mode 100644 index 000000000..173a9ad9f --- /dev/null +++ b/searx/https_rules/DuckDuckGo.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/searx/https_rules/Flickr.xml b/searx/https_rules/Flickr.xml new file mode 100644 index 000000000..85c6e8065 --- /dev/null +++ b/searx/https_rules/Flickr.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/searx/https_rules/Github-Pages.xml b/searx/https_rules/Github-Pages.xml new file mode 100644 index 000000000..d3be58a4c --- /dev/null +++ b/searx/https_rules/Github-Pages.xml @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/searx/https_rules/Github.xml b/searx/https_rules/Github.xml new file mode 100644 index 000000000..a9a3a1e53 --- /dev/null +++ b/searx/https_rules/Github.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/searx/https_rules/Google-mismatches.xml b/searx/https_rules/Google-mismatches.xml new file mode 100644 index 000000000..de9d3eb18 --- /dev/null +++ b/searx/https_rules/Google-mismatches.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + diff --git a/searx/https_rules/Google.org.xml b/searx/https_rules/Google.org.xml new file mode 100644 index 000000000..d6cc47881 --- /dev/null +++ b/searx/https_rules/Google.org.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/searx/https_rules/GoogleAPIs.xml b/searx/https_rules/GoogleAPIs.xml new file mode 100644 index 000000000..85a5a8081 --- /dev/null +++ b/searx/https_rules/GoogleAPIs.xml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/searx/https_rules/GoogleCanada.xml b/searx/https_rules/GoogleCanada.xml new file mode 100644 index 000000000..d5eefe816 --- /dev/null +++ b/searx/https_rules/GoogleCanada.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/searx/https_rules/GoogleImages.xml b/searx/https_rules/GoogleImages.xml new file mode 100644 index 000000000..0112001e0 --- /dev/null +++ b/searx/https_rules/GoogleImages.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/searx/https_rules/GoogleMainSearch.xml b/searx/https_rules/GoogleMainSearch.xml new file mode 100644 index 000000000..df504d90c --- /dev/null +++ b/searx/https_rules/GoogleMainSearch.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/searx/https_rules/GoogleMaps.xml b/searx/https_rules/GoogleMaps.xml new file mode 100644 index 000000000..0f82c5267 --- /dev/null +++ b/searx/https_rules/GoogleMaps.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/searx/https_rules/GoogleMelange.xml b/searx/https_rules/GoogleMelange.xml new file mode 100644 index 000000000..ec23cd45f --- /dev/null +++ b/searx/https_rules/GoogleMelange.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/searx/https_rules/GoogleSearch.xml b/searx/https_rules/GoogleSearch.xml new file mode 100644 index 000000000..66b7ffdb0 --- /dev/null +++ b/searx/https_rules/GoogleSearch.xml @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/searx/https_rules/GoogleServices.xml b/searx/https_rules/GoogleServices.xml new file mode 100644 index 000000000..704646b53 --- /dev/null +++ b/searx/https_rules/GoogleServices.xml @@ -0,0 +1,345 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/searx/https_rules/GoogleShopping.xml b/searx/https_rules/GoogleShopping.xml new file mode 100644 index 000000000..6ba69a91d --- /dev/null +++ b/searx/https_rules/GoogleShopping.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/searx/https_rules/GoogleSorry.xml b/searx/https_rules/GoogleSorry.xml new file mode 100644 index 000000000..72a19210d --- /dev/null +++ b/searx/https_rules/GoogleSorry.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/searx/https_rules/GoogleTranslate.xml b/searx/https_rules/GoogleTranslate.xml new file mode 100644 index 000000000..a004025ae --- /dev/null +++ b/searx/https_rules/GoogleTranslate.xml @@ -0,0 +1,8 @@ + + + + + + + diff --git a/searx/https_rules/GoogleVideos.xml b/searx/https_rules/GoogleVideos.xml new file mode 100644 index 000000000..a5e88fcf0 --- /dev/null +++ b/searx/https_rules/GoogleVideos.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/searx/https_rules/GoogleWatchBlog.xml b/searx/https_rules/GoogleWatchBlog.xml new file mode 100644 index 000000000..afec70c97 --- /dev/null +++ b/searx/https_rules/GoogleWatchBlog.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/searx/https_rules/Google_App_Engine.xml b/searx/https_rules/Google_App_Engine.xml new file mode 100644 index 000000000..851e051d1 --- /dev/null +++ b/searx/https_rules/Google_App_Engine.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/searx/https_rules/Googleplex.com.xml b/searx/https_rules/Googleplex.com.xml new file mode 100644 index 000000000..7ddbb5ba9 --- /dev/null +++ b/searx/https_rules/Googleplex.com.xml @@ -0,0 +1,16 @@ + + + + + + + + diff --git a/searx/https_rules/OpenStreetMap.xml b/searx/https_rules/OpenStreetMap.xml new file mode 100644 index 000000000..58a661823 --- /dev/null +++ b/searx/https_rules/OpenStreetMap.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + diff --git a/searx/https_rules/Rawgithub.com.xml b/searx/https_rules/Rawgithub.com.xml new file mode 100644 index 000000000..3868f332a --- /dev/null +++ b/searx/https_rules/Rawgithub.com.xml @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/searx/https_rules/Soundcloud.xml b/searx/https_rules/Soundcloud.xml new file mode 100644 index 000000000..0baa5832b --- /dev/null +++ b/searx/https_rules/Soundcloud.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/searx/https_rules/ThePirateBay.xml b/searx/https_rules/ThePirateBay.xml new file mode 100644 index 000000000..010387b6b --- /dev/null +++ b/searx/https_rules/ThePirateBay.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/searx/https_rules/Torproject.xml b/searx/https_rules/Torproject.xml new file mode 100644 index 000000000..69269af7e --- /dev/null +++ b/searx/https_rules/Torproject.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + diff --git a/searx/https_rules/Twitter.xml b/searx/https_rules/Twitter.xml new file mode 100644 index 000000000..3285f44e0 --- /dev/null +++ b/searx/https_rules/Twitter.xml @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/searx/https_rules/Vimeo.xml b/searx/https_rules/Vimeo.xml new file mode 100644 index 000000000..f2a3e5764 --- /dev/null +++ b/searx/https_rules/Vimeo.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/searx/https_rules/WikiLeaks.xml b/searx/https_rules/WikiLeaks.xml new file mode 100644 index 000000000..977709d2d --- /dev/null +++ b/searx/https_rules/WikiLeaks.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/searx/https_rules/Wikimedia.xml b/searx/https_rules/Wikimedia.xml new file mode 100644 index 000000000..9f25831a2 --- /dev/null +++ b/searx/https_rules/Wikimedia.xml @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/searx/https_rules/Yahoo.xml b/searx/https_rules/Yahoo.xml new file mode 100644 index 000000000..33548c4ab --- /dev/null +++ b/searx/https_rules/Yahoo.xml @@ -0,0 +1,2450 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/searx/https_rules/YouTube.xml b/searx/https_rules/YouTube.xml new file mode 100644 index 000000000..bddc2a5f3 --- /dev/null +++ b/searx/https_rules/YouTube.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 8af2184a45d28105876f1e5529c829de3f36a428 Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Fri, 17 Oct 2014 12:34:51 +0200 Subject: [PATCH 15/22] add faroo engine support --- searx/engines/faroo.py | 108 +++++++++++++++++++++++++++++++++++++++++ searx/settings.yml | 6 +++ searx/utils.py | 3 ++ 3 files changed, 117 insertions(+) create mode 100644 searx/engines/faroo.py diff --git a/searx/engines/faroo.py b/searx/engines/faroo.py new file mode 100644 index 000000000..31104353f --- /dev/null +++ b/searx/engines/faroo.py @@ -0,0 +1,108 @@ +## Farro (Web, News) +# +# @website http://www.faroo.com +# @provide-api yes (http://www.faroo.com/hp/api/api.html), require API-key +# +# @using-api yes +# @results JSON +# @stable yes +# @parse url, title, content, publishedDate, img_src + +from urllib import urlencode +from json import loads +import datetime +from searx.utils import searx_useragent + +# engine dependent config +categories = ['general', 'news'] +paging = True +language_support = True +number_of_results = 10 +api_key = None + +# search-url +url = 'http://www.faroo.com/' +search_url = url + 'api?{query}&start={offset}&length={number_of_results}&l={language}&src={categorie}&i=false&f=json&key={api_key}' + +search_category = {'general': 'web', + 'news': 'news'} + +# do search-request +def request(query, params): + offset = (params['pageno'] - 1) * number_of_results + categorie = search_category.get(params['category'], 'web') + + if params['language'] == 'all': + language = 'en' + else: + language = params['language'].split('_')[0] + + # skip, if language is not supported + if language != 'en' and\ + language != 'de' and\ + language != 'zh': + return params + + params['url'] = search_url.format(offset=offset, + number_of_results=number_of_results, + query=urlencode({'q': query}), + language=language, + categorie=categorie, + api_key=api_key ) + + # using searx User-Agent + params['headers']['User-Agent'] = searx_useragent() + + return params + + +# get response from search-request +def response(resp): + # HTTP-Code 401: api-key is not valide + if resp.status_code == 401: + raise Exception("API key is not valide") + return [] + + # HTTP-Code 429: rate limit exceeded + if resp.status_code == 429: + raise Exception("rate limit has been exceeded!") + return [] + + results = [] + + search_res = loads(resp.text) + + # return empty array if there are no results + if not search_res.get('results', {}): + return [] + + # parse results + for result in search_res['results']: + if result['news'] == 'true': + # timestamp (how many milliseconds have passed between now and the beginning of 1970) + publishedDate = datetime.datetime.fromtimestamp(result['date']/1000.0) + + # append news result + results.append({'url': result['url'], + 'title': result['title'], + 'publishedDate': publishedDate, + 'content': result['kwic']}) + + else: + # append general result + # TODO, publishedDate correct? + results.append({'url': result['url'], + 'title': result['title'], + 'content': result['kwic']}) + + # append image result if image url is set + # TODO, show results with an image like in faroo + if result['iurl']: + results.append({'template': 'images.html', + 'url': result['url'], + 'title': result['title'], + 'content': result['kwic'], + 'img_src': result['iurl']}) + + # return results + return results diff --git a/searx/settings.yml b/searx/settings.yml index da053ce6a..a627c3676 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -48,6 +48,12 @@ engines: engine : duckduckgo shortcut : ddg +# api-key required: http://www.faroo.com/hp/api/api.html#key +# - name : faroo +# engine : faroo +# shortcut : fa +# api_key : 'apikey' # required! + # down - website is under criminal investigation by the UK # - name : filecrop # engine : filecrop diff --git a/searx/utils.py b/searx/utils.py index a9ece355a..28e42b272 100644 --- a/searx/utils.py +++ b/searx/utils.py @@ -20,6 +20,9 @@ def gen_useragent(): return ua.format(os=choice(ua_os), version=choice(ua_versions)) +def searx_useragent(): + return 'searx' + def highlight_content(content, query): if not content: From db4ca4784b614e84df6c7de8ffbf56ca39e1cc2e Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Fri, 17 Oct 2014 12:54:22 +0200 Subject: [PATCH 16/22] fix faroo engine --- searx/engines/faroo.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/searx/engines/faroo.py b/searx/engines/faroo.py index 31104353f..500d3c592 100644 --- a/searx/engines/faroo.py +++ b/searx/engines/faroo.py @@ -29,7 +29,7 @@ search_category = {'general': 'web', # do search-request def request(query, params): - offset = (params['pageno'] - 1) * number_of_results + offset = (params['pageno']-1) * number_of_results + 1 categorie = search_category.get(params['category'], 'web') if params['language'] == 'all': @@ -78,7 +78,7 @@ def response(resp): # parse results for result in search_res['results']: - if result['news'] == 'true': + if result['news']: # timestamp (how many milliseconds have passed between now and the beginning of 1970) publishedDate = datetime.datetime.fromtimestamp(result['date']/1000.0) @@ -95,14 +95,14 @@ def response(resp): 'title': result['title'], 'content': result['kwic']}) - # append image result if image url is set - # TODO, show results with an image like in faroo - if result['iurl']: - results.append({'template': 'images.html', - 'url': result['url'], - 'title': result['title'], - 'content': result['kwic'], - 'img_src': result['iurl']}) + # append image result if image url is set + # TODO, show results with an image like in faroo + if result['iurl']: + results.append({'template': 'images.html', + 'url': result['url'], + 'title': result['title'], + 'content': result['kwic'], + 'img_src': result['iurl']}) # return results return results From bc5a7153d38b2d4e12a8f4bb63c363efa4ad0b7d Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Fri, 17 Oct 2014 12:56:14 +0200 Subject: [PATCH 17/22] fix comment header of faroo engine --- searx/engines/faroo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searx/engines/faroo.py b/searx/engines/faroo.py index 500d3c592..8c69c5bee 100644 --- a/searx/engines/faroo.py +++ b/searx/engines/faroo.py @@ -1,4 +1,4 @@ -## Farro (Web, News) +## Faroo (Web, News) # # @website http://www.faroo.com # @provide-api yes (http://www.faroo.com/hp/api/api.html), require API-key From b0fd71b7b3463864e6c60156610d383af2ac9709 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Sun, 19 Oct 2014 12:18:21 +0200 Subject: [PATCH 18/22] [fix] pep8 compatibility --- searx/engines/yahoo_news.py | 13 +++++++------ searx/https_rewrite.py | 27 +++++++++++++++------------ 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/searx/engines/yahoo_news.py b/searx/engines/yahoo_news.py index c07d7e185..4a7dd16ea 100644 --- a/searx/engines/yahoo_news.py +++ b/searx/engines/yahoo_news.py @@ -1,8 +1,9 @@ -## Yahoo (News) -# +# Yahoo (News) +# # @website https://news.yahoo.com -# @provide-api yes (https://developer.yahoo.com/boss/search/), $0.80/1000 queries -# +# @provide-api yes (https://developer.yahoo.com/boss/search/) +# $0.80/1000 queries +# # @using-api no (because pricing) # @results HTML (using search portal) # @stable no (HTML can change) @@ -22,7 +23,7 @@ paging = True language_support = True # search-url -search_url = 'https://news.search.yahoo.com/search?{query}&b={offset}&fl=1&vl=lang_{lang}' +search_url = 'https://news.search.yahoo.com/search?{query}&b={offset}&fl=1&vl=lang_{lang}' # noqa # specific xpath variables results_xpath = '//div[@class="res"]' @@ -41,7 +42,7 @@ def request(query, params): language = 'en' else: language = params['language'].split('_')[0] - + params['url'] = search_url.format(offset=offset, query=urlencode({'p': query}), lang=language) diff --git a/searx/https_rewrite.py b/searx/https_rewrite.py index 18405d87a..b2731ae28 100644 --- a/searx/https_rewrite.py +++ b/searx/https_rewrite.py @@ -45,11 +45,9 @@ def load_single_https_ruleset(filepath): # get root node root = tree.getroot() - #print(etree.tostring(tree)) - # check if root is a node with the name ruleset # TODO improve parsing - if root.tag != 'ruleset': + if root.tag != 'ruleset': return () # check if rule is deactivated by default @@ -68,36 +66,39 @@ def load_single_https_ruleset(filepath): for ruleset in root: # this child define a target if ruleset.tag == 'target': - # check if required tags available + # check if required tags available if not ruleset.attrib.get('host'): continue # convert host-rule to valid regex - host = ruleset.attrib.get('host').replace('.', '\.').replace('*', '.*') + host = ruleset.attrib.get('host')\ + .replace('.', '\.').replace('*', '.*') # append to host list hosts.append(host) # this child define a rule elif ruleset.tag == 'rule': - # check if required tags available + # check if required tags available if not ruleset.attrib.get('from')\ or not ruleset.attrib.get('to'): continue - # TODO hack, which convert a javascript regex group into a valid python regex group + # TODO hack, which convert a javascript regex group + # into a valid python regex group rule_from = ruleset.attrib.get('from').replace('$', '\\') rule_to = ruleset.attrib.get('to').replace('$', '\\') - # TODO, not working yet because of the hack above, currently doing that in webapp.py - #rule_from_rgx = re.compile(rule_from, re.I) + # TODO, not working yet because of the hack above, + # currently doing that in webapp.py + # rule_from_rgx = re.compile(rule_from, re.I) # append rule rules.append((rule_from, rule_to)) # this child define an exclusion elif ruleset.tag == 'exclusion': - # check if required tags available + # check if required tags available if not ruleset.attrib.get('pattern'): continue @@ -124,7 +125,9 @@ def load_https_rules(rules_path): rules_path += '/' # search all xml files which are stored in the https rule directory - xml_files = [ join(rules_path,f) for f in listdir(rules_path) if isfile(join(rules_path,f)) and f[-4:] == '.xml' ] + xml_files = [join(rules_path, f) + for f in listdir(rules_path) + if isfile(join(rules_path, f)) and f[-4:] == '.xml'] # load xml-files for ruleset_file in xml_files: @@ -137,5 +140,5 @@ def load_https_rules(rules_path): # append ruleset https_rules.append(ruleset) - + print(' * {n} https-rules loaded'.format(n=len(https_rules))) From 5740cfbf1cb468af74d0e7e1c9358ce702eb4f59 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Sun, 19 Oct 2014 12:41:04 +0200 Subject: [PATCH 19/22] [fix] pep8 part II. --- searx/__init__.py | 3 +- searx/engines/__init__.py | 11 +++-- searx/query.py | 43 ++++++++-------- searx/search.py | 100 +++++++++++++++++++++++++------------- searx/utils.py | 9 ++-- searx/webapp.py | 31 +++++++----- 6 files changed, 119 insertions(+), 78 deletions(-) diff --git a/searx/__init__.py b/searx/__init__.py index c4c363bf8..46685817a 100644 --- a/searx/__init__.py +++ b/searx/__init__.py @@ -28,7 +28,8 @@ except: searx_dir = abspath(dirname(__file__)) engine_dir = dirname(realpath(__file__)) -# if possible set path to settings using the enviroment variable SEARX_SETTINGS_PATH +# if possible set path to settings using the +# enviroment variable SEARX_SETTINGS_PATH if 'SEARX_SETTINGS_PATH' in environ: settings_path = environ['SEARX_SETTINGS_PATH'] # otherwise using default path diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py index e63dd7189..80356a8cd 100644 --- a/searx/engines/__init__.py +++ b/searx/engines/__init__.py @@ -41,7 +41,7 @@ def load_module(filename): module.name = modname return module -if not 'engines' in settings or not settings['engines']: +if 'engines' not in settings or not settings['engines']: print '[E] Error no engines found. Edit your settings.yml' exit(2) @@ -68,15 +68,15 @@ for engine_data in settings['engines']: engine.categories = ['general'] if not hasattr(engine, 'language_support'): - #engine.language_support = False + # engine.language_support = False engine.language_support = True if not hasattr(engine, 'timeout'): - #engine.language_support = False + # engine.language_support = False engine.timeout = settings['server']['request_timeout'] if not hasattr(engine, 'shortcut'): - #engine.shortcut = ''' + # engine.shortcut = ''' engine.shortcut = '' # checking required variables @@ -161,7 +161,8 @@ def get_engines_stats(): for engine in scores_per_result: if max_score_per_result: - engine['percentage'] = int(engine['avg'] / max_score_per_result * 100) + engine['percentage'] = int(engine['avg'] + / max_score_per_result * 100) else: engine['percentage'] = 0 diff --git a/searx/query.py b/searx/query.py index 612d46f4b..9f711e982 100644 --- a/searx/query.py +++ b/searx/query.py @@ -31,30 +31,31 @@ class Query(object): def __init__(self, query, blocked_engines): self.query = query self.blocked_engines = [] - + if blocked_engines: self.blocked_engines = blocked_engines - + self.query_parts = [] self.engines = [] self.languages = [] - - # parse query, if tags are set, which change the serch engine or search-language + + # parse query, if tags are set, which + # change the serch engine or search-language def parse_query(self): self.query_parts = [] - + # split query, including whitespaces raw_query_parts = re.split(r'(\s+)', self.query) - + parse_next = True - + for query_part in raw_query_parts: if not parse_next: self.query_parts[-1] += query_part continue - + parse_next = False - + # part does only contain spaces, skip if query_part.isspace()\ or query_part == '': @@ -62,15 +63,17 @@ class Query(object): self.query_parts.append(query_part) continue - # this force a language + # this force a language if query_part[0] == ':': lang = query_part[1:].lower() - # check if any language-code is equal with declared language-codes + # check if any language-code is equal with + # declared language-codes for lc in language_codes: lang_id, lang_name, country = map(str.lower, lc) - # if correct language-code is found, set it as new search-language + # if correct language-code is found + # set it as new search-language if lang == lang_id\ or lang_id.startswith(lang)\ or lang == lang_name\ @@ -89,23 +92,24 @@ class Query(object): parse_next = True self.engines.append({'category': 'none', 'name': engine_shortcuts[prefix]}) - + # check if prefix is equal with engine name elif prefix in engines\ - and not prefix in self.blocked_engines: + and prefix not in self.blocked_engines: parse_next = True self.engines.append({'category': 'none', 'name': prefix}) # check if prefix is equal with categorie name elif prefix in categories: - # using all engines for that search, which are declared under that categorie name + # using all engines for that search, which + # are declared under that categorie name parse_next = True self.engines.extend({'category': prefix, 'name': engine.name} for engine in categories[prefix] - if not engine in self.blocked_engines) - + if engine not in self.blocked_engines) + # append query part to query_part list self.query_parts.append(query_part) @@ -114,14 +118,13 @@ class Query(object): self.query_parts[-1] = search_query else: self.query_parts.append(search_query) - + def getSearchQuery(self): if len(self.query_parts): return self.query_parts[-1] else: return '' - + def getFullQuery(self): # get full querry including whitespaces return string.join(self.query_parts, '') - diff --git a/searx/search.py b/searx/search.py index 064c68844..f051d6df2 100644 --- a/searx/search.py +++ b/searx/search.py @@ -22,7 +22,7 @@ from datetime import datetime from operator import itemgetter from urlparse import urlparse, unquote from searx.engines import ( - categories, engines, engine_shortcuts + categories, engines ) from searx.languages import language_codes from searx.utils import gen_useragent @@ -39,7 +39,13 @@ def default_request_params(): # create a callback wrapper for the search engine results -def make_callback(engine_name, results, suggestions, answers, infoboxes, callback, params): +def make_callback(engine_name, + results, + suggestions, + answers, + infoboxes, + callback, + params): # creating a callback wrapper for the search engine results def process_callback(response, **kwargs): @@ -95,7 +101,7 @@ def make_callback(engine_name, results, suggestions, answers, infoboxes, callbac def content_result_len(content): if isinstance(content, basestring): content = re.sub('[,;:!?\./\\\\ ()-_]', '', content) - return len(content) + return len(content) else: return 0 @@ -126,7 +132,8 @@ def score_results(results): # strip multiple spaces and cariage returns from content if 'content' in res: - res['content'] = re.sub(' +', ' ', res['content'].strip().replace('\n', '')) + res['content'] = re.sub(' +', ' ', + res['content'].strip().replace('\n', '')) # get weight of this engine if possible if hasattr(engines[res['engine']], 'weight'): @@ -139,8 +146,12 @@ def score_results(results): duplicated = False for new_res in results: # remove / from the end of the url if required - p1 = res['parsed_url'].path[:-1] if res['parsed_url'].path.endswith('/') else res['parsed_url'].path # noqa - p2 = new_res['parsed_url'].path[:-1] if new_res['parsed_url'].path.endswith('/') else new_res['parsed_url'].path # noqa + p1 = res['parsed_url'].path[:-1]\ + if res['parsed_url'].path.endswith('/')\ + else res['parsed_url'].path + p2 = new_res['parsed_url'].path[:-1]\ + if new_res['parsed_url'].path.endswith('/')\ + else new_res['parsed_url'].path # check if that result is a duplicate if res['host'] == new_res['host'] and\ @@ -153,7 +164,8 @@ def score_results(results): # merge duplicates together if duplicated: # using content with more text - if content_result_len(res.get('content', '')) > content_result_len(duplicated.get('content', '')): + if content_result_len(res.get('content', '')) >\ + content_result_len(duplicated.get('content', '')): duplicated['content'] = res['content'] # increase result-score @@ -182,17 +194,25 @@ def score_results(results): for i, res in enumerate(results): # FIXME : handle more than one category per engine - category = engines[res['engine']].categories[0] + ':' + '' if 'template' not in res else res['template'] + category = engines[res['engine']].categories[0] + ':' + ''\ + if 'template' not in res\ + else res['template'] - current = None if category not in categoryPositions else categoryPositions[category] + current = None if category not in categoryPositions\ + else categoryPositions[category] - # group with previous results using the same category if the group can accept more result and is not too far from the current position - if current != None and (current['count'] > 0) and (len(gresults) - current['index'] < 20): - # group with the previous results using the same category with this one + # group with previous results using the same category + # if the group can accept more result and is not too far + # from the current position + if current is not None and (current['count'] > 0)\ + and (len(gresults) - current['index'] < 20): + # group with the previous results using + # the same category with this one index = current['index'] gresults.insert(index, res) - # update every index after the current one (including the current one) + # update every index after the current one + # (including the current one) for k in categoryPositions: v = categoryPositions[k]['index'] if v >= index: @@ -206,7 +226,7 @@ def score_results(results): gresults.append(res) # update categoryIndex - categoryPositions[category] = { 'index' : len(gresults), 'count' : 8 } + categoryPositions[category] = {'index': len(gresults), 'count': 8} # return gresults return gresults @@ -215,21 +235,21 @@ def score_results(results): def merge_two_infoboxes(infobox1, infobox2): if 'urls' in infobox2: urls1 = infobox1.get('urls', None) - if urls1 == None: + if urls1 is None: urls1 = [] infobox1.set('urls', urls1) urlSet = set() for url in infobox1.get('urls', []): urlSet.add(url.get('url', None)) - + for url in infobox2.get('urls', []): if url.get('url', None) not in urlSet: urls1.append(url) if 'attributes' in infobox2: attributes1 = infobox1.get('attributes', None) - if attributes1 == None: + if attributes1 is None: attributes1 = [] infobox1.set('attributes', attributes1) @@ -237,14 +257,14 @@ def merge_two_infoboxes(infobox1, infobox2): for attribute in infobox1.get('attributes', []): if attribute.get('label', None) not in attributeSet: attributeSet.add(attribute.get('label', None)) - + for attribute in infobox2.get('attributes', []): attributes1.append(attribute) if 'content' in infobox2: content1 = infobox1.get('content', None) content2 = infobox2.get('content', '') - if content1 != None: + if content1 is not None: if content_result_len(content2) > content_result_len(content1): infobox1['content'] = content2 else: @@ -257,12 +277,12 @@ def merge_infoboxes(infoboxes): for infobox in infoboxes: add_infobox = True infobox_id = infobox.get('id', None) - if infobox_id != None: + if infobox_id is not None: existingIndex = infoboxes_id.get(infobox_id, None) - if existingIndex != None: + if existingIndex is not None: merge_two_infoboxes(results[existingIndex], infobox) - add_infobox=False - + add_infobox = False + if add_infobox: results.append(infobox) infoboxes_id[infobox_id] = len(results)-1 @@ -318,7 +338,8 @@ class Search(object): self.pageno = int(pageno_param) - # parse query, if tags are set, which change the serch engine or search-language + # parse query, if tags are set, which change + # the serch engine or search-language query_obj = Query(self.request_data['q'], self.blocked_engines) query_obj.parse_query() @@ -334,25 +355,29 @@ class Search(object): self.categories = [] - # if engines are calculated from query, set categories by using that informations + # if engines are calculated from query, + # set categories by using that informations if self.engines: self.categories = list(set(engine['category'] for engine in self.engines)) - # otherwise, using defined categories to calculate which engines should be used + # otherwise, using defined categories to + # calculate which engines should be used else: # set used categories for pd_name, pd in self.request_data.items(): if pd_name.startswith('category_'): category = pd_name[9:] # if category is not found in list, skip - if not category in categories: + if category not in categories: continue # add category to list self.categories.append(category) - # if no category is specified for this search, using user-defined default-configuration which (is stored in cookie) + # if no category is specified for this search, + # using user-defined default-configuration which + # (is stored in cookie) if not self.categories: cookie_categories = request.cookies.get('categories', '') cookie_categories = cookie_categories.split(',') @@ -360,16 +385,18 @@ class Search(object): if ccateg in categories: self.categories.append(ccateg) - # if still no category is specified, using general as default-category + # if still no category is specified, using general + # as default-category if not self.categories: self.categories = ['general'] - # using all engines for that search, which are declared under the specific categories + # using all engines for that search, which are + # declared under the specific categories for categ in self.categories: self.engines.extend({'category': categ, 'name': x.name} for x in categories[categ] - if not x.name in self.blocked_engines) + if x.name not in self.blocked_engines) # do search-request def search(self, request): @@ -386,7 +413,7 @@ class Search(object): number_of_searches += 1 # set default useragent - #user_agent = request.headers.get('User-Agent', '') + # user_agent = request.headers.get('User-Agent', '') user_agent = gen_useragent() # start search-reqest for all selected engines @@ -400,7 +427,8 @@ class Search(object): if self.pageno > 1 and not engine.paging: continue - # if search-language is set and engine does not provide language-support, skip + # if search-language is set and engine does not + # provide language-support, skip if self.lang != 'all' and not engine.language_support: continue @@ -412,7 +440,8 @@ class Search(object): request_params['pageno'] = self.pageno request_params['language'] = self.lang - # update request parameters dependent on search-engine (contained in engines folder) + # update request parameters dependent on + # search-engine (contained in engines folder) request_params = engine.request(self.query.encode('utf-8'), request_params) @@ -431,7 +460,8 @@ class Search(object): request_params ) - # create dictionary which contain all informations about the request + # create dictionary which contain all + # informations about the request request_args = dict( headers=request_params['headers'], hooks=dict(response=callback), diff --git a/searx/utils.py b/searx/utils.py index 28e42b272..7764291fc 100644 --- a/searx/utils.py +++ b/searx/utils.py @@ -1,4 +1,4 @@ -#import htmlentitydefs +# import htmlentitydefs from codecs import getincrementalencoder from HTMLParser import HTMLParser from random import choice @@ -22,7 +22,8 @@ def gen_useragent(): def searx_useragent(): return 'searx' - + + def highlight_content(content, query): if not content: @@ -67,8 +68,8 @@ class HTMLTextExtractor(HTMLParser): self.result.append(unichr(codepoint)) def handle_entityref(self, name): - #codepoint = htmlentitydefs.name2codepoint[name] - #self.result.append(unichr(codepoint)) + # codepoint = htmlentitydefs.name2codepoint[name] + # self.result.append(unichr(codepoint)) self.result.append(name) def get_text(self): diff --git a/searx/webapp.py b/searx/webapp.py index 830cf440a..0555d6ca9 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -71,7 +71,7 @@ app.secret_key = settings['server']['secret_key'] babel = Babel(app) -#TODO configurable via settings.yml +# TODO configurable via settings.yml favicons = ['wikipedia', 'youtube', 'vimeo', 'soundcloud', 'twitter', 'stackoverflow', 'github'] @@ -146,14 +146,14 @@ def render(template_name, override_theme=None, **kwargs): nonblocked_categories = set(chain.from_iterable(nonblocked_categories)) - if not 'categories' in kwargs: + if 'categories' not in kwargs: kwargs['categories'] = ['general'] kwargs['categories'].extend(x for x in sorted(categories.keys()) if x != 'general' and x in nonblocked_categories) - if not 'selected_categories' in kwargs: + if 'selected_categories' not in kwargs: kwargs['selected_categories'] = [] for arg in request.args: if arg.startswith('category_'): @@ -168,7 +168,7 @@ def render(template_name, override_theme=None, **kwargs): if not kwargs['selected_categories']: kwargs['selected_categories'] = ['general'] - if not 'autocomplete' in kwargs: + if 'autocomplete' not in kwargs: kwargs['autocomplete'] = autocomplete kwargs['method'] = request.cookies.get('method', 'POST') @@ -202,14 +202,15 @@ def index(): 'index.html', ) - search.results, search.suggestions, search.answers, search.infoboxes = search.search(request) + search.results, search.suggestions,\ + search.answers, search.infoboxes = search.search(request) for result in search.results: if not search.paging and engines[result['engine']].paging: search.paging = True - # check if HTTPS rewrite is required + # check if HTTPS rewrite is required if settings['server']['https_rewrite']\ and result['parsed_url'].scheme == 'http': @@ -236,7 +237,7 @@ def index(): try: # TODO, precompile rule p = re.compile(rule[0]) - + # rewrite url if possible new_result_url = p.sub(rule[1], result['url']) except: @@ -250,17 +251,21 @@ def index(): continue # get domainname from result - # TODO, does only work correct with TLD's like asdf.com, not for asdf.com.de + # TODO, does only work correct with TLD's like + # asdf.com, not for asdf.com.de # TODO, using publicsuffix instead of this rewrite rule - old_result_domainname = '.'.join(result['parsed_url'].hostname.split('.')[-2:]) - new_result_domainname = '.'.join(new_parsed_url.hostname.split('.')[-2:]) + old_result_domainname = '.'.join( + result['parsed_url'].hostname.split('.')[-2:]) + new_result_domainname = '.'.join( + new_parsed_url.hostname.split('.')[-2:]) - # check if rewritten hostname is the same, to protect against wrong or malicious rewrite rules + # check if rewritten hostname is the same, + # to protect against wrong or malicious rewrite rules if old_result_domainname == new_result_domainname: # set new url result['url'] = new_result_url - # target has matched, do not search over the other rules + # target has matched, do not search over the other rules break if search.request_data.get('format', 'html') == 'html': @@ -429,7 +434,7 @@ def preferences(): for pd_name, pd in request.form.items(): if pd_name.startswith('category_'): category = pd_name[9:] - if not category in categories: + if category not in categories: continue selected_categories.append(category) elif pd_name == 'locale' and pd in settings['locales']: From 7be97597038078dc749b60ae8770af7abe1b8261 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Sun, 19 Oct 2014 21:30:56 +0200 Subject: [PATCH 20/22] [enh][fix] https rewrite rules added to setup.py --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7048fa22b..0053ca8b8 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ long_description = read('README.rst') setup( name='searx', - version="0.3.1", + version="0.4.0", description="A privacy-respecting, hackable metasearch engine", long_description=long_description, classifiers=[ @@ -70,6 +70,7 @@ setup( 'translations/*/*/*', 'templates/*/*.xml', 'templates/*/*.html', + 'https_rules/*.xml', 'templates/*/result_templates/*.html', ], }, From 6ecf03c736bf4846d5fab08649177eb55e2e1ce0 Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Sun, 19 Oct 2014 21:39:30 +0200 Subject: [PATCH 21/22] print error if https rewrite directory is not found, #116 --- searx/https_rewrite.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/searx/https_rewrite.py b/searx/https_rewrite.py index b2731ae28..9faf3599d 100644 --- a/searx/https_rewrite.py +++ b/searx/https_rewrite.py @@ -18,7 +18,7 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >. import re from lxml import etree from os import listdir -from os.path import isfile, join +from os.path import isfile, isdir, join # https://gitweb.torproject.org/\ @@ -120,9 +120,10 @@ def load_single_https_ruleset(filepath): # load all https rewrite rules def load_https_rules(rules_path): - # add / to path if not set yet - if rules_path[-1:] != '/': - rules_path += '/' + # check if directory exists + if not isdir(rules_path): + print("[E] directory not found: '" + rules_path + "'") + return # search all xml files which are stored in the https rule directory xml_files = [join(rules_path, f) From 79f1676e318d36704687966fd124b7f29ddc21fa Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Tue, 21 Oct 2014 15:44:40 +0200 Subject: [PATCH 22/22] [doc] @kernc added to authors list --- AUTHORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index 311c97781..906a0bfd6 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -26,3 +26,4 @@ generally made searx better: - dp - Martin Zimmermann - @courgette +- @kernc