lib_sxng_data.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. EOF
  10. }
  11. data.all() {
  12. ( set -e
  13. pyenv.activate
  14. data.traits
  15. data.useragents
  16. build_msg DATA "update searx/data/osm_keys_tags.json"
  17. pyenv.cmd python searxng_extra/update/update_osm_keys_tags.py
  18. build_msg DATA "update searx/data/ahmia_blacklist.txt"
  19. python searxng_extra/update/update_ahmia_blacklist.py
  20. build_msg DATA "update searx/data/wikidata_units.json"
  21. python searxng_extra/update/update_wikidata_units.py
  22. build_msg DATA "update searx/data/currencies.json"
  23. python searxng_extra/update/update_currencies.py
  24. build_msg DATA "update searx/data/external_bangs.json"
  25. python searxng_extra/update/update_external_bangs.py
  26. build_msg DATA "update searx/data/engine_descriptions.json"
  27. python searxng_extra/update/update_engine_descriptions.py
  28. )
  29. }
  30. data.traits() {
  31. ( set -e
  32. pyenv.activate
  33. build_msg DATA "update searx/data/engine_traits.json"
  34. python searxng_extra/update/update_engine_traits.py
  35. build_msg ENGINES "update searx/sxng_locales.py"
  36. )
  37. dump_return $?
  38. }
  39. data.useragents() {
  40. build_msg DATA "update searx/data/useragents.json"
  41. pyenv.cmd python searxng_extra/update/update_firefox_version.py
  42. dump_return $?
  43. }
  44. docs.prebuild() {
  45. build_msg DOCS "build ${DOCS_BUILD}/includes"
  46. (
  47. set -e
  48. [ "$VERBOSE" = "1" ] && set -x
  49. mkdir -p "${DOCS_BUILD}/includes"
  50. ./utils/searxng.sh searxng.doc.rst > "${DOCS_BUILD}/includes/searxng.rst"
  51. pyenv.cmd searxng_extra/docs_prebuild
  52. )
  53. dump_return $?
  54. }