on pycurl help sign in
searx/manage.sh
97 lines 2.6 kB history raw
1#!/bin/sh
3BASE_DIR=$(dirname `readlink -f $0`)
4PYTHONPATH=$BASE_DIR
5SEARX_DIR="$BASE_DIR/searx"
6ACTION=$1
8update_packages() {
9 pip install --upgrade -r "$BASE_DIR/requirements.txt"
12update_dev_packages() {
13 update_packages
14 pip install --upgrade -r "$BASE_DIR/requirements-dev.txt"
17pep8_check() {
18 echo '[!] Running pep8 check'
19 # ignored rules:
20 # E402 module level import not at top of file
21 # W503 line break before binary operator
22 pep8 --max-line-length=120 --ignore "E402,W503" "$SEARX_DIR" "$BASE_DIR/tests"
25unit_tests() {
26 echo '[!] Running unit tests'
27 python -m nose2 -s "$BASE_DIR/tests/unit"
30py_test_coverage() {
31 echo '[!] Running python test coverage'
32 PYTHONPATH=`pwd` python -m nose2 -C --coverage "$SEARX_DIR" -s "$BASE_DIR/tests/unit"
33 coverage report
34 coverage html
37robot_tests() {
38 echo '[!] Running robot tests'
39 PYTHONPATH=`pwd` python "$SEARX_DIR/testing.py" robot
42tests() {
43 set -e
44 pep8_check
45 unit_tests
46 robot_tests
47 set +e
50build_style() {
51 lessc -x "$BASE_DIR/searx/static/$1" "$BASE_DIR/searx/static/$2"
54styles() {
55 echo '[!] Building styles'
56 build_style themes/default/less/style.less themes/default/css/style.css
57 build_style themes/default/less/style-rtl.less themes/default/css/style-rtl.css
58 build_style themes/courgette/less/style.less themes/courgette/css/style.css
59 build_style themes/courgette/less/style-rtl.less themes/courgette/css/style-rtl.css
60 build_style less/bootstrap/bootstrap.less css/bootstrap.min.css
61 build_style themes/oscar/less/oscar/oscar.less themes/oscar/css/oscar.min.css
62 build_style themes/pix-art/less/style.less themes/pix-art/css/style.css
65grunt_build() {
66 grunt --gruntfile "$SEARX_DIR/static/themes/oscar/gruntfile.js"
69locales() {
70 pybabel compile -d "$SEARX_DIR/translations"
73help() {
74 [ -z "$1" ] || echo "Error: $1\n"
75 echo "Searx manage.sh help
77Commands
78========
79 grunt_build - Build js files
80 help - This text
81 locales - Compile locales
82 pep8_check - Pep8 validation
83 py_test_coverage - Unit test coverage
84 robot_tests - Run selenium tests
85 styles - Build less files
86 tests - Run all python tests (pep8, unit, robot)
87 unit_tests - Run unit tests
88 update_dev_packages - Check & update development and production dependency changes
89 update_packages - Check & update dependency changes
93if type $ACTION 1>/dev/null; then
94 $ACTION
95else
96 help "action not found"
97fi