forked from zaclys/searxng
		
	[theme] peel out oscar from SearXNG development
This is the first step of removing oscar theme Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
		
							parent
							
								
									7ad0348878
								
							
						
					
					
						commit
						e8541b6006
					
				
					 17 changed files with 54 additions and 162 deletions
				
			
		
							
								
								
									
										7
									
								
								.github/dependabot.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								.github/dependabot.yml
									
										
									
									
										vendored
									
									
								
							|  | @ -8,13 +8,6 @@ updates: | ||||||
|       day: "friday" |       day: "friday" | ||||||
|     open-pull-requests-limit: 5 |     open-pull-requests-limit: 5 | ||||||
|     target-branch: "master" |     target-branch: "master" | ||||||
|   - package-ecosystem: "npm" |  | ||||||
|     directory: "/searx/static/themes/oscar" |  | ||||||
|     schedule: |  | ||||||
|       interval: "weekly" |  | ||||||
|       day: "friday" |  | ||||||
|     open-pull-requests-limit: 5 |  | ||||||
|     target-branch: "master" |  | ||||||
|   - package-ecosystem: "npm" |   - package-ecosystem: "npm" | ||||||
|     directory: "/searx/static/themes/simple" |     directory: "/searx/static/themes/simple" | ||||||
|     schedule: |     schedule: | ||||||
|  |  | ||||||
							
								
								
									
										2
									
								
								Makefile
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								Makefile
									
										
									
									
									
								
							|  | @ -87,7 +87,7 @@ MANAGE += pyenv pyenv.install pyenv.uninstall | ||||||
