From 2a8cdf0084fdcccf897140c308310ed5bbd0ffb7 Mon Sep 17 00:00:00 2001 From: Cyrille LOUARN Date: Sun, 1 Oct 2023 11:35:20 +0200 Subject: [PATCH] Added check process for block-codes --- CHANGELOG.md | 3 + README.md | 3 +- src/usr/bin/tyto | 4 +- .../program/__pycache__/check.cpython-311.pyc | Bin 7921 -> 10793 bytes .../program/__pycache__/debug.cpython-311.pyc | Bin 3556 -> 3717 bytes .../program/__pycache__/post.cpython-311.pyc | Bin 4739 -> 4874 bytes src/var/lib/tyto/program/check.py | 126 +++++++++++++++--- src/var/lib/tyto/program/debug.py | 2 + src/var/lib/tyto/program/post.py | 15 ++- .../__pycache__/logs_fr.cpython-311.pyc | Bin 2873 -> 2976 bytes src/var/lib/tyto/translations/logs_fr.py | 34 ++--- 11 files changed, 148 insertions(+), 39 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0966d9d..705e5f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ Tyto - Littérateur # CURRENTLY IN DEV ! +## [1.9.14] +- added 'check' process on block-codes + ## [1.9.13] - Check: One-Line needed tags, titles - Added first stats diff --git a/README.md b/README.md index 3ce4399..0f3e456 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ tyto ``` ## ToDo next (working on) -- check action +- 'check' action processes - create template post database +- Translate logs in english ! diff --git a/src/usr/bin/tyto b/src/usr/bin/tyto index a98a94f..471be4d 100755 --- a/src/usr/bin/tyto +++ b/src/usr/bin/tyto @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Version: 1.9.13 -# Updated: 2023-10-01 1696117427 +# Version: 1.9.14 +# Updated: 2023-10-01 1696152727 # Tyto - Littérateur # Copyright (C) 2023 Cyrille Louarn diff --git a/src/var/lib/tyto/program/__pycache__/check.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/check.cpython-311.pyc index e6c3a419faa01c95186ab2c4bb3fb6308d9544cc..40f97f221db71f454bec5fc3a17d91d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D1>3t zw{il-vkgj*?D9iS%y2ZDF8ktWY5?;m3R|2m;1JlBIA{=@8pb;N5Nz9W3?|dMh&$;S zPnT;01Te#`>|0Mis)~YX@BmH2OncnAj3?Qsw-FuO4&U2!1+zkN4ZxDpLnoQScnx#y zVA#n}$*_yT2hb62hL^zvTT0!=Vhpe8n~D=9Oix?BuRMKLcN(>4!}UI%PBo~glzv>{ z9rX})v86SFj;vg^6MRO6UhuJ^XB>@nCL|by(q6m{j$x+EJj*`c0?6Trs#c>%UP-e+94B3aG8X6;Uput*F5L#cKLg-x97? SP+5U1BIrTx0{1`c8~p|r)(T4i diff --git a/src/var/lib/tyto/program/__pycache__/debug.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/debug.cpython-311.pyc index 7dc85df20b1c471bc0e4ab4093c5925dc938748e..c29d6debbb44a456ec90e2002c19cbbb4ff9300f 100644 GIT binary patch delta 1006 zcmZwFJ8u&~5CGs^>^ol^U(7o=_SyHaW5te>I1pY5Av^+vM*$HM1(HF!Lm2YX#Wd(5 z7l3F2QnY0R9Uw%7Xejs@R1}DUhHeUI5Jh&*@|+7+n$hmJJKE9R{>(lz^mn?RWO96& z%y^%-^aj8EaoJROQM^4*gf5DqdW(P_klL4-pD7Gw~H2yDnA$X=#7$tC^hA>8uhjD}n0t@O0?MadX97Z|P z15*gc3G#3P;Us|#(+D#J7MwzuB{1PM!W<`Y;0#AP8&W&`@dY>++WF|11@j?Y=%tGx zUFxNUkS<4*hbtk4-|TASLvStf7>o7)xy4ybd`~^8-jL7HuVEU&gfH|x^Y7u@mFcfG av%Km)TJmQ7`(jf+X5Hjm2loFQmhAv0u>t-7 delta 875 zcmZwFO;6N77zgkfVcJ^guHp+UyWO_iRA83{NmP76RD3@uF?tuxE(ZZkR=AbyN#j9G z%p8f{j4>uA#_!?Dn->p$fX75Ho}B-zK5%f7{xi>Sp2;-rJPE&-gSSE83p1X*A8D_? z4DQOIk881#CH+FBdP@z;x?YmQiy3+_w0t8si|aRf6*4bu%T^km#Or}by&mELgMazcM~e}4Mmtw{f# zX`3<6<7K_RZ3s%AVK1_!Uy7Bu6Nx2O+rtkD)?)0X{>S1^|N$F$I7ELqtWu zK8Bd~1BNVgac)QlAP2c6p+kVfLb<&ciD?)x!jMo2Fv?J)GN8hcQV6IrgcJc{h8iVV z*GP>er4%hkg!2BKI|dMlan_V30Ck2cH2{+g2{i#z3=vHOj_!gPK=&9+m5xJBFw|%k zaFQXRQ-IS9F`WU-F{E@BFwYRtIly_zlF$VSTCjA>{`iD0TD!En?XsmSJ5;5smags4 zC|$Q?KTx0O8~Alc=fTs)OhKw>P);sI{@$p6|4DvoM?7mNFpm I|Fqlw01Oc04FCWD diff --git a/src/var/lib/tyto/program/__pycache__/post.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/post.cpython-311.pyc index 40534a48e9a83be9167ea56645fc69fa4abc5eaa..44dee06b22bd302223d85cb6a40cecd419334241 100644 GIT binary patch delta 313 zcmZox?NZ}i&dbZi00b&}lBpXf@=7vpo2XvsmBJS#oWdU^k|Gc#nkt&YAPG_e1}TD> zj8S4KLQ&!=!YLvtqA6l2;weINSfeCT7@{PBSPF=xfmkMmF_=M9V&gdueyQr}DyG_6 zO{OZQ=;$h@*jNxtL!*jGQ*-hq{zHtilcx$~iL)go=cl9=-(o8)%`XAb1&Kw8>BW=( z30PS37ndZK6vvlTmgL7L=jRsRf(m4mpywRuGaD;1X+KyTK_6B|flCwh*$E5f*9Szab2 H1)2f?nEzOy delta 193 zcmeBDYgXl5&dbZi00cgpBvN@M@=7u;ny6lAmnxLPAPEu%gA~3@#wg(w{wR?YffT_M zp%md1kre(ptWlyV3{hf0ES|y`%%Cay5~SKMnQ`(5Hj$10-tbN45ZK2kG5NSa)?`mX zb7{WflEjkY_~iWD+|<01;#)ireo1CY&g9*KGF;(6-Hbq7%rg0*;39Tjkp|`)oKll} agd`_#6S5Ez5^mtTAt== 6: post.error = \ debug.out(52, "%s) %s..."%(ln, line[0:10]), post.uri, True, 1, False) return False + # Count Tyto Comments + elif line.startswith("#"): + post.stats_tyto_coms += 1 + + # Count HTML comments elif line.startswith(post.text_comments): - post.stats_comments += 1 + post.stats_html_coms += 1 return True diff --git a/src/var/lib/tyto/program/debug.py b/src/var/lib/tyto/program/debug.py index c0e801a..f24adca 100644 --- a/src/var/lib/tyto/program/debug.py +++ b/src/var/lib/tyto/program/debug.py @@ -91,6 +91,8 @@ def out(nbr, var, val, show, color, stop): 50 : langs.logs.err_date, 51 : langs.logs.err_post_data, 52 : langs.logs.err_post_title, + 53 : langs.logs.err_post_paired, + 54 : langs.logs.err_post_indent, # WARNINGS (100-200) 100 : langs.logs.warn_no_dom, 101 : langs.logs.domain_created, diff --git a/src/var/lib/tyto/program/post.py b/src/var/lib/tyto/program/post.py index 12cf0a4..80a31ab 100644 --- a/src/var/lib/tyto/program/post.py +++ b/src/var/lib/tyto/program/post.py @@ -163,7 +163,9 @@ def cf_valid(): nositemap = "! NoSitemap" # Article will not be included in sitemap # One Line needed -sep = "-----" # Splitter between header and article +sep = "-----" # Splitter between header and article + +# Will replace "Fals" with title value title = ("title:", False) about = ("about:", False) date = ("date:", False) @@ -173,6 +175,11 @@ author = ("author:", False) # text_contents # ============= +# Start lines tags +bcodes = ("{{", "}}") +quotes = ("[[", "]]") +parags = ("((", "))") + # Comments text_comments = (";;", "" } @@ -189,5 +196,7 @@ html_titles = { # Statistics # ========== -stats_comments = 0 -stats_titles = 0 +stats_tyto_coms = 0 +stats_html_coms = 0 +stats_titles = 0 +stats_bcodes = 0 diff --git a/src/var/lib/tyto/translations/__pycache__/logs_fr.cpython-311.pyc b/src/var/lib/tyto/translations/__pycache__/logs_fr.cpython-311.pyc index 056216d2557699ef5626b11a955bdb77a9651eeb..666ce3aaaa6f3c7704429d88f6b494c0f334a814 100644 GIT binary patch delta 268 zcmdlfwm_V3IWI340}$*nl1yb5n8+u=xND+%6Q_KXe2PMpLJG&kO&UB=+9}#mIw?BA z44S$d@5wUh`X&|?mZp{#6)WWB=P4u>BxV*JURhi!3^d0lGd(XAES#B_lA2d?c;)7= zOkY?SbvM6aw`Nr2Pc15nFUT)0i3e#)O}T{-fT-WB!YRtgWdbyb5r~U_Om^mSjucjF zV80=x)4*{1L088o#wK9gnI zY{vYKg;9I6Du*@W<|a-NMlK_uPDUUuem8jmm$Sc+Y6JTXLG1>P8-fZTLI*@>g2YrC txIhHk4MF7wZV(Gbs5kK35R`A=1rdB8#XznKh^yGZH`#_efyDr5JOF_oFFF7K diff --git a/src/var/lib/tyto/translations/logs_fr.py b/src/var/lib/tyto/translations/logs_fr.py index f35c43c..d3f7c37 100644 --- a/src/var/lib/tyto/translations/logs_fr.py +++ b/src/var/lib/tyto/translations/logs_fr.py @@ -47,22 +47,24 @@ domain_srv = "URI du serveur" # logs for debug #--------------- # Errors -err_arg = "Argument invalide" -err_hole = "Dossier courant invalide" -err_date = "Date invalide" -err_lang = "Format de langue invalide" -err_dir = "Dossier non compatible" -err_no_dir = "Dossier inexistant" -err_cd = "Dossier non créé" -err_no_file = "Fichier manquant" -err_cr_file = "Fichier non créé" -err_bad_uri = "URI non compatible" -err_post_sep = "Séparateur manquant" -err_post_head = "Entête vide" -err_post_empty = "Article vide" -err_ini_file = "Configuration invalide" -err_post_data = "Donnée manquante" -err_post_title = "Titre invalide" +err_arg = "Argument invalide" +err_hole = "Dossier courant invalide" +err_date = "Date invalide" +err_lang = "Format de langue invalide" +err_dir = "Dossier non compatible" +err_no_dir = "Dossier inexistant" +err_cd = "Dossier non créé" +err_no_file = "Fichier manquant" +err_cr_file = "Fichier non créé" +err_bad_uri = "URI non compatible" +err_post_sep = "Séparateur manquant" +err_post_head = "Entête vide" +err_post_empty = "Article vide" +err_ini_file = "Configuration invalide" +err_post_data = "Donnée manquante" +err_post_title = "Titre invalide" +err_post_paired = "Marqueurs non apairés" +err_post_indent = "Ligne non indentée" # Warnings warn_no_dom = "Domaine non configuré"