lib_sxng_data.sh 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. (
  15. set -e
  16. pyenv.activate
  17. data.traits
  18. data.useragents
  19. data.locales
  20. build_msg DATA "update searx/data/osm_keys_tags.json"
  21. pyenv.cmd python searxng_extra/update/update_osm_keys_tags.py
  22. build_msg DATA "update searx/data/ahmia_blacklist.txt"
  23. python searxng_extra/update/update_ahmia_blacklist.py
  24. build_msg DATA "update searx/data/wikidata_units.json"
  25. python searxng_extra/update/update_wikidata_units.py
  26. build_msg DATA "update searx/data/currencies.json"
  27. python searxng_extra/update/update_currencies.py
  28. build_msg DATA "update searx/data/external_bangs.json"
  29. python searxng_extra/update/update_external_bangs.py
  30. build_msg DATA "update searx/data/engine_descriptions.json"
  31. python searxng_extra/update/update_engine_descriptions.py
  32. )
  33. }
  34. data.traits() {
  35. (
  36. set -e
  37. pyenv.activate
  38. build_msg DATA "update searx/data/engine_traits.json"
  39. python searxng_extra/update/update_engine_traits.py
  40. build_msg ENGINES "update searx/sxng_locales.py"
  41. )
  42. dump_return $?
  43. }
  44. data.useragents() {
  45. build_msg DATA "update searx/data/useragents.json"
  46. pyenv.cmd python searxng_extra/update/update_firefox_version.py
  47. dump_return $?
  48. }
  49. data.locales() {
  50. (
  51. set -e
  52. pyenv.activate
  53. build_msg DATA "update searx/data/locales.json"
  54. python searxng_extra/update/update_locales.py
  55. )
  56. dump_return $?
  57. }
  58. data.currencies() {
  59. (
  60. set -e
  61. pyenv.activate
  62. build_msg DATA "update searx/data/currencies.json"
  63. python searxng_extra/update/update_currencies.py
  64. )
  65. dump_return $?
  66. }