本文整理汇总了Python中searx.logger.getChild函数的典型用法代码示例。如果您正苦于以下问题:Python getChild函数的具体用法?Python getChild怎么用?Python getChild使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getChild函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: dirname
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, <[email protected]>
'''
from os.path import realpath, dirname, splitext, join
import sys
from imp import load_source
from flask.ext.babel import gettext
from operator import itemgetter
from searx import settings
from searx import logger
logger = logger.getChild('engines')
engine_dir = dirname(realpath(__file__))
engines = {}
categories = {'general': []}
engine_shortcuts = {}
engine_default_args = {'paging': False,
'categories': ['general'],
'language_support': True,
'safesearch': False,
'timeout': settings['outgoing']['request_timeout'],
'shortcut': '-',
'disabled': False,
开发者ID:3615pipou,项目名称:searx,代码行数:31,代码来源:__init__.py
示例2: import
(C) 2013- by Adam Tauber, <[email protected]>
'''
if __name__ == '__main__':
from sys import path
from os.path import realpath, dirname
path.append(realpath(dirname(realpath(__file__)) + '/../'))
import json
import cStringIO
import os
import hashlib
import requests
from searx import logger
logger = logger.getChild('webapp')
try:
from pygments import highlight
from pygments.lexers import get_lexer_by_name
from pygments.formatters import HtmlFormatter
except:
logger.critical("cannot import dependency: pygments")
from sys import exit
exit(1)
from datetime import datetime, timedelta
from urllib import urlencode
from urlparse import urlparse, urljoin
from werkzeug.contrib.fixers import ProxyFix
from flask import (
开发者ID:GreenLunar,项目名称:searx,代码行数:31,代码来源:webapp.py
示例3: import
import re
import searx.poolrequests as requests_lib
from itertools import izip_longest, chain
from operator import itemgetter
from Queue import Queue
from time import time
from urlparse import urlparse, unquote
from searx.engines import (
categories, engines
)
from searx.languages import language_codes
from searx.utils import gen_useragent, get_blocked_engines
from searx.query import Query
from searx import logger
logger = logger.getChild('search')
number_of_searches = 0
def search_request_wrapper(fn, url, engine_name, **kwargs):
try:
return fn(url, **kwargs)
except:
# increase errors stats
engines[engine_name].stats['errors'] += 1
# print engine name and specific error message
logger.exception('engine crash: {0}'.format(engine_name))
return
开发者ID:erdoukki,项目名称:searx,代码行数:30,代码来源:search.py
示例4: no
@results JSON, HTML
@stable no (html can change)
@parse url, infobox
"""
from searx import logger
from searx.poolrequests import get
from searx.engines.xpath import extract_text
from searx.engines.wikipedia import _fetch_supported_languages, supported_languages_url
from searx.url_utils import urlencode
from searx.utils import match_language
from json import loads
from lxml.html import fromstring
logger = logger.getChild('wikidata')
result_count = 1
# urls
wikidata_host = 'https://www.wikidata.org'
url_search = wikidata_host \
+ '/w/index.php?{query}'
wikidata_api = wikidata_host + '/w/api.php'
url_detail = wikidata_api\
+ '?action=parse&format=json&{query}'\
+ '&redirects=1&prop=text%7Cdisplaytitle%7Clanglinks%7Crevid'\
+ '&disableeditsection=1&disabletidy=1&preview=1§ionpreview=1&disabletoc=1&utf8=1&formatversion=2'
url_map = 'https://www.openstreetmap.org/'\
+ '?lat={latitude}&lon={longitude}&zoom={zoom}&layers=M'
开发者ID:asciimoo,项目名称:searx,代码行数:31,代码来源:wikidata.py
示例5: yes
# @provide-api yes (https://developers.google.com/custom-search/)
#
# @using-api no
# @results HTML
# @stable no (HTML can change)
# @parse url, title, content, suggestion
import re
from flask_babel import gettext
from lxml import html, etree
from searx.engines.xpath import extract_text, extract_url
from searx import logger
from searx.url_utils import urlencode, urlparse, parse_qsl
from searx.utils import match_language
logger = logger.getChild('google engine')
# engine dependent config
categories = ['general']
paging = True
language_support = True
use_locale_domain = True
time_range_support = True
# based on https://en.wikipedia.org/wiki/List_of_Google_domains and tests
default_hostname = 'www.google.com'
country_to_hostname = {
'BG': 'www.google.bg', # Bulgaria
'CZ': 'www.google.cz', # Czech Republic
开发者ID:asciimoo,项目名称:searx,代码行数:31,代码来源:google.py
示例6:
from babel.dates import format_date
from codecs import getincrementalencoder
from HTMLParser import HTMLParser
from imp import load_source
from os.path import splitext, join
from random import choice
import sys
from searx.version import VERSION_STRING
from searx.languages import language_codes
from searx import settings
from searx import logger
logger = logger.getChild('utils')
ua_versions = ('40.0',
'41.0',
'42.0',
'43.0',
'44.0',
'45.0',
'46.0',
'47.0')
ua_os = ('Windows NT 6.3; WOW64',
'X11; Linux x86_64',
'X11; Linux x86')
ua = "Mozilla/5.0 ({os}; rv:{version}) Gecko/20100101 Firefox/{version}"
开发者ID:mmuman,项目名称:searx,代码行数:30,代码来源:utils.py
示例7: gen_useragent
import csv
import os
import re
from babel.dates import format_date
from codecs import getincrementalencoder
from HTMLParser import HTMLParser
from random import choice
from searx.version import VERSION_STRING
from searx.languages import language_codes
from searx import settings
from searx import logger
logger = logger.getChild("utils")
ua_versions = ("40.0", "41.0", "42.0", "43.0", "44.0", "45.0", "46.0", "47.0")
ua_os = ("Windows NT 6.3; WOW64", "X11; Linux x86_64", "X11; Linux x86")
ua = "Mozilla/5.0 ({os}; rv:{version}) Gecko/20100101 Firefox/{version}"
blocked_tags = ("script", "style")
def gen_useragent():
# TODO
return ua.format(os=choice(ua_os), version=choice(ua_versions))
开发者ID:cyrilix,项目名称:searx,代码行数:29,代码来源:utils.py
示例8: import
(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) 2015 by Adam Tauber, <[email protected]>
'''
from sys import exit
from searx import logger
logger = logger.getChild('plugins')
from searx.plugins import (https_rewrite,
open_results_on_new_tab,
self_info,
search_on_category_select,
tracker_url_remover,
vim_hotkeys)
required_attrs = (('name', (str, unicode)),
('description', (str, unicode)),
('default_on', bool))
optional_attrs = (('js_dependencies', tuple),
('css_dependencies', tuple))
开发者ID:JASON0916,项目名称:searx,代码行数:30,代码来源:__init__.py
示例9: exit
if __name__ == "__main__":
from sys import path
from os.path import realpath, dirname
path.append(realpath(dirname(realpath(__file__)) + "/../"))
import json
import cStringIO
import os
import hashlib
import requests
from searx import logger
logger = logger.getChild("webapp")
try:
from pygments import highlight
from pygments.lexers import get_lexer_by_name
from pygments.formatters import HtmlFormatter
except:
logger.critical("cannot import dependency: pygments")
from sys import exit
exit(1)
from datetime import datetime, timedelta
from urllib import urlencode
from urlparse import urlparse, urljoin
from werkzeug.contrib.fixers import ProxyFix
开发者ID:jibe-b,项目名称:searx,代码行数:30,代码来源:webapp.py
示例10: dirname
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, <[email protected]>
"""
from os.path import realpath, dirname, splitext, join
import sys
from imp import load_source
from flask_babel import gettext
from operator import itemgetter
from searx import settings
from searx import logger
logger = logger.getChild("engines")
engine_dir = dirname(realpath(__file__))
engines = {}
categories = {"general": []}
engine_shortcuts = {}
engine_default_args = {
"paging": False,
"categories": ["general"],
"language_support": True,
"safesearch": False,
"timeout": settings["outgoing"]["request_timeout"],
"shortcut": "-",
开发者ID:NotoriousDev,项目名称:searx,代码行数:31,代码来源:__init__.py
示例11: Yahoo
"""
Yahoo (Web)
@website https://yandex.ru/
@provide-api ?
@using-api no
@results HTML (using search portal)
@stable no (HTML can change)
@parse url, title, content
"""
from lxml import html
from searx import logger
from searx.url_utils import urlencode
logger = logger.getChild('yandex engine')
# engine dependent config
categories = ['general']
paging = True
language_support = True # TODO
default_tld = 'com'
language_map = {'ru': 'ru',
'ua': 'ua',
'be': 'by',
'kk': 'kz',
'tr': 'com.tr'}
# search-url
base_url = 'https://yandex.{tld}/'
开发者ID:MrLpk,项目名称:searx,代码行数:31,代码来源:yandex.py
注:本文中的searx.logger.getChild函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论