mirror of
https://github.com/YunoHost-Apps/paperless-ngx_ynh.git
synced 2024-09-03 19:56:33 +02:00
Add NLTK Data
This commit is contained in:
parent
16dd8fab11
commit
b17ca2d229
4 changed files with 19 additions and 0 deletions
|
@ -25,6 +25,7 @@ PAPERLESS_DATA_DIR=__DATADIR__/data
|
||||||
PAPERLESS_MEDIA_ROOT=__DATADIR__/media
|
PAPERLESS_MEDIA_ROOT=__DATADIR__/media
|
||||||
#PAPERLESS_STATICDIR=../static
|
#PAPERLESS_STATICDIR=../static
|
||||||
#PAPERLESS_FILENAME_FORMAT=
|
#PAPERLESS_FILENAME_FORMAT=
|
||||||
|
PAPERLESS_NLTK_DIR=__FINALPATH_/nltk_data
|
||||||
|
|
||||||
# Security and hosting
|
# Security and hosting
|
||||||
|
|
||||||
|
|
|
@ -128,6 +128,14 @@ pushd $final_path
|
||||||
source "$final_path/venv/bin/activate"
|
source "$final_path/venv/bin/activate"
|
||||||
ynh_exec_as $app $final_path/venv/bin/pip3 install --upgrade pip setuptools wheel
|
ynh_exec_as $app $final_path/venv/bin/pip3 install --upgrade pip setuptools wheel
|
||||||
ynh_exec_as $app $final_path/venv/bin/pip3 install -r "$final_path/requirements.txt"
|
ynh_exec_as $app $final_path/venv/bin/pip3 install -r "$final_path/requirements.txt"
|
||||||
|
|
||||||
|
# Installing NLTK data
|
||||||
|
mkdir -p "$final_path/nltk_data"
|
||||||
|
chown -R "$app:" "$final_path/nltk_data"
|
||||||
|
ynh_exec_warn_less ynh_exec_as $app $final_path/venv/bin/python3 -m nltk.downloader -d "$final_path/nltk_data" snowball_data
|
||||||
|
ynh_exec_warn_less ynh_exec_as $app $final_path/venv/bin/python3 -m nltk.downloader -d "$final_path/nltk_data" stopwords
|
||||||
|
ynh_exec_warn_less ynh_exec_as $app $final_path/venv/bin/python3 -m nltk.downloader -d "$final_path/nltk_data" punkt
|
||||||
|
|
||||||
deactivate
|
deactivate
|
||||||
)
|
)
|
||||||
popd
|
popd
|
||||||
|
|
|
@ -38,6 +38,7 @@ db_user=$db_name
|
||||||
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
||||||
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
||||||
paperless_secret_key=$(ynh_app_setting_get --app=$app --key=paperless_secret_key)
|
paperless_secret_key=$(ynh_app_setting_get --app=$app --key=paperless_secret_key)
|
||||||
|
ocr_language=$(ynh_app_setting_get --app=$app --key=ocr_language)
|
||||||
|
|
||||||
redis_db=$(ynh_redis_get_free_db)
|
redis_db=$(ynh_redis_get_free_db)
|
||||||
ynh_app_setting_set --app=$app --key=redis_db --value=$redis_db
|
ynh_app_setting_set --app=$app --key=redis_db --value=$redis_db
|
||||||
|
|
|
@ -124,6 +124,15 @@ pushd $final_path
|
||||||
source "$final_path/venv/bin/activate"
|
source "$final_path/venv/bin/activate"
|
||||||
ynh_exec_as $app $final_path/venv/bin/pip3 install --upgrade pip setuptools wheel
|
ynh_exec_as $app $final_path/venv/bin/pip3 install --upgrade pip setuptools wheel
|
||||||
ynh_exec_as $app $final_path/venv/bin/pip3 install -r "$final_path/requirements.txt"
|
ynh_exec_as $app $final_path/venv/bin/pip3 install -r "$final_path/requirements.txt"
|
||||||
|
|
||||||
|
# Installing NLTK data
|
||||||
|
ynh_secure_remove --file="$final_path/nltk_data"
|
||||||
|
mkdir -p "$final_path/nltk_data"
|
||||||
|
chown -R "$app:" "$final_path/nltk_data"
|
||||||
|
ynh_exec_warn_less ynh_exec_as $app $final_path/venv/bin/python3 -m nltk.downloader -d "$final_path/nltk_data" snowball_data
|
||||||
|
ynh_exec_warn_less ynh_exec_as $app $final_path/venv/bin/python3 -m nltk.downloader -d "$final_path/nltk_data" stopwords
|
||||||
|
ynh_exec_warn_less ynh_exec_as $app $final_path/venv/bin/python3 -m nltk.downloader -d "$final_path/nltk_data" punkt
|
||||||
|
|
||||||
deactivate
|
deactivate
|
||||||
)
|
)
|
||||||
popd
|
popd
|
||||||
|
|
Loading…
Reference in a new issue