Skip to content

Commit

Permalink
1603_1.py (#29): improved checks
Browse files Browse the repository at this point in the history
  • Loading branch information
fititnt committed Apr 17, 2022
1 parent bb75f87 commit 94bd04a
Show file tree
Hide file tree
Showing 4 changed files with 215 additions and 94 deletions.
57 changes: 47 additions & 10 deletions officinam/999999999/0/1603_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -3150,19 +3150,18 @@ def imprimere_in_markdown(self):
paginae.append(' - concepta_non_unicum: {0}'.format(
status['status_quo']['summa']['concepta_non_unicum']))
paginae.append('')

for codex, item in status['librarium'].items():
paginae.append('## {0} {1}'.format(codex, item['meta']['nomen']))
paginae.append('- status_quo')
paginae.append(
' - concepta: {0}'.format(item['status_quo']['summa']['concepta']))
paginae.append(
' - res_interlingualibus: {0}'.format(
item['status_quo']['summa']['res_interlingualibus']))

caveat_lector = self.imprimere_res_caveat_lector(item)
corde = self.imprimere_res_methodi_ex_dictionariorum_corde(item)

paginae.append(
' - res_lingualibus: {0}'.format(
item['status_quo']['summa']['res_lingualibus']))
'## {0} {1}'.format(codex, item['meta']['nomen']))

paginae.append('')
paginae.append('<details><summary>details</summary>')
paginae.append(
'<details><summary>🔎🗄️{0}🗄️🔍</summary>'.format(codex))
paginae.append('')
paginae.append('```json')
# paginae.append('')
Expand All @@ -3173,12 +3172,50 @@ def imprimere_in_markdown(self):
paginae.append('')
paginae.append('</details>')
paginae.append('')

paginae.append('- status_quo')
paginae.append(
' - concepta: {0}'.format(item['status_quo']['summa']['concepta']))
paginae.append(
' - res_interlingualibus: {0}'.format(
item['status_quo']['summa']['res_interlingualibus']))
paginae.append(
' - res_lingualibus: {0}'.format(
item['status_quo']['summa']['res_lingualibus']))

if corde:
paginae.append(
'### {0} Methodī ex dictiōnāriōrum corde'.format(codex))
paginae.append('')
paginae.append(corde)
paginae.append('')

if caveat_lector:
paginae.append('### {0} Caveat_lector'.format(codex))
paginae.append('')
paginae.append(caveat_lector)
paginae.append('')

paginae.append('')

# return [yaml.dump(
# status, allow_unicode=True)]
return paginae

def imprimere_res_caveat_lector(self, item):
if item and 'meta' in item and \
'caveat_lector' in item['meta'] and \
'mul-Zyyy' in item['meta']['caveat_lector']:
return item['meta']['caveat_lector']['mul-Zyyy']
return None

def imprimere_res_methodi_ex_dictionariorum_corde(self, item):
if item and 'meta' in item and \
'methodi_ex_dictionariorum_corde' in item['meta'] and \
'mul-Zyyy' in item['meta']['methodi_ex_dictionariorum_corde']:
return item['meta']['methodi_ex_dictionariorum_corde']['mul-Zyyy']
return None


