diff --git a/officina/999999999/0/L999999999_0.py b/officina/999999999/0/L999999999_0.py index b139e2f..71c3985 100644 --- a/officina/999999999/0/L999999999_0.py +++ b/officina/999999999/0/L999999999_0.py @@ -2535,6 +2535,10 @@ def praeparatio(self, formatum: str): self.caput_hxltm.append(caput_novi) if self.identitas_locali_index < 0: + ōrdinēs = range(self.ordo + 1) + for ordo in reversed(ōrdinēs): + self.praeparatio_identitas_numerodinatio(ordo) + # self.praeparatio_identitas_numerodinatio(0) self.praeparatio_identitas_locali() # if formatum == 'no1': @@ -2629,7 +2633,8 @@ def praeparatio_identitas_locali( linea_novae = [] pcode_completo = linea[pcode_index] if ordo == 0: - linea_novae.append(pcode_completo) # Ex. BR + # linea_novae.append(pcode_completo) # Ex. BR + linea_novae.append(self.unm49) # Ex. 76 ex BR else: # Ex. 31 ad BR31 @@ -2655,14 +2660,22 @@ def praeparatio_identitas_locali( def praeparatio_identitas_numerodinatio( self, ordo: int = None): - """praeparatio_identitas_locali + """praeparatio_identitas_numerodinatio + + Change self.data and self.caput_hxltm + + Args: + ordo (int, optional): _description_. Defaults to None. + """ - raise NotImplementedError - if ordo is None: - ordo = self.ordo + # raise NotImplementedError + hxl_hashtag = '#adm{0}+code+v_numerodinatio'.format(ordo) + # if ordo is None: + # ordo = self.ordo pcode_index = None pcode_hashtag_de_facto = '' if ordo == 0: + hxl_hashtag = '#country+code+v_numerodinatio' pcode_hashtag = [ '#country+code+v_pcode', '#country+code+v_iso2', '#country+code+v_iso3166p1a2'] @@ -2691,7 +2704,14 @@ def praeparatio_identitas_numerodinatio( linea_novae = [] pcode_completo = linea[pcode_index] if ordo == 0: - linea_novae.append(pcode_completo) # Ex. BR + # raise ValueError(ordo) + _numerordinatio = '{0}:{1}:{2}'.format( + self.numerordinatio_praefixo, + self.unm49, + "0", + ) + # linea_novae.append(pcode_completo) # Ex. 76 for BR + linea_novae.append(_numerordinatio) # Ex. 76 for BR else: # Ex. 31 ad BR31 @@ -2701,7 +2721,15 @@ def praeparatio_identitas_numerodinatio( pcode_numeri = re.sub('[^0-9]', '', pcode_numeri) try: - linea_novae.append(int(pcode_numeri)) + pcode_numeri = int(pcode_numeri) + _numerordinatio = '{0}:{1}:{2}:{3}'.format( + self.numerordinatio_praefixo, + self.unm49, + ordo, + str(pcode_numeri), + ) + + linea_novae.append(_numerordinatio) except ValueError as err: raise ValueError('<{0}:{1}> -> int({2})?? [{3}]'.format( pcode_hashtag_de_facto, @@ -2724,7 +2752,7 @@ def praeparatio_numerordinatio(self): if self.ordo > 0: hashtag_numerordinatio = '#adm{0}+v_numerordinatio'.format( self.ordo) - self.caput_no1.insert(0, hashtag_numerordinatio) + # self.caput_no1.insert(0, hashtag_numerordinatio) self.caput_no1.insert(0, '#item+conceptum+numerordinatio') data_novis = [] @@ -2740,7 +2768,8 @@ def praeparatio_numerordinatio(self): str(self.ordo), _identitas_locali, ) - linea_novae = [_numerordinatio, _numerordinatio] + # linea_novae = [_numerordinatio, _numerordinatio] + linea_novae = [_numerordinatio] linea_novae.extend(linea) data_novis.append(linea_novae) diff --git a/officina/999999999/1603_45_16.sh b/officina/999999999/1603_45_16.sh index b739bd0..08df12a 100755 --- a/officina/999999999/1603_45_16.sh +++ b/officina/999999999/1603_45_16.sh @@ -924,17 +924,17 @@ __temp_preproces_quicktest_1603_16_24() { frictionless validate "${objectivum_archivum_no1}" || true - set -x - "${ROOTDIR}/999999999/0/999999999_7200235.py" \ - --methodus=xlsx_ad_no1bcp47 \ - --numerordinatio-praefixo="$numerordinatio_praefixo" \ - --ordines="$cod_level" \ - --pcode-praefix="$pcode_praefixo" \ - --unm49="$unm49" \ - "$fontem_archivum" >"${objectivum_archivum_no1bcp47}" - set +x + # set -x + # "${ROOTDIR}/999999999/0/999999999_7200235.py" \ + # --methodus=xlsx_ad_no1bcp47 \ + # --numerordinatio-praefixo="$numerordinatio_praefixo" \ + # --ordines="$cod_level" \ + # --pcode-praefix="$pcode_praefixo" \ + # --unm49="$unm49" \ + # "$fontem_archivum" >"${objectivum_archivum_no1bcp47}" + # set +x - frictionless validate "${objectivum_archivum_no1bcp47}" || true + # frictionless validate "${objectivum_archivum_no1bcp47}" || true done } @@ -1021,8 +1021,8 @@ __temp_download_external_cod_data() { # __temp_download_external_cod_data # exit 1 # bootstrap_1603_45_16__all -# bootstrap_1603_45_16__item "1603_45_16_24" "24" "AGO" "AO" "3" "1" "0" -__temp_preproces_quicktest_1603_16_24 +bootstrap_1603_45_16__item "1603_45_16_24" "24" "AGO" "AO" "3" "1" "0" +# __temp_preproces_quicktest_1603_16_24 exit 0 # bootstrap_1603_45_16__all