| MANAGE += pypi.upload pypi.upload.test | MANAGE += pypi.upload pypi.upload.test | ||||||
| MANAGE += format.python | MANAGE += format.python | ||||||
| MANAGE += test.yamllint test.pylint test.pyright test.black test.pybabel test.unit test.coverage test.robot test.rst test.clean | MANAGE += test.yamllint test.pylint test.pyright test.black test.pybabel test.unit test.coverage test.robot test.rst test.clean | ||||||
| MANAGE += themes.all themes.oscar themes.simple themes.simple.test pygments.less | MANAGE += themes.all themes.simple themes.simple.test pygments.less | ||||||
| MANAGE += static.build.commit static.build.drop static.build.restore | MANAGE += static.build.commit static.build.drop static.build.restore | ||||||
| MANAGE += nvm.install nvm.clean nvm.status nvm.nodejs | MANAGE += nvm.install nvm.clean nvm.status nvm.nodejs | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -24,7 +24,7 @@ Sample response | ||||||
|        "images", |        "images", | ||||||
|      ], |      ], | ||||||
|      "default_locale": "", |      "default_locale": "", | ||||||
|      "default_theme": "oscar", |      "default_theme": "simple", | ||||||
|      "engines": [ |      "engines": [ | ||||||
|        { |        { | ||||||
|          "categories": [ |          "categories": [ | ||||||
|  |  | ||||||
|  | @ -18,9 +18,8 @@ All of the engines above are just commented out in the :origin:`settings.yml | ||||||
| dependencies before using them. | dependencies before using them. | ||||||
| 
 | 
 | ||||||
| By default, the engines use the ``key-value`` template for displaying results / | By default, the engines use the ``key-value`` template for displaying results / | ||||||
| see :origin:`oscar <searx/templates/oscar/result_templates/key-value.html>` & | see :origin:`simple <searx/templates/simple/result_templates/key-value.html>` | ||||||
| :origin:`simple <searx/templates/simple/result_templates/key-value.html>` | theme.  If you are not satisfied with the original result layout, you can use | ||||||
| themes.  If you are not satisfied with the original result layout, you can use |  | ||||||
| your own template, set ``result_template`` attribute to ``{template_name}`` and | your own template, set ``result_template`` attribute to ``{template_name}`` and | ||||||
| place the templates at:: | place the templates at:: | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -30,9 +30,8 @@ engines, e.g. ``database:`` ... | ||||||
|      query_str: ... |      query_str: ... | ||||||
| 
 | 
 | ||||||
| By default, the engines use the ``key-value`` template for displaying results / | By default, the engines use the ``key-value`` template for displaying results / | ||||||
| see :origin:`oscar <searx/templates/oscar/result_templates/key-value.html>` & | see :origin:`simple <searx/templates/simple/result_templates/key-value.html>` | ||||||
| :origin:`simple <searx/templates/simple/result_templates/key-value.html>` | theme.  If you are not satisfied with the original result layout, you can use | ||||||
| themes.  If you are not satisfied with the original result layout, you can use |  | ||||||
| your own template, set ``result_template`` attribute to ``{template_name}`` and | your own template, set ``result_template`` attribute to ``{template_name}`` and | ||||||
| place the templates at:: | place the templates at:: | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -75,8 +75,8 @@ Parameters | ||||||
|   Filter search results of engines which support safe search.  See if an engine |   Filter search results of engines which support safe search.  See if an engine | ||||||
|   supports safe search in the preferences page of an instance. |   supports safe search in the preferences page of an instance. | ||||||
| 
 | 
 | ||||||
| ``theme`` : default ``oscar`` | ``theme`` : default ``simple`` | ||||||
|   [ ``oscar``, ``simple`` ] |   [ ``simple`` ] | ||||||
| 
 | 
 | ||||||
|   Theme of instance. |   Theme of instance. | ||||||
| 
 | 
 | ||||||
|  | @ -84,16 +84,6 @@ Parameters | ||||||
|   instance administrator deleted, created or renamed themes on their instance. |   instance administrator deleted, created or renamed themes on their instance. | ||||||
|   See the available options in the preferences page of the instance. |   See the available options in the preferences page of the instance. | ||||||
| 
 | 
 | ||||||
| ``oscar-style`` : default ``logicodev`` |  | ||||||
|   [ ``pointhi``, ``logicodev`` ] |  | ||||||
| 
 |  | ||||||
|   Style of Oscar theme.  It is only parsed if the theme of an instance is |  | ||||||
|   ``oscar``. |  | ||||||
| 
 |  | ||||||
|   Please note, available styles depend on an instance.  It is possible that an |  | ||||||
|   instance administrator deleted, created or renamed styles on their |  | ||||||
|   instance. See the available options in the preferences page of the instance. |  | ||||||
| 
 |  | ||||||
| ``enabled_plugins`` : optional | ``enabled_plugins`` : optional | ||||||
|   List of enabled plugins. |   List of enabled plugins. | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
							
								
								
									
										16
									
								
								manage
									
										
									
									
									
								
							
							
						
						
									
										16
									
								
								manage
									
										
									
									
									
								
							|  | @ -115,7 +115,6 @@ test.: | ||||||
|   clean     : clean intermediate test stuff |   clean     : clean intermediate test stuff | ||||||
| themes.: | themes.: | ||||||
|   all       : build all themes |   all       : build all themes | ||||||
|   oscar     : build oscar theme |  | ||||||
|   simple    : build simple theme |   simple    : build simple theme | ||||||
| pygments.: | pygments.: | ||||||
|   less      : build LESS files for pygments |   less      : build LESS files for pygments | ||||||
|  | @ -554,9 +553,6 @@ node.env() { | ||||||
|     nodejs.ensure |     nodejs.ensure | ||||||
|     (   set -e |     (   set -e | ||||||
| 
 | 
 | ||||||
|         build_msg INSTALL "searx/static/themes/oscar/package.json" |  | ||||||
|         npm --prefix searx/static/themes/oscar install |  | ||||||
| 
 |  | ||||||
|         build_msg INSTALL "searx/static/themes/simple/package.json" |         build_msg INSTALL "searx/static/themes/simple/package.json" | ||||||
|         npm --prefix searx/static/themes/simple install |         npm --prefix searx/static/themes/simple install | ||||||
|     ) |     ) | ||||||
|  | @ -576,7 +572,6 @@ node.clean() { | ||||||
|     fi |     fi | ||||||
|     build_msg CLEAN "themes -- locally installed npm dependencies" |     build_msg CLEAN "themes -- locally installed npm dependencies" | ||||||
|     (   set -e |     (   set -e | ||||||
|         npm --prefix searx/static/themes/oscar run clean |  | ||||||
|         npm --prefix searx/static/themes/simple run clean |         npm --prefix searx/static/themes/simple run clean | ||||||
|     ) |     ) | ||||||
|     dump_return $? |     dump_return $? | ||||||
|  | @ -762,7 +757,6 @@ themes.all() { | ||||||
|     (   set -e |     (   set -e | ||||||
|         pygments.less |         pygments.less | ||||||
|         node.env |         node.env | ||||||
|         themes.oscar |  | ||||||
|         themes.simple |         themes.simple | ||||||
|     ) |     ) | ||||||
|     dump_return $? |     dump_return $? | ||||||
|  | @ -771,14 +765,14 @@ themes.all() { | ||||||
| themes.live() { | themes.live() { | ||||||
|     local LIVE_THEME="${LIVE_THEME:-${1}}" |     local LIVE_THEME="${LIVE_THEME:-${1}}" | ||||||
|     case "${LIVE_THEME}" in |     case "${LIVE_THEME}" in | ||||||
|         simple|oscar) |         simple) | ||||||
|             theme="searx/static/themes/${LIVE_THEME}" |             theme="searx/static/themes/${LIVE_THEME}" | ||||||
|             ;; |             ;; | ||||||
|         '') |         '') | ||||||
|             die_caller 42 "missing theme argument" |             die_caller 42 "missing theme argument" | ||||||
|             ;; |             ;; | ||||||
|         *) |         *) | ||||||
|             die_caller 42 "unknown theme '${LIVE_THEME}' // [simple|oscar]'" |             die_caller 42 "unknown theme '${LIVE_THEME}' // [simple]'" | ||||||
|             ;; |             ;; | ||||||
|     esac |     esac | ||||||
|     build_msg GRUNT "theme: $1 (live build)" |     build_msg GRUNT "theme: $1 (live build)" | ||||||
|  | @ -792,12 +786,6 @@ themes.live() { | ||||||
|         | grep -E --ignore-case --color 'error[s]?[:]? |warning[s]?[:]? |' |         | grep -E --ignore-case --color 'error[s]?[:]? |warning[s]?[:]? |' | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| themes.oscar() { |  | ||||||
|     build_msg GRUNT "theme: oscar" |  | ||||||
|     npm --prefix searx/static/themes/oscar run build |  | ||||||
|     dump_return $? |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| themes.simple() { | themes.simple() { | ||||||
|     (   set -e |     (   set -e | ||||||
|         build_msg GRUNT "theme: simple" |         build_msg GRUNT "theme: simple" | ||||||
|  |  | ||||||
|  | @ -362,11 +362,6 @@ class Preferences: | ||||||
|                 locked=is_locked('doi_resolver'), |                 locked=is_locked('doi_resolver'), | ||||||
|                 choices=DOI_RESOLVERS |                 choices=DOI_RESOLVERS | ||||||
|             ), |             ), | ||||||
|             'oscar-style': EnumStringSetting( |  | ||||||
|                 settings['ui']['theme_args']['oscar_style'], |  | ||||||
|                 locked=is_locked('oscar-style'), |  | ||||||
|                 choices=['', 'logicodev', 'logicodev-dark', 'pointhi'] |  | ||||||
|             ), |  | ||||||
|             'simple_style': EnumStringSetting( |             'simple_style': EnumStringSetting( | ||||||
|                 settings['ui']['theme_args']['simple_style'], |                 settings['ui']['theme_args']['simple_style'], | ||||||
|                 locked=is_locked('simple_style'), |                 locked=is_locked('simple_style'), | ||||||
|  |  | ||||||
|  | @ -86,8 +86,6 @@ ui: | ||||||
|   # Open result links in a new tab by default |   # Open result links in a new tab by default | ||||||
|   # results_on_new_tab: false |   # results_on_new_tab: false | ||||||
|   theme_args: |   theme_args: | ||||||
|     # default style of oscar |  | ||||||
|     oscar_style: logicodev |  | ||||||
|     # style of simple theme: auto, light, dark |     # style of simple theme: auto, light, dark | ||||||
|     simple_style: auto |     simple_style: auto | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -18,7 +18,6 @@ searx_dir = abspath(dirname(__file__)) | ||||||
| logger = logging.getLogger('searx') | logger = logging.getLogger('searx') | ||||||
| OUTPUT_FORMATS = ['html', 'csv', 'json', 'rss'] | OUTPUT_FORMATS = ['html', 'csv', 'json', 'rss'] | ||||||
| LANGUAGE_CODES = ['all'] + list(l[0] for l in languages) | LANGUAGE_CODES = ['all'] + list(l[0] for l in languages) | ||||||
| OSCAR_STYLE = ('logicodev', 'logicodev-dark', 'pointhi') |  | ||||||
| SIMPLE_STYLE = ('auto', 'light', 'dark') | SIMPLE_STYLE = ('auto', 'light', 'dark') | ||||||
| CATEGORIES_AS_TABS = { | CATEGORIES_AS_TABS = { | ||||||
|     'general': {}, |     'general': {}, | ||||||
|  | @ -181,7 +180,6 @@ SCHEMA = { | ||||||
|         'default_theme': SettingsValue(str, 'simple'), |         'default_theme': SettingsValue(str, 'simple'), | ||||||
|         'default_locale': SettingsValue(str, ''), |         'default_locale': SettingsValue(str, ''), | ||||||
|         'theme_args': { |         'theme_args': { | ||||||
|             'oscar_style': SettingsValue(OSCAR_STYLE, 'logicodev'), |  | ||||||
|             'simple_style': SettingsValue(SIMPLE_STYLE, 'auto'), |             'simple_style': SettingsValue(SIMPLE_STYLE, 'auto'), | ||||||
|         }, |         }, | ||||||
|         'results_on_new_tab': SettingsValue(bool, False), |         'results_on_new_tab': SettingsValue(bool, False), | ||||||
|  |  | ||||||
|  | @ -1,4 +1,4 @@ | ||||||
| {% from 'oscar/macros.html' import icon %} | {% from 'simple/icons.html' import icon %} | ||||||
| <div class="alert alert-info fade in" role="alert"> | <div class="alert alert-info fade in" role="alert"> | ||||||
|     <strong class="lead">{{ icon('info-sign') }} {{ _('Information!') }}</strong> |     <strong class="lead">{{ icon('info-sign') }} {{ _('Information!') }}</strong> | ||||||
|     {{ _('currently, there are no cookies defined.') }} |     {{ _('currently, there are no cookies defined.') }} | ||||||
|  | @ -399,7 +399,7 @@ | ||||||
|        {% endfor %} |        {% endfor %} | ||||||
|      </table> |      </table> | ||||||
|      {% else %} |      {% else %} | ||||||
|         {% include 'oscar/messages/no_cookies.html' %} |         {% include 'simple/messages/no_cookies.html' %} | ||||||
|      {% endif %} |      {% endif %} | ||||||
|      <h4>{{ _('Search URL of the currently saved preferences') }} :</h4> |      <h4>{{ _('Search URL of the currently saved preferences') }} :</h4> | ||||||
|      <div class="selectable_url"> |      <div class="selectable_url"> | ||||||
|  |  | ||||||
|  | @ -17,75 +17,6 @@ from pygments.token import Comment, Error, Generic, Keyword, Literal, Name, Oper | ||||||
| 
 | 
 | ||||||
| from searx import searx_dir | from searx import searx_dir | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| class LogicodevStyle(Style):  # pylint: disable=R0903 |  | ||||||
|     """Logicodev style |  | ||||||
|     based on https://github.com/searx/searx/blob/2a5c39e33c3306ca17e09211fbf5a0f785cb10c8/searx/static/themes/oscar/less/logicodev/code.less |  | ||||||
|     """  # pylint: disable=C0301 |  | ||||||
| 
 |  | ||||||
|     background_color = '#282C34' |  | ||||||
| 
 |  | ||||||
|     styles = { |  | ||||||
|         # fmt: off |  | ||||||
|         Comment:                        "#556366 italic", |  | ||||||
|         Comment.Multiline:              "#556366 italic", |  | ||||||
|         Comment.Preproc:                "#BC7A00", |  | ||||||
|         Comment.Single:                 "#556366 italic", |  | ||||||
|         Comment.Special:                "#556366 italic", |  | ||||||
|         Error:                          "border:#ff0000", |  | ||||||
|         Generic.Deleted:                "#A00000", |  | ||||||
|         Generic.Emph:                   "italic", |  | ||||||
|         Generic.Error:                  "#FF0000", |  | ||||||
|         Generic.Heading:                "#000080 bold", |  | ||||||
|         Generic.Inserted:               "#00A000", |  | ||||||
|         Generic.Output:                 "#888888", |  | ||||||
|         Generic.Prompt:                 "#000080 bold", |  | ||||||
|         Generic.Strong:                 "bold", |  | ||||||
|         Generic.Subheading:             "#800080 bold", |  | ||||||
|         Generic.Traceback:              "#0044DD", |  | ||||||
|         Keyword:                        "#BE74D5 bold", |  | ||||||
|         Keyword.Constant:               "#BE74D5 bold", |  | ||||||
|         Keyword.Declaration:            "#BE74D5 bold", |  | ||||||
|         Keyword.Namespace:              "#BE74D5 bold", |  | ||||||
|         Keyword.Pseudo:                 "#BE74D5", |  | ||||||
|         Keyword.Reserved:               "#BE74D5 bold", |  | ||||||
|         Keyword.Type:                   "#D46C72", |  | ||||||
|         Literal.Number:                 "#D19A66", |  | ||||||
|         Literal.String:                 "#86C372", |  | ||||||
|         Literal.String.Backtick:        "#86C372", |  | ||||||
|         Literal.String.Char:            "#86C372", |  | ||||||
|         Literal.String.Doc:             "#86C372 italic", |  | ||||||
|         Literal.String.Double:          "#86C372", |  | ||||||
|         Literal.String.Escape:          "#BB6622 bold", |  | ||||||
|         Literal.String.Heredoc:         "#86C372", |  | ||||||
|         Literal.String.Interpol:        "#BB6688 bold", |  | ||||||
|         Literal.String.Other:           "#BE74D5", |  | ||||||
|         Literal.String.Regex:           "#BB6688", |  | ||||||
|         Literal.String.Single:          "#86C372", |  | ||||||
|         Literal.String.Symbol:          "#DFC06F", |  | ||||||
|         Name.Attribute:                 "#7D9029", |  | ||||||
|         Name.Builtin:                   "#BE74D5", |  | ||||||
|         Name.Builtin.Pseudo:            "#BE74D5", |  | ||||||
|         Name.Class:                     "#61AFEF bold", |  | ||||||
|         Name.Constant:                  "#D19A66", |  | ||||||
|         Name.Decorator:                 "#AA22FF", |  | ||||||
|         Name.Entity:                    "#999999 bold", |  | ||||||
|         Name.Exception:                 "#D2413A bold", |  | ||||||
|         Name.Function:                  "#61AFEF", |  | ||||||
|         Name.Label:                     "#A0A000", |  | ||||||
|         Name.Namespace:                 "#61AFEF bold", |  | ||||||
|         Name.Tag:                       "#BE74D5 bold", |  | ||||||
|         Name.Variable:                  "#DFC06F", |  | ||||||
|         Name.Variable.Class:            "#DFC06F", |  | ||||||
|         Name.Variable.Global:           "#DFC06F", |  | ||||||
|         Name.Variable.Instance:         "#DFC06F", |  | ||||||
|         Operator:                       "#D19A66", |  | ||||||
|         Operator.Word:                  "#AA22FF bold", |  | ||||||
|         Text.Whitespace:                "#D7DAE0", |  | ||||||
|         # fmt: on |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| CSSCLASS = '.code-highlight' | CSSCLASS = '.code-highlight' | ||||||
| RULE_CODE_LINENOS = """ .linenos { | RULE_CODE_LINENOS = """ .linenos { | ||||||
|     -webkit-touch-callout: none; |     -webkit-touch-callout: none; | ||||||
|  | @ -128,16 +59,6 @@ def get_css(cssclass, style): | ||||||
| 
 | 
 | ||||||
| def main(): | def main(): | ||||||
| 
 | 
 | ||||||
|     fname = 'static/themes/oscar/src/generated/pygments-logicodev.less' |  | ||||||
|     print("update: %s" % fname) |  | ||||||
|     with open(get_output_filename(fname), 'w') as f: |  | ||||||
|         f.write(get_css(CSSCLASS, LogicodevStyle)) |  | ||||||
| 
 |  | ||||||
|     fname = 'static/themes/oscar/src/generated/pygments-pointhi.less' |  | ||||||
|     print("update: %s" % fname) |  | ||||||
|     with open(get_output_filename(fname), 'w') as f: |  | ||||||
|         f.write(get_css(CSSCLASS, 'default')) |  | ||||||
| 
 |  | ||||||
|     fname = 'static/themes/simple/src/generated/pygments.less' |     fname = 'static/themes/simple/src/generated/pygments.less' | ||||||
|     print("update: %s" % fname) |     print("update: %s" % fname) | ||||||
|     with open(get_output_filename(fname), 'w') as f: |     with open(get_output_filename(fname), 'w') as f: | ||||||
|  |  | ||||||
|  | @ -24,7 +24,7 @@ server: | ||||||
| ui: | ui: | ||||||
|   static_path: "" |   static_path: "" | ||||||
|   templates_path: "" |   templates_path: "" | ||||||
|   default_theme: oscar |   default_theme: simple | ||||||
| 
 | 
 | ||||||
| preferences: | preferences: | ||||||
|   lock: [] |   lock: [] | ||||||
|  |  | ||||||
|  | @ -10,7 +10,7 @@ url = "http://localhost:11111/" | ||||||
| def test_index(browser): | def test_index(browser): | ||||||
|     # Visit URL |     # Visit URL | ||||||
|     browser.visit(url) |     browser.visit(url) | ||||||
|     assert browser.is_text_present('about') |     assert browser.is_text_present('searxng') | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def test_404(browser): | def test_404(browser): | ||||||
|  | @ -21,54 +21,54 @@ def test_404(browser): | ||||||
| 
 | 
 | ||||||
| def test_about(browser): | def test_about(browser): | ||||||
|     browser.visit(url) |     browser.visit(url) | ||||||
|     browser.click_link_by_text('about') |     browser.click_link_by_text('searxng') | ||||||
|     assert browser.is_text_present('Why use it?') |     assert browser.is_text_present('Why use it?') | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def test_preferences(browser): | def test_preferences(browser): | ||||||
|     browser.visit(url) |     browser.visit(url) | ||||||
|     browser.click_link_by_text('preferences') |     browser.click_link_by_href('/preferences') | ||||||
|     assert browser.is_text_present('Preferences') |     assert browser.is_text_present('Preferences') | ||||||
|     assert browser.is_text_present('Cookies') |     assert browser.is_text_present('COOKIES') | ||||||
| 
 | 
 | ||||||
|     assert browser.is_element_present_by_xpath('//label[@for="checkbox_dummy"]') |     assert browser.is_element_present_by_xpath('//label[@for="checkbox_dummy"]') | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def test_preferences_engine_select(browser): | def test_preferences_engine_select(browser): | ||||||
|     browser.visit(url) |     browser.visit(url) | ||||||
|     browser.click_link_by_text('preferences') |     browser.click_link_by_href('/preferences') | ||||||
| 
 | 
 | ||||||
|     assert browser.is_element_present_by_xpath('//a[@href="#tab_engine"]') |     assert browser.is_element_present_by_xpath('//label[@for="tab-engines"]') | ||||||
|     browser.find_by_xpath('//a[@href="#tab_engine"]').first.click() |     browser.find_by_xpath('//label[@for="tab-engines"]').first.click() | ||||||
| 
 | 
 | ||||||
|     assert not browser.find_by_xpath('//input[@id="engine_general_dummy__general"]').first.checked |     assert not browser.find_by_xpath('//input[@id="engine_general_dummy__general"]').first.checked | ||||||
|     browser.find_by_xpath('//label[@for="engine_general_dummy__general"]').first.check() |     browser.find_by_xpath('//label[@for="engine_general_dummy__general"]').first.check() | ||||||
|     browser.find_by_xpath('//input[@value="save"]').first.click() |     browser.find_by_xpath('//input[@type="submit"]').first.click() | ||||||
| 
 | 
 | ||||||
|     # waiting for the redirect - without this the test is flaky.. |     # waiting for the redirect - without this the test is flaky.. | ||||||
|     sleep(1) |     sleep(1) | ||||||
| 
 | 
 | ||||||
|     browser.visit(url) |     browser.visit(url) | ||||||
|     browser.click_link_by_text('preferences') |     browser.click_link_by_href('/preferences') | ||||||
|     browser.find_by_xpath('//a[@href="#tab_engine"]').first.click() |     browser.find_by_xpath('//label[@for="tab-engines"]').first.click() | ||||||
| 
 | 
 | ||||||
|     assert browser.find_by_xpath('//input[@id="engine_general_dummy__general"]').first.checked |     assert browser.find_by_xpath('//input[@id="engine_general_dummy__general"]').first.checked | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def test_preferences_locale(browser): | def test_preferences_locale(browser): | ||||||
|     browser.visit(url) |     browser.visit(url) | ||||||
|     browser.click_link_by_text('preferences') |     browser.click_link_by_href('/preferences') | ||||||
| 
 | 
 | ||||||
|     browser.find_by_xpath('//a[@href="#tab_ui"]').first.click() |     browser.find_by_xpath('//label[@for="tab-ui"]').first.click() | ||||||
|     browser.select('locale', 'hu') |     browser.select('locale', 'fr') | ||||||
|     browser.find_by_xpath('//input[@value="save"]').first.click() |     browser.find_by_xpath('//input[@type="submit"]').first.click() | ||||||
| 
 | 
 | ||||||
|     # waiting for the redirect - without this the test is flaky.. |     # waiting for the redirect - without this the test is flaky.. | ||||||
|     sleep(1) |     sleep(1) | ||||||
| 
 | 
 | ||||||
|     browser.visit(url) |     browser.visit(url) | ||||||
|     browser.click_link_by_text('beállítások') |     browser.click_link_by_href('/preferences') | ||||||
|     browser.is_text_present('Beállítások') |     browser.is_text_present('Préférences') | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def test_search(browser): | def test_search(browser): | ||||||
|  |  | ||||||
|  | @ -119,17 +119,32 @@ class TestPreferences(SearxTestCase): | ||||||
|     def test_encode(self): |     def test_encode(self): | ||||||
|         from searx.preferences import Preferences |         from searx.preferences import Preferences | ||||||
| 
 | 
 | ||||||
|         pref = Preferences(['oscar', 'simple'], ['general'], {}, []) |         pref = Preferences(['simple'], ['general'], {}, []) | ||||||
|         url_params = ( |         url_params = ( | ||||||
|             'eJx1VMmO2zAM_Zr6YrTocujJh6JF0QEKzKAz7VVgJNohLIseUU7ivy-VcWy5yyGOTVGP73GLKJNPYjiYgGeT4NB8BS9YOSY' |             'eJx1Vk1z4zYM_TXxRZNMd7eddg8-pe21nWnvGoiEJEQkofDDtvzrC1qSRdnbQxQTBA' | ||||||
|             'TUdifMDYM-vmGY1d5CN0EHTYOK88W_PXNkcDBozOjnzoK0vyi4bWnHs2RU4-zvHr_-RF9a-5Cy3GARByy7X7EkKMoBeMp9CuPQ-SzYMx' |             'Hw8eGRCiJ27AnDsUOHHszBgOsSdHjU-Pr7HwfDCkweHCBFVmxHgxGPB7LiU4-eL9Px' | ||||||
|             '8Vr9P1qKI-XJ_p1fOkRJWNCgVM0a-zAttmBJbHkaPSZlNts-_jiuBFgUh2mPztkpHHLBhsRArDHvm356eHh5vATS0Mqagr0ZsZO_V8hT' |             'TzABDxZjz_r491___HsI0GJA8Ko__nSIPVo8BspLDx5DMjHU7GqH5zpCsyzXTLVMsj' | ||||||
|             'B9srt54_v6jewJugqL4Nn_hYSdhxnI-jRpi05GDQCStOT7UGVmJY8ZnltRKyF23SGiLWjqNcygKGkpyeGZIywJfD1gI5AjRTAmBM55Aw' |             'mhPzLI8I19d5iX1SFOUkUu4QD6BE6hrpcE8_LPhH6qydWRonjORnItOYqyXHk2Zs1E' | ||||||
|             'Q0Tn626lj7jzWo4e5hnEsIlprX6dTgdBRpyRBFKTDgBF8AasVyT4gvSTEoXRpXWRyG3CYQYld65I_V6lboILTMAlZY65_ejRDcHgp0Tv' |             'ARojAdB15GTrMA6VJe_Z13VLBsPL1_ccmk5YUajrBRqxNhSbpAaMdU1Rxkqp13iq6x' | ||||||
|             'EPtGAsqTiBf3m76g7pP9B84mwjPvuUtASRDei1nDF2ix_JXW91UJkXrPh6RAhznVmKyQl7dwJdMJ6bz1QOmgzYlrEzHDMcEUuo44AgS1' |             'Np5LxMI15RwtgUSOWx7iqNtyqI3S4Wej6TrmsWfHx2lcD5r-PSa7NWN8glxPxf5r5c' | ||||||
|             'CvkjaOb2Q2AyY5oGDTs_OLXE_c2I5cg9hk3kEJZ0fu4SuktsIA2RhuJwP86AdripThCBeO9uVUejyPGmFSxPrqEYcuWi25zOEXV9tc1m' |             'ikGrPedw6wZaj1gFbuMZPFaaPKrIAtFceOvJDQSqCNBRJ7BAiGX6TtCEZt0ta2zQd8' | ||||||
|             '_KP1nafYtdfv6Q9hKfWmGm9A_3G635UwiVndLGdFCiLWkONk0xUxGLGGweGWTa2nZYZ0fS1YKlE3Uuw8fPl52E5U8HJYbC7sbjXUsrnT' |             'uwY-4MVqOBqYJxDFvucsbyiXLVd4i6kbUuMeqh8ZA_S1yyutlgIQfFYnLykziFH9vW' | ||||||
|             'XHXRbELfO-1fGSqskiGnMK7B0dV3t8Lq08pbdtYpuVdoKWA2Yjuyah_vHp2rZWjo0zXL8Gw8DTj0=' |             'kB8Uet5iDKQGCEWBhiSln6q80UDlBDch4psPSy1wNZMnVYR2o13m3ASwreQRnceRi2' | ||||||
|  |             'AjSNqOwsqWmbAZxSp_7kcBFnJBeHez4CKpKqieDQgsQREK5fNcBB_H3HrFIUUeJo4s' | ||||||
|  |             'Wx7Abekn6HnHpTM10348UMM8hEejdKbY8ncxfCaO-OgVOHn1ZJX2DRSf8px4eqj6y7' | ||||||
|  |             'dvv162anXS6LYjC3h1YEt_yx-IQ2lxcMo82gw-NVOHdj28EdHH1GDBFYuaQFIMQsrz' | ||||||
|  |             'GZtiyicrqlAYznyhgd2bHFeYHLvJYlHfy_svL7995bOjofp4ef_55fv36zRANbIJA2' | ||||||
|  |             'FX0C_v34oE3Es9oHtQIOFFZcilS5WdV_J5YUHRoeAvdCrZ0IDTCuy4sTOvHvMe96rl' | ||||||
|  |             'usfxs5rcrLuTv1lmOApYmqip6_bEz4eORSyR2xA8tmWxKnkvP3fM0Hgi4bpstFisWR' | ||||||
|  |             'TWV31adSdvSkPc7SkKbtOOTxgny05ALE6pNdL5vhQ5dFQKhYxjbpJZ0ChuSWcN22nh' | ||||||
|  |             'rGpPwC32HXSL7Qm8xf6Dzu6XfLfk19dFoZ4li1sRD9fJVVnWYOmiDCe97Uw0RGi4am' | ||||||
|  |             'o-JJA7IMMYUO7fIvM6N6ZG4ILlotrPhyjXSbSQqQZj7i2d-2pzGntRIHefJS8viwaK' | ||||||
|  |             '-iW6NN9uyTSuTP88CwtKrG-GPaSz6Qn92fwEtGxVk4QMrAhMdev7m6yMBLMOF86iZN' | ||||||
|  |             'JIe_xEadXAQuzW8HltyDCkJrmYVqVOI_oU7ijL64W03LLC81jcA8kFuQpDX1R90-b9' | ||||||
|  |             '_iZOD2J1t9xfE0BGSJ5PqHA7kUUudYuG7HFjz12C2Mz3zNhD8eQgFa_sdiy3InNWHg' | ||||||
|  |             'pV9OCCkWPUZRivRfA2g3DytC3fnlajSaJs4Zihvrwto7eeQxRVR3noCSDzhbZzYKjn' | ||||||
|  |             'd-DZy7PtaVp2WgvPBpzCXUL_J1OGex48RVmOXzBU8_N3kqekkefRDzxNK2_Klp9mBJ' | ||||||
|  |             'wsUnXyRqq1mScHuYalUY7_AZTCR4s=&q=' | ||||||
|         ) |         ) | ||||||
|         pref.parse_encoded_data(url_params) |         pref.parse_encoded_data(url_params) | ||||||
|         self.assertEqual( |         self.assertEqual( | ||||||
|  |  | ||||||
|  | @ -4,10 +4,6 @@ | ||||||
| 
 | 
 | ||||||
| STATIC_BUILD_COMMIT="[build] /static" | STATIC_BUILD_COMMIT="[build] /static" | ||||||
| STATIC_BUILT_PATHS=( | STATIC_BUILT_PATHS=( | ||||||
|     'searx/static/themes/oscar/css' |  | ||||||
|     'searx/static/themes/oscar/js' |  | ||||||
|     'searx/static/themes/oscar/src/generated/pygments-logicodev.less' |  | ||||||
|     'searx/static/themes/oscar/src/generated/pygments-pointhi.less' |  | ||||||
|     'searx/static/themes/simple/css' |     'searx/static/themes/simple/css' | ||||||
|     'searx/static/themes/simple/js' |     'searx/static/themes/simple/js' | ||||||
|     'searx/static/themes/simple/src/generated/pygments.less' |     'searx/static/themes/simple/src/generated/pygments.less' | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Markus Heiser
						Markus Heiser