class CodexInTabulamJson:
"""Codex Sarcinarum Adnexīs
Expand Down
63 changes: 52 additions & 11 deletions officinam/999999999/999999999.lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ file_convert_csv_de_downloaded_xlsx() {
est_temporarium_fontem="${2:-"1"}"
est_temporarium_objectivum="${3:-"1"}"
# opus_papyro="${4:-"10"}" # Not really necessary if using in2csv
# (name of sheet). However it still trying to infer
# the numbers
# (name of sheet). However it still trying to infer
# the numbers

_path=$(numerordinatio_neo_separatum "$numerordinatio" "/")
_nomen=$(numerordinatio_neo_separatum "$numerordinatio" "_")
Expand Down Expand Up @@ -382,7 +382,7 @@ file_convert_csv_de_downloaded_xlsx() {
# hxltmcli --sheet "$opus_papyro" "$fontem_archivum" "$objectivum_archivum_temporarium"
# hxlclean --sheet "$opus_papyro" "$fontem_archivum" "$objectivum_archivum_temporarium"
# in2csv --format xlsx --no-inference --skip-lines 17 --sheet "$_nomen" "$fontem_archivum" > "${objectivum_archivum_temporarium_csv}"
in2csv --format xlsx --no-inference --skip-lines 17 --sheet "$_nomen" "$fontem_archivum" > "${objectivum_archivum_temporarium_csv}"
in2csv --format xlsx --no-inference --skip-lines 17 --sheet "$_nomen" "$fontem_archivum" >"${objectivum_archivum_temporarium_csv}"
# issue: in2csv is adding ".0" to #item+conceptum+codicem for integers. even with --no-inference
# set +x

Expand Down Expand Up @@ -967,7 +967,7 @@ file_translate_csv_de_numerordinatio_q() {

if [ -z "$(stale_archive "$objectivum_archivum")" ]; then
if [ "$always_stale" != '1' ]; then
return 0;
return 0
fi
echo "Cache may exist, but always_stale enabled [$numerordinatio]"
fi
Expand Down Expand Up @@ -2054,6 +2054,39 @@ fi
# boring calls. #
################################################################################

#######################################
# Check if Numerodinatio needs Wikidata Q
#
# Globals:
# ROOTDIR
# Arguments:
# numerordinatio
# Outputs:
# (empty)
# Returns:
# 0: success; have the tag
# 1: fail; do not have the tag
#######################################
quaero__ix_n1603ia__victionarium_q() {
numerordinatio="$1"

_nomen=$(numerordinatio_neo_separatum "$numerordinatio" "_")

resultatum=$("${ROOTDIR}/999999999/0/1603_1.py" \
--ex-opere-temporibus='cdn' \
--quaero-ix_n1603ia='{victionarium_q}>1' \
--quaero-numerordinatio="$_nomen")

# echo "resultatum"
# echo "[$resultatum]"

if [ -z "$resultatum" ]; then
return 1
else
return 0
fi
}

#######################################
# Opus temporibus
#
Expand All @@ -2078,7 +2111,7 @@ opus_temporibus_cdn() {
--quaero-ix_n1603ia='({publicum}>=11)' \
--in-ordinem=chaos \
--in-limitem=2 \
> "$opus_temporibus_temporarium"
>"$opus_temporibus_temporarium"

while IFS=$'\t' read -r -a line; do
# echo "${line[0]}"
Expand Down Expand Up @@ -2148,10 +2181,11 @@ temp_save_status() {
#######################################
actiones_completis_publicis() {
numerordinatio="$1"
echo ""

blue=$(tput setaf 4)
normal=$(tput sgr0)
printf "%40s\n" "${blue}${FUNCNAME[0]} [$numerordinatio]${normal}"
printf "\t%40s\n" "${blue}${FUNCNAME[0]} [$numerordinatio]${normal}"

# @TODO: implement the download
# file_download_if_necessary "$DATA_1603_45_31" "1603_45_31" "csv" "tm.hxl.csv" "hxltmcli" "1"
Expand All @@ -2160,10 +2194,17 @@ actiones_completis_publicis() {
# @TODO: implement decent check if need download Wikidata Q again
# now is hardcoded as "1" on last parameter
# file_translate_csv_de_numerordinatio_q "$numerordinatio" "0" "0"
file_translate_csv_de_numerordinatio_q "$numerordinatio" "0" "0" "1"
file_merge_numerordinatio_de_wiki_q "$numerordinatio" "0" "0"
file_convert_tmx_de_numerordinatio11 "$numerordinatio"
file_convert_tbx_de_numerordinatio11 "$numerordinatio"

if [ -z "$(quaero__ix_n1603ia__victionarium_q "$numerordinatio")" ]; then
echo "yay"
file_translate_csv_de_numerordinatio_q "$numerordinatio" "0" "0" "1"
file_merge_numerordinatio_de_wiki_q "$numerordinatio" "0" "0"
file_convert_tmx_de_numerordinatio11 "$numerordinatio"
file_convert_tbx_de_numerordinatio11 "$numerordinatio"
else
echo "noop"
fi

neo_codex_copertae_de_numerordinatio "$numerordinatio" "0" "0"
neo_codex_de_numerordinatio "$numerordinatio" "0" "0"
neo_codex_de_numerordinatio_epub "$numerordinatio" "0" "0"
Expand All @@ -2183,5 +2224,5 @@ deploy_0_9_markdown() {
--status-quo \
--ex-librario="cdn" \
--status-in-markdown \
> "$objectivum_archivum"
>"$objectivum_archivum"
}
5 changes: 4 additions & 1 deletion officinam/999999999/999999_17.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,12 @@ file_convert_numerordinatio_de_hxltm "1603_1_51" "1" "0"
# temp_save_status "1603_45_31"
# actiones_completis_publicis "1603_45_31"
# actiones_completis_publicis "1603_63_101"
# opus_temporibus_cdn
opus_temporibus_cdn
deploy_0_9_markdown

# quaero__ix_n1603ia__victionarium_q "1603_63_101" && echo "1603_63_101"
# quaero__ix_n1603ia__victionarium_q "1603_1_1" && echo "1603_1_1"

# file_download_if_necessary "$DATA_1603_23_36" "1603_23_36" "csv" "tm.hxl.csv" "hxltmcli" "1"
# file_convert_numerordinatio_de_hxltm "1603_23_36" "1" "0"
# file_translate_csv_de_numerordinatio_q "1603_23_36" "0" "0"
Expand Down
Loading

0 comments on commit 94bd04a

Please sign in to comment.