mirror of
https://github.com/searxng/searxng.git
synced 2025-08-03 02:22:22 +02:00
parent
92c68fe636
commit
f83b64270c
5 changed files with 164 additions and 130 deletions
|
@ -70,6 +70,8 @@ class PluginStore():
|
|||
if not hasattr(plugin, plugin_attr) or not isinstance(getattr(plugin, plugin_attr), plugin_attr_type):
|
||||
setattr(plugin, plugin_attr, plugin_attr_type())
|
||||
plugin.id = plugin.name.replace(' ', '_')
|
||||
if not hasattr(plugin, 'preference_section'):
|
||||
plugin.preference_section = 'general'
|
||||
self.plugins.append(plugin)
|
||||
|
||||
def call(self, ordered_plugin_list, plugin_type, request, *args, **kwargs):
|
||||
|
|
|
@ -23,6 +23,9 @@ import re
|
|||
name = "Hash plugin"
|
||||
description = gettext("Converts strings to different hash digests.")
|
||||
default_on = True
|
||||
preference_section = 'query'
|
||||
query_keywords = ['md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512']
|
||||
query_examples = 'sha512 The quick brown fox jumps over the lazy dog'
|
||||
|
||||
parser_re = re.compile('(md5|sha1|sha224|sha256|sha384|sha512) (.*)', re.I)
|
||||
|
||||
|
|
|
@ -19,7 +19,9 @@ import re
|
|||
name = gettext('Self Informations')
|
||||
description = gettext('Displays your IP if the query is "ip" and your user agent if the query contains "user agent".')
|
||||
default_on = True
|
||||
|
||||
preference_section = 'query'
|
||||
query_keywords = ['user-agent']
|
||||
query_examples = ''
|
||||
|
||||
# Self User Agent regex
|
||||
p = re.compile('.*user[ -]agent.*', re.IGNORECASE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue