lib_sxng_data.sh 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #!/usr/bin/env bash
  2. # SPDX-License-Identifier: AGPL-3.0-or-later
  3. data.help(){
  4. cat <<EOF
  5. data.:
  6. all : update searx/sxng_locales.py and searx/data/*
  7. traits : update searx/data/engine_traits.json & searx/sxng_locales.py
  8. useragents: update searx/data/useragents.json with the most recent versions of Firefox
  9. locales : update searx/data/locales.json from babel
  10. currencies: update searx/data/currencies.json from wikidata
  11. EOF
  12. }
  13. data.all() {
  14. ( set -e
  15. pyenv.activate
  16. data.traits
  17. data.useragents
  18. data.locales
  19. build_msg DATA "update searx/data/osm_keys_tags.json"
  20. pyenv.cmd python searxng_extra/update/update_osm_keys_tags.py
  21. build_msg DATA "update searx/data/ahmia_blacklist.txt"
  22. python searxng_extra/update/update_ahmia_blacklist.py
  23. build_msg DATA "update searx/data/wikidata_units.json"
  24. python searxng_extra/update/update_wikidata_units.py
  25. build_msg DATA "update searx/data/currencies.json"
  26. python searxng_extra/update/update_currencies.py
  27. build_msg DATA "update searx/data/external_bangs.json"
  28. python searxng_extra/update/update_external_bangs.py
  29. build_msg DATA "update searx/data/engine_descriptions.json"
  30. python searxng_extra/update/update_engine_descriptions.py
  31. )
  32. }
  33. data.traits() {
  34. ( set -e
  35. pyenv.activate
  36. build_msg DATA "update searx/data/engine_traits.json"
  37. python searxng_extra/update/update_engine_traits.py
  38. build_msg ENGINES "update searx/sxng_locales.py"
  39. )
  40. dump_return $?
  41. }
  42. data.useragents() {
  43. build_msg DATA "update searx/data/useragents.json"
  44. pyenv.cmd python searxng_extra/update/update_firefox_version.py
  45. dump_return $?
  46. }
  47. data.locales() {
  48. ( set -e
  49. pyenv.activate
  50. build_msg DATA "update searx/data/locales.json"
  51. python searxng_extra/update/update_locales.py
  52. )
  53. dump_return $?
  54. }
  55. data.currencies(){
  56. ( set -e
  57. pyenv.activate
  58. build_msg DATA "update searx/data/currencies.json"
  59. python searxng_extra/update/update_currencies.py
  60. )
  61. dump_return $?
  62. }