Procházet zdrojové kódy

Merge pull request #820 from dalf/config_api

[mod] /config API : add more fields for each engine
Adam Tauber před 8 roky
rodič
revize
94327d67fc
1 změnil soubory, kde provedl 10 přidání a 1 odebrání
  1. 10
    1
      searx/webapp.py

+ 10
- 1
searx/webapp.py Zobrazit soubor

@@ -752,7 +752,16 @@ def config():
752 752
                     'engines': [{'name': engine_name,
753 753
                                  'categories': engine.categories,
754 754
                                  'shortcut': engine.shortcut,
755
-                                 'enabled': not engine.disabled}
755
+                                 'enabled': not engine.disabled,
756
+                                 'paging': engine.paging,
757
+                                 'language_support': engine.language_support,
758
+                                 'supported_languages':
759
+                                 engine.supported_languages.keys()
760
+                                 if isinstance(engine.supported_languages, dict)
761
+                                 else engine.supported_languages,
762
+                                 'safesearch': engine.safesearch,
763
+                                 'time_range_support': engine.time_range_support,
764
+                                 'timeout': engine.timeout}
756 765
                                 for engine_name, engine in engines.items()],
757 766
                     'plugins': [{'name': plugin.name,
758 767
                                  'enabled': plugin.default_on}