Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
EditionOpenAccess
/
EOASkripts
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
2
Code
Issues
34
Pull requests
0
Actions
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security
Insights
Files
ad520bc
doc
scripts
src
bibformat
config
data
stylesheets
utils
bib_add_keyword.py
create_tmpbib.py
eoatex2imxml.py
eoatex2pdf.py
find_chapters.py
fix_tei.py
idassigner.py
imxml2django.py
imxml2epub.py
imxml2tei.py
mkimage.py
parsezotero.py
process_eoa_latex.py
process_tei.py
tei2eoatex.py
tei2html.py
tei2imxml.py
tei_add_bibl.py
tei_pickle.py
.dockerignore
.gitignore
.init-container.sh
Dockerfile
LICENSE
README.md
dependencies.conf
docker-compose.yaml
requirements.txt
Breadcrumbs
EOASkripts
/
src
/
process_tei.py
Blame
Blame
Latest commit
History
History
executable file
·
98 lines (85 loc) · 2.6 KB
Breadcrumbs
EOASkripts
/
src
/
process_tei.py
Top
File metadata and controls
Code
Blame
executable file
·
98 lines (85 loc) · 2.6 KB
Raw
#!/usr/bin/env python3 from utils.load_config import load_config, exec_command # imports import argparse from pathlib import Path import glob import os import subprocess import shutil import logging BASE_DIR = Path( __file__ ).resolve().parent SCRIPT_PATH = Path( __file__ ) SCRIPT_NAME = SCRIPT_PATH.stem DEFAULT_INPUT_DIR = \ Path(os.environ['INPUT_DIR'] if 'INPUT_DIR' in os.environ else './input') DEFAULT_OUTPUT_DIR = \ Path(os.environ['OUTPUT_DIR'] if 'OUTPUT_DIR' in os.environ else './output') DEFAULT_DEPENDENCIES_DIR = \ Path(os.environ['DEPENDENCIES_DIR'] if 'DEPENDENCIES_DIR' in os.environ else './dependencies') def main( publ_dir ): PUBL_NAME = publ_dir.resolve().stem exec_command( f"tei_add_bibl.py -! \"{publ_dir}\"" ) exec_command( f"tei2eoatex.py -! \"{publ_dir}\"" ) exec_command( f"eoatex2pdf.py --output-dir \"{DEFAULT_OUTPUT_DIR}/{PUBL_NAME}/pdf\" \"{DEFAULT_OUTPUT_DIR}/{PUBL_NAME}/eoatex\"" ) exec_command( f"tei_pickle.py -! \"{DEFAULT_OUTPUT_DIR}/with_bibl/{PUBL_NAME}\"" ) exec_command( f"tei2imxml.py --filename no_bibl.xml \"{DEFAULT_OUTPUT_DIR}/with_bibl/{PUBL_NAME}\"" ) exec_command( f"tei2html.py -! --filename \"with_bibl.xml\" \"{DEFAULT_OUTPUT_DIR}/with_bibl/{PUBL_NAME}\"" ) exec_command( f"imxml2django.py \"{publ_dir}\"" ) exec_command( f"imxml2epub.py \"{publ_dir}\"" ) if __name__ == "__main__": ##################### # Parsing arguments # ##################### parser = argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelpFormatter ) parser.add_argument( "-c", "--config", default = BASE_DIR / "config" / "eoaconvert.cfg", dest="CONFIG_FILE", help="Name of configuration file", metavar="CONFIGURATION" ) parser.add_argument( "-l", "--log-file", default = (DEFAULT_OUTPUT_DIR / 'logs' / SCRIPT_NAME).with_suffix(".log"), help="logfile" ) parser.add_argument( "--log-level", default = "INFO", help="log level: choose between DEBUG, INFO, WARNING, ERROR, CRITICAL" ) parser.add_argument( "PUBLICATION_DIR", help = "directory containing the publication (including resources like pictures, etc.)", type = Path, ) args = parser.parse_args() CONFIG = load_config( args.CONFIG_FILE, args.log_level, args.log_file, ) main( publ_dir = Path( args.PUBLICATION_DIR ) )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
You can’t perform that action at this time.