Passed
Pull Request — master (#1339)
by Konstantin
02:11
created

ocrd.cli.bashlib.bashlib_constants()   B

Complexity

Conditions 7

Size

Total Lines 23
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 18
dl 0
loc 23
rs 8
c 0
b 0
f 0
cc 7
nop 1
1
"""
2
OCR-D CLI: bash library
3
4
.. click:: ocrd.cli.bashlib:bashlib_cli
5
    :prog: ocrd bashlib
6
    :nested: full
7
8
"""
9
10
# WARNING: bashlib processors have been deprecated as of v3 of the OCR-D/core API
11
#          and will be removed in v3.7.0. We retain the `ocrd bashlib` CLI only
12
#          to not break the `ocrd bashlib filename` command, which is used in CD
13
#          scripts to get the `share` directory of the core installation. 
14
15
import click
16
from ocrd.constants import BASHLIB_FILENAME
17
18
# ----------------------------------------------------------------------
19
# ocrd bashlib
20
# ----------------------------------------------------------------------
21
22
23
@click.group('bashlib')
24
def bashlib_cli():
25
    """
26
    Work with bash library
27
    """
28
29
# ----------------------------------------------------------------------
30
# ocrd bashlib filename
31
# ----------------------------------------------------------------------
32
33
34
@bashlib_cli.command('filename')
35
def bashlib_filename():
36
    """
37
    Dump the bash library filename for sourcing by shell scripts
38
39
    For functions exported by bashlib, see `<../../README.md>`_
40
    """
41
    print(BASHLIB_FILENAME)
42
43