From 34afac630b62bae7c3e823ecf17076f3022e0a37 Mon Sep 17 00:00:00 2001 From: Cyrille LOUARN Date: Wed, 11 Oct 2023 17:52:15 +0200 Subject: [PATCH] [1.9.22] - new bcodes, icodes process done first in text article --- CHANGELOG.md | 7 + src/usr/bin/tyto | 4 +- .../program/__pycache__/check.cpython-311.pyc | Bin 30358 -> 34603 bytes .../program/__pycache__/debug.cpython-311.pyc | Bin 3846 -> 3905 bytes .../__pycache__/domain.cpython-311.pyc | Bin 24791 -> 24780 bytes .../program/__pycache__/post.cpython-311.pyc | Bin 6072 -> 9259 bytes .../program/__pycache__/tools.cpython-311.pyc | Bin 6311 -> 7063 bytes .../program/__pycache__/tyto.cpython-311.pyc | Bin 1182 -> 1384 bytes .../program/__pycache__/wip.cpython-311.pyc | Bin 0 -> 1399 bytes src/var/lib/tyto/program/check.py | 521 +++++++++++------- src/var/lib/tyto/program/debug.py | 1 + src/var/lib/tyto/program/domain.py | 188 +++---- src/var/lib/tyto/program/post.py | 175 ++++-- src/var/lib/tyto/program/tools.py | 40 +- src/var/lib/tyto/program/tyto.py | 16 +- src/var/lib/tyto/program/wip.py | 76 +++ .../__pycache__/logs_fr.cpython-311.pyc | Bin 3077 -> 3129 bytes src/var/lib/tyto/translations/logs_fr.py | 1 + 18 files changed, 682 insertions(+), 347 deletions(-) create mode 100644 src/var/lib/tyto/program/__pycache__/wip.cpython-311.pyc create mode 100644 src/var/lib/tyto/program/wip.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 84e5828..886fd5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,13 @@ Tyto - Littérateur # CURRENTLY IN DEV ! +## [1.9.22] (Not Yet push) +- new bcode process (html prepared for wip) +- new post database management values +- new icode process (html prepared for wip) +- bcodes and icodes are FIRST processed in text article +- lots more + ## [1.9.21] - new indentation (3 spaces) - added 'raw:' marker diff --git a/src/usr/bin/tyto b/src/usr/bin/tyto index 01f12d5..d5f0e32 100755 --- a/src/usr/bin/tyto +++ b/src/usr/bin/tyto @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Version: 1.9.21 -# Updated: 2023-10-08 1696756865 +# Version: 1.9.22 +# Updated: 2023-10-11 1697039459 # 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 b52b8168337137d9a7595dcbb6b1d5b1106c28b0..20bf5f14402daf1f778b992297f688cdc40dcc85 100644 GIT binary patch literal 34603 zcmd6QYj9IZx|pP+_rta<`TdgL*kBvKc^l)$@H7K>9?LT8D|`&t7#ohnzTVU4_rKX18jVKgsv? zk&gPv79$LE_a51;qkeq-_1As6zgPG9+-5VY;L7|DH6#CSRHgcF_#=L4VmDv^9o*bf z@hVRDF#FpO-eh?-rWIM^86-Kk!aAT@)tI3hoO{!{0DQi0h zQZo~&-Yn*xg^i<$Uc6=szLhofs@}^z1@%p@_2>OiL=j;$j{Y#>MT(mJY%DLROg+X9QQ=E zBUeYg0umsqy*TOdMs*{CFe$*a0L8pf)5yf-3nKzNnot1YMa}2n(Ht5dofz>5Na;FG z$i~u|@rkIGMq^uCv2i3I!Dw&*Zami@fM=64`g1?peQkGyYyGru?%kK~Y~w^o0@n_mneAgYqfo5V;(}?b?eSQEFW1GZ75VA1hWQk+@;t+9 zc#hZJgSx+v>t}Ng$+5ilgvu+|0ySFWwX^xhDp*A*`h z^~$Yw+ZA=-2&7jC=c_druTxGPZl|KO{79u)I#*FTK_%`y?O!3o+mt{-*&dj*SUSoS zc*T*i9uCd_2ykfqM}R~7KLQ*&zk3{b4e(X^foDrl)u4a_vH!W+TvsgMvq~p;p%Cxr zgq)9e1sD`TfQ;DC@VWC*9Y1pV^4TaidD$B^Lc|dAWKr(2FdDTC14{-B+L_Vuk*FRS zHi)#2PK*wDM=o3($9x8e9iMdb0*>k^H|+65ZFI31o}BQGOu*Wq7d#ioN4-%4Mvn-P zj%&(LJY6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/src/var/lib/tyto/program/__pycache__/debug.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/debug.cpython-311.pyc index c751f538f4148c0807124c0372ecdba8c28499f6..c1b80bbb344a1ed6aafdd68007f0c77540df2bd6 100644 GIT binary patch delta 859 zcmZwFJ#5oJ6bJA-VY|lUlF|a9ZQ|H*-GW<6%U3}v<-3J;>`)Mh3^Wqz2Q6tB7*Hmd zU_f3gHb4jo33X**WdZ~v5^ERq76urA`(NNC11I^fyPw|a*}i+=zxCB~r97d>##CIr z_E=Tqo7XEp>~z4%cPDU+h2ahBsl1n~&!=n7ZFQxo$i)Mj-<-Tu*4BHy+WLU_m@2nN zj%*IPzop8ot*+NAH*PLf?pEt*>^<|Abj_H4)?cQdy(f*tvcFpPqxfO+$t#epm*fcB zX+n`Y04_s;wgWtdKH34uFa)FkS%wnj0G$j0?F4igXrOPAx*@x`B&6MdJ;Ls2zDPiM zz+Q%sdH}r)W$FVI7$PbHe1;;G00Bdp!la?4%o0(Al75DMiU9&K(58cceQmHGkTAqF z1Q-#v`|kq|0!A4k8Ur*AvG{Zta)cqIqkv-!B^n1DZ-Wzn2?n1|0wx*CbP8}iM$|Aa8XsSgenl^N?MIl`>G}BJAhD4ISQ-vV>;^lD0y)^fib#L=O zw+Sor{d)RK-5B~FZ6yS$XXCeGPz04FVdp->`)@cz!iKoJ6orIkw63K3vILYdmB zm8iT{ELDXVQ9l9S0HjV#EDYJ6g@H<_z5k^=$-qhe>+a|0biVU_^;doOlj}M{w_nq0 zzOvyymz!Uf|5(o4=w@nLzVCVSDEW|iX+fT{0GlC4 zM*t4PFm(aC85FqykD)+4fTIkGjscDvXkgtuoq+UmNkAt7eZtDNK15MJV1OZ@LBJ40 zNW*{}LqvIi&yc4AKrw_A#0@PWOGFV$Mi@q@2oQ)<9eNsYrUPO?iJ?ekz*%A0|28lV zm|%!#6401p@#!37njxU`fC~%-ngLwwfC`|>;L{~QjUlAVfGd(EpsNye&CpZx;}u;u zcB5Su(M?0Q+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qt{vy_myZTtoY$Ct>gGuK|D$j2O~bSx)fJfH az5O87a-<^n54=_#RFOY&^o+dstL1kq`#z%p 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 f314b29dff96a4f0f7e36175d1b4cafb4a975892..c310828b802ce7c0b73f278e8ed7a5d79be096e5 100644 GIT binary patch delta 4248 zcmbVPU2GHC6~6Q1@n0PO+rbIJ`HzA8?uPIa0wIt>*#a%J=}v_#<2xpSBxdhS2%Amn zfsNX*-R%YjL{{2Gd1xsVtyU^8+m}|n^r=$q)~c+LBB551+Ly`|OO-}_=(*$AaT3~x zy_5U-oO91P_uRSno-_HfG zs*%D{t+dOKydibr>K$|uMgy*92TGN(J2ws1Zg2@+d=u{ydvI9XhwH>%Trcj&4dMaZ zC?3R3xEZ(LRvf{NpPIx&c(>Sx_lSq_Ua?==kI{w~+?HU)BOoga0{66o@F?yO2XLo& z40nlxm^qIk-G8TXof(QV#rWXY0-b~Y^47C2m~S!+^K6a%3&SdH+C#32WsvrQ5Ah6A zx{CaN_+!it?TG0&b>?^?I+l!K-2w!TDKS}h#FOLKVniyinpHS%YXaw8(B<>muyE6M zFS&F*V{Ok`+qJ(6PikKYh_~N7Fn2&bu*}(S9-KR<9$e;JH;>F6QIF)FeP+&c6%Evy z#vCS%&pxsLi)Ef@3za_zc7x~%BF*qa8Y%2DKx3U^BNfK!x{8el!dT~BAReF@mNaNH z&id{dG{Zb%5qb)}(9WX<#GtnkeP=hgx6u@%6o=qs2zO?Pw1QED zBZuHew_TQ$OUdMz6r0dFpd*}amZi8dngsr;^sa7RAC+mS;V>+inhEfJL7RL7n2(^# zZ_yK`qMYE!BbKjT_6HwaynAt}_wiuH-D3-$B?1=$M@-w)NIhin7)C^W#J=L|a_aB&cqnh7Z56+UEO{s%}Y zJ4cwoEao1;@KdT{v>3BRgWsmXZqYDdVT%uLi-y_INR>~+Z&HDzv27aD7LDzJ2wOBD z?Q99eT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|X6YMG;z{S2)K8wl2+ip7Pgw0&{?6f+H2Ru){VWja&iVXlB$~IZL(n??4L1cBv-qN5O`3F67<|K3#h#)T)jbzR+UVy;JF3U1@K38o6=> je(`$R+YD^pf@}d*$Xhsu&2xyU%==ngyjnpYV^{tQ#2XRo delta 1260 zcmb7?%WoS+9LM+VUB}+Flhk(X#98m!O@RIB+R58%PzE3$y$E%IW^hORF2=z^5UDrjSDF^!wsbaHB-P_Y?s?2cKJ4kF%J)w1DwU2> z!M7s!lU~hDSqW~`?B2SV+O6D8_^xJ{d(+AjxFOE?d|k&61vYgCDJ)2 zg&qR$Xh^5QI?;X;h!t-B9x-k+_;kYP2Nt+5Ifi*awAUP;AvtTgl7^0Fyy?% zY9LO}o}0cH2uqf`6!5hRZxGaKWzl(o%pLHHwin3trFZAUyu7)*{;##U8CuR6GVbZu zkim`ltJcagII|@2F_Am>3Zc*ZAu(F=)5eX)XSF+xUA5FvOa8;<~+MT$9!D#dFQm+OoP zD0GTh{B!;td}+9Zw}*c)m9?h3?AfcF(9K=hWq6*~~Eh31AA2w-_OzNVv5=S^CB zg$|L{Eyr4PgP3D&&exl3p1tO|LEN*idBj~^wb$^k`ruJ#l2#l%?!V-z)h2AL*k_y% zNS6L??h_V&UKpP#{K))|w<|G9)EB$GC06S)`*;iMhOUWhvCHfui*Fi(N^hSZdq{!5 zG4fGr^-x6dPe%DzS7qW^Um=r5lRi(ooG(69vJ?Zp@DFmn^jOZ|ljgQch9ru9jC9Fi TKaO`yQ_GkM!H>}=y!pQYT9G>C diff --git a/src/var/lib/tyto/program/__pycache__/tools.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/tools.cpython-311.pyc index 7e2b40bd97b574b3dc86a80d420690167c1996bd..6db0642a4bf573b5f67f867a042287699c7f1e2f 100644 GIT binary patch delta 1701 zcmah}U1$_n6rR7G-I@J0e;Z?si^PPpA~#wqV8WX740fGrJSco%mC2 zvx*O?h&EiPc`8zUEa&OLuO z2Ci;T-AE>F1=o{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%oM>bAb-~7@HOiCi~Og#f&QEJJUj2zya&m3^Z8XfJ-$QfToX}C~_dc2wkaFWPQq#lGP#uE4_m=#HDa_ z$=E-M?Wy=|)^p#6b4a9W;O~j^*~y`YcQA3<`ex3I*@4cCMyEVAoTeEGN zhJs`L(J|T|FV!4YH%pz@M|}5{8H4zd5fVT~iH z${z35KDU`dAvPxsYdyEU{h_99+3s=rsnM&WyL(4Mwe@RG=K4b=C7vL6MGw*svc!K#zckZt2h` z)?ET;5MC&sUZNO{K~m^MCQFs}f6pJu0>$H}q~kF9*f`k(#F|pkbbs#`v-a_gCvy+y zo{g2?8%!G&DW_!4{asvEtJ%S&6^35?J5UI8pw0`dfQ`5OyA-}`j#O{0nqFKSTtUa> z@{T#{>mCwu{$_&nC|l;i$kk}mv4qu$4xSI+z>A~_NimvrZKvS*7aydz(ju}3vhKBMnhZJ*k7yy;xJ7KN-Qu9J*{G;-pUnS~O>nqA1)bVf4 N8#Riq#wr3b@-J?j^JV}5 diff --git a/src/var/lib/tyto/program/__pycache__/tyto.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/tyto.cpython-311.pyc index e930bb74518f093040085057fe0b7e0796bf1685..5f6e52d5a6d45a99720cfbe551e3bc744ea9a009 100644 GIT binary patch delta 407 zcmbQo`GSjYIWI340}$kusH7_MOyrYboHJ2QfoxWSnFnH)Bo?KomOz9PbD)fp%#xf`u$Udl zrbN3cQyU`mV`$TqxW$^5UzA&Xi+%HYCN4%TE|5Rt!G62N31;U2-F%BHGdD3kH6F;$ zzQvXZrY9d}Hsmq@1}-BI7q6N8k9m?36CZa2*9Q(}Uf~AL4_pj2Njdq+*~$4SsY-TSHXs_8Tz(D?8P#Gg8~ywopmu$beh>|`!cJ547He95QEu@q z_Qd3p%=|ncqa<;10P}w?PM~~z5=imnN)|&dU7&jzfw*|aQEMAV5Z=ALJ6Tc`OO{$kYE(?@7StFChd2+Z2?>-^QgESdUPM}B>y%XTNvG^> z+C-d+3N6S%A$chH+BEbYT(`w9p>GNO5xSxWv0w<4K=URreepx->{)ls5$JF`J3BMq z%dPtrsrw6h*FW(0u9tFPjE}23?!T(Y;#`Nfgc;8T@d$zWf(8&>nLm{Fr&J6 z>tbz57O@l!eIxyM0@tKA+!vfDHi<<#xc{4lA7BkzLHGCM8#=77nfQ%##L&z^cv&QYV&5JO4nJHE6gx-lSi&s*;>Ukx!f{L#?_6Ap;b*z z^lFpOm~5SyYe%Xzz19SSs+)|~T3lwgnZcvN+q3YPCwjgGl`BWyvCmjTpCBc@$z`GD zMC6mMRZP*Ka~>U@EPcLCOL}diBm$RO)VNO98>KI5tzzpoSG>412mYsFnEwFlqES3~ zZ{^O4ExYmjFrM!&kCHRp^ZV(O_7yihKTOY$QA$4Nv9E4*Y47YP8t>h>GuxZppU(6< z_QyY+-Ff?$8#@===`+LWGrjaEntB?I-!<PQ@`D0XZT@_6e0!d9(cdpK`vKW=`%`Ca3OhMQX)<`&)Ki@lj=iB$hn`$H$= zY&aFCvXiwxa1*Dy+9)wQMmTcL(d?X^8!Z%_%g*IT@*{bWTke&6FHJdQ0 literal 0 HcmV?d00001 diff --git a/src/var/lib/tyto/program/check.py b/src/var/lib/tyto/program/check.py index 5c83af6..024986d 100644 --- a/src/var/lib/tyto/program/check.py +++ b/src/var/lib/tyto/program/check.py @@ -32,10 +32,10 @@ # file program : #-------------------------- -import sys, os +import sys, os, re from dateutil.parser import parse -import args, domain, langs, debug, post, tools, tyto +import args, domain, langs, debug, post, tools, tyto, wip #=====================================# @@ -71,14 +71,12 @@ def manage(action, target): # Also used with multiple (loop) # #--------------------------------# def is_article(target): - valid(target) + valid(target) or tools.exit(targets, post.error) # When all is OK # Will create post database, but now, show some values - print("chk_date", chk_date) - print() - print("Final text_contents string") - for ln, line in enumerate(post.text_contents.rsplit("\n"), post.head_lines): + print("Final texts string") + for ln, line in enumerate(texts, post.head_lines + 1): print(">", ln, line) print() @@ -91,38 +89,48 @@ def is_article(target): # In error case, exit or return if targetS # #-------------------------------------------# def valid(target): + global targets targets = args.targets # Target is a tyto article format post.is_article(target) or tools.exit(targets, post.error) + if not post.do_chk: + post.error = debug.out(210, post.chk_date, post.uri, True, 0, False) + return False + + # Reset post database (Old values are prepared) + tools.create_file(post.cf_uri, post.ini_template) + post.cf_load() global css - css = domain.cf.get("WEBSITE", "css") + css = domain.css global headers, texts headers = post.head_contents.rsplit("\n") - texts = post.text_contents.rsplit("\n") - - # ============= - # Head contents - # ============= - - # One Line targs in head_contents - post.error == 0 and ol_tags() or tools.exit(targets, post.error) - #Multiple and optional Tags on 3 linges - post.error == 0 and ml_tags() or tools.exit(targets, post.error) - + texts = post.text_contents.rsplit("\n") + + # ============ + # Text article + # ============ + # Process bcodes and icodes first to protect their contents + post.error == 0 and bcodes() or tools.exit(targets, post.error) + post.error == 0 and icodes() or tools.exit(targets, post.error) + + # ============= + # Head contents + # ============= + # One Line targs in head_contents + post.error == 0 and ol_tags() or tools.exit(targets, post.error) + # Multiple and optional Tags on 3 linges + post.error == 0 and ml_tags() or tools.exit(targets, post.error) + # ============ # Text article # ============ - # Start Lines - # ----------- - # Paired tags. - post.error == 0 and sl_paired("bcodes") or tools.exit(targets, post.error) - post.error == 0 and sl_paired("quotes") or tools.exit(targets, post.error) - post.error == 0 and sl_paired("parags") or tools.exit(targets, post.error) # Single tags - post.error == 0 and titles() or tools.exit(targets, post.error) + post.error == 0 and sl_tags() or tools.exit(targets, post.error) + + return True #===========================================# @@ -144,14 +152,23 @@ def ol_tags(): sitemap = "True" for ln, line in enumerate(headers, 1): - if not line or line.isspace(): continue + # Optional one line markers if line.startswith("#"): post.stats_tyto_head_coms += 1 - continue + elif line.startswith(post.nositemap): + sitemap = "False" + elif line.startswith(post.logo[0]): + if not post.logo[1]: + post.logo = (post.logo[0], ol_tag_value(line, False)) + logo_ln = ln + if is_value2_file_exists(logo_ln, "logo:", post.logo[1]): + src_uri = "%s%s"%(domain.www_url, src_uri) + else: + return False # One Line tags (Must be set) # =========================== - if not post.title[1] and line.startswith(post.title[0]): + elif not post.title[1] and line.startswith(post.title[0]): post.title = (post.title[0], ol_tag_value(line, False)) elif not post.about[1] and line.startswith(post.about[0]): @@ -166,17 +183,7 @@ def ol_tags(): elif not post.tags[1] and line.startswith(post.tags[0]): post.tags = (post.tags[0], ol_tag_value(line, True)) - - # Optional tags - # ------------- - elif not post.logo[1] and line.startswith(post.logo[0]): - post.logo = (post.logo[0], ol_tag_value(line, False)) - logo_ln = ln - - elif line.startswith(post.nositemap): - sitemap = "False" - - + # Sets are done from loop # Check if tag value exists # ========================= @@ -188,14 +195,10 @@ def ol_tags(): if not is_ol_tag(post.tags[0], post.tags[1]): return False # Default domain logo for this post - src_uri = "%stemplate/%s"%(domain.www_url, domain.logo) - # logo is set with specific uri - if is_value2_file_exists(logo_ln, "logo:", post.logo[1]): - src_uri = "%s%s"%(domain.www_url, src_uri) - else: - return False - post.logo = (post.logo[0], src_uri) - post.cf.set("HEADERS", "logo", src_uri) + if not post.logo[1]: + src_uri = "%stemplate/%s"%(domain.www_url, domain.logo) + post.logo = (post.logo[0], src_uri) + post.cf_set("HEADERS", "logo", src_uri) return True @@ -255,8 +258,6 @@ def is_valid_date(date): # Tags are stric start line # #----------------------------# def ml_tags(): - #global value1 - c = 0 # Continue for next x lines, as tags are 3 lines values for ln, line in enumerate(headers): @@ -302,12 +303,12 @@ def ml_tag_values(ln, tag, stats): # value1 must not starts or contains:o elif value1.startswith("_"): - debug.out(56, "%s) '_...'"%(ln+1), post.uri, True, 2, False) + post.error = debug.out(56, "%s) '_...'"%(ln+1), post.uri, True, 2, False) return False # Specific for image: logo name is reserved elif tag == post.ml_tags[1] and value1 == "logo": - debug.out(56, "%s) 'logo'"%(ln+1), post.uri, True, 2, False) + post.error = debug.out(56, "%s) 'logo'"%(ln+1), post.uri, True, 2, False) return False # value2 @@ -350,24 +351,25 @@ def ml_tag_values(ln, tag, stats): if tag == post.ml_tags[0]: section = "LINKS" post.stats_text_links += post.text_contents.count(tyto_value) - html_value = '%s'%( - value2, css, "%%s", value3, value1 + html_value = tyto.a_link%( + value2, "%s link"%css, "%%s", value3, value1 ) # file: elif tag == post.ml_tags[2]: section = "FILES" post.stats_text_files += post.text_contents.count(tyto_value) - html_value = '%s'%( - value2, css, "%%s", value3, value1 + html_value = tyto.a_link%( + value2, "%s file"%css, "%%s", value3, value1 ) # image: elif tag == post.ml_tags[1]: section = "IMAGES" post.stats_text_images += post.text_contents.count(tyto_value) - html_value = '%s'%( - value2, "%%s", "%%s", value3, "%%s" + html_value = tyto.image_link%( + value2, "%%s image", "%%s", + value3, value3, "%%s" ) # raw: (content file converted to base64) @@ -386,18 +388,15 @@ def ml_tag_values(ln, tag, stats): post.stats_text_codes += post.text_contents.count(tyto_value) htmlbcode = ""%value3 with open(value2_uri, "r") as f: - for line in f.read().rsplit("\n"): + for ln, line in enumerate(f.read().rsplit("\n"), 1): line = tools.convert_html_signs(line) - line = '
  • %s
  • '%(domain.css, line) + line = tyto.code_line%(ln, line) htmlbcode = "%s\n%s"%(htmlbcode, line) - html_value = tyto.pre_bcode%( - domain.css, domain.css, domain.css, - htmlbcode - ) - print() - print(html_value) - print() + html_value = tyto.code_bcode%(css, htmlbcode) + #print() + #print(html_value) + #print() html_value = tools.b64_convert("encode", html_value) # abbr: @@ -405,11 +404,11 @@ def ml_tag_values(ln, tag, stats): section = "ABBRS" post.stats_text_abbrs += post.text_contents.count(tyto_value) html_value = '%s'%( - domain.css, value2, value3 + css, value2, value3 ) - post.cf.set(section, link_var, tyto_value) - post.cf.set(section, html_var, html_value) + post.cf_set(section, link_var, tyto_value) + post.cf_set(section, html_var, html_value) return True @@ -458,7 +457,7 @@ def is_value2_file_exists(ln, tag, val2): # Add file to [SOURCE_FILES] post database post.stats_total_files += 1 - post.cf.set("SOURCE_FILES", "file_%s"%post.stats_total_files, src_uri) + post.cf_set("SOURCE_FILES", "file_%s"%post.stats_total_files, src_uri) return True @@ -466,99 +465,181 @@ def is_value2_file_exists(ln, tag, val2): #=====================# # check text contents #======================================================== #=====================# -#========================================# -# First process ! # -# Used for bvodes, quotes, parags # -# Check if opened and closed tags match # -# Check if contents in tags are indented # -# Count tags for stats # -# Remove bcodes, quotes lines # -# - Create new post.text_contents # -# Return True/False # -#----------------------------------------# -def sl_paired(markers): +#=======================================# +# bcodes: first process ! # +# Check if opened and closed tags match # +# Count bcodes for stats # +# Remove bcodes lines # +# - Create new post "texts" contents # +# Return True/False # +#---------------------------------------# +def bcodes(): global texts + + markers = post.bcodes + index0 = index1 = -1 - new_text_contents = "" - opened = closed = in_tag = False - stats_opened = stats_closed = 0 - tags = () - - if markers == "bcodes" : tags = post.bcodes - elif markers == "quotes" : tags = post.quotes - elif markers == "parags" : tags = post.parags - - # loop lines in text_contents for ln, line in enumerate(texts, post.head_lines + 1): - - # Tag was closed, but not in_tag content line - if closed and in_tag: - in_tag = False - - # Tag is opened - if line.startswith(tags[0]): - # Tag was already opened - if opened: - post.error = \ - debug.out(53, "%s) %s ... %s"%( - ln+1, - tags[0], tags[1] - ), post.uri, True, 2, False) - return False - - # check next line if exists or is a closed tag - try: - next_line = post.contents.rsplit("\n")[ln] - if next_line.startswith(tags[1]): + if index0 >= 0 : + #print(">>>", ln, line) + bcode = "%s\n%s"%(bcode, line) + texts[ln - 1 - post.head_lines] = "" + + # Opened mark + if line.lstrip().startswith(markers[0]): + # Mark was opened yet + if index0 >= 0: + # at the same position + if line.index(markers[0][0]) == index0: post.error = \ - debug.out(55, "%s) '%s'"%(ln, tags[0]), post.uri, True, 2, False) - return False - except: - post.error = \ - debug.out(55, "%s) '%s'"%(ln, tags[0]), post.uri, True, 2, False) - return False - - opened = in_tag = True - closed = False - stats_opened += 1 - - # Tag is closed - if line.startswith(tags[1]): - # Tag was already closed - if closed: - post.error = \ - debug.out(53, "%s) %s ... %s"%( - ln+1, - tags[0], tags[1] - ), post.uri, True, 2, False) - return False - - closed = True - opened = False - stats_closed += 1 - - - if in_tag: - # Contents must be indented - if not line.startswith(tags): - if len(line) - len(line.lstrip()) < 3: - post.error = \ - debug.out(54, "%s) '\t'%s..."%( - ln+1, line[0:10] + debug.out(53, '%s...%s) "%s"'%( + tag_ln, ln, markers[1] ), post.uri, True, 2, False) return False - line = "" + continue + index0 = line.index(markers[0][0]) + tag_ln = ln + bcode = line + #print(">>>", ln, line) + texts[ln - 1 - post.head_lines] = "" - # Create new string, removing in_tag line if in bcodes or quotes - if markers in post.raw_contents: - if not new_text_contents: new_text_contents = line - else: new_text_contents = "%s\n%s"%(new_text_contents, line) + # Closed mark + if line.lstrip().startswith(markers[1]): + if index0 < 0: + post.error = \ + debug.out(53, '%s) "%s"...'%( + ln, markers[0] + ), post.uri, True, 2, False) + return False + index1 = line.index(markers[1][0]) + # at same position as opened + if index1 == index0: + index0 = index1 = -1 + tag_ln = "" + post.stats_bcodes += 1 + + # create ini values for this bcode + var_name = "bcode_%s"%post.stats_bcodes + val_raws = tools.b64_convert("encode", bcode) + var_html = "html_%s"%post.stats_bcodes + val_html = tools.b64_convert("encode", wip.bcode(bcode)) + post.cf_set("BCODES", var_name, val_raws) + post.cf_set("BCODES", var_html, val_html) + + # bcode not opened, but closed tag found + elif index0 < 0: + tag_ln = ln + + + # Check if markers match + # ---------------------- + if index1 >= 0 and index0 < 0: + post.error = \ + debug.out(53, '%s) "%s"...'%(tag_ln, markers[0]), post.uri, True,2, False) + return False + + if index0 >= 0 and index1 < 0: + post.error = \ + debug.out(53, '%s) ..."%s"'%(tag_ln, markers[1]), post.uri, True,2, False) + return False + + if index0 != index1: + post.error = \ + debug.out(53, '%s) "%s"..."%s"'%( + tag_ln, markers[0], markers[1] + ), post.uri, True,2, False) + return False + return True + + +# +# icodes (SAME LINE) +# Check if opened and closed markers match # +# +def icodes(): + global texts + + markers = post.icodes + for ln, line in enumerate(texts, post.head_lines + 1): + # Search for opened, closed markers + # markers cannot be at same position on line + m0 = line.find(markers[0]) + m1 = line.find(markers[1]) + if m0 == m1: + continue - texts = new_text_contents.rsplit("\n") + # Simple 3 cases errors + # --------------------- + # First marker is a closed one + if m1 < m0: + post.error = \ + debug.out(53, '%s) "%s"..."%s"'%( + ln, markers[1], markers[0] + ), post.uri, True,2, False) + return False + + # First marker but unused closed one + if m0 >= 0 and m1 == -1: + post.error = \ + debug.out(53, '%s) ..."%s"'%( + ln, markers[1] + ), post.uri, True,2, False) + return False + + # Last marker but unused opened one + elif m1 >= 0 and m0 == -1: + post.error = \ + debug.out(53, '%s) "%s"...'%( + ln, markers[0] + ), post.uri, True,2, False) + return False + + if post.words_markers[0][0] in line: + line = line.replace(post.words_markers[0][0], post.words_markers[0][4]) + line = line.replace(post.words_markers[0][1], post.words_markers[0][5]) + icodes = re.findall('%s(.*?)%s'%( + post.words_markers[0][4], post.words_markers[0][5] + ), line) - # Create post.stats - post.cf.set("STATS_TEXTS", markers, str(stats_opened)) + for icode in icodes: + post.stats_text_icodes += 1 + icnew = post.words_markers[0][4] + icode + post.words_markers[0][5] + line = line.replace(icnew, "") + + # Set HTML [ICODES] to post database + icode_var = "icode_%s"%post.stats_text_icodes + icleg = post.words_markers[0][0] + icode + post.words_markers[0][1] + html_var = "html_%s"%post.stats_text_icodes + html_val = icnew.replace(post.words_markers[0][4], + post.words_markers[0][2]%css) + html_val = html_val.replace(post.words_markers[0][5], + post.words_markers[0][3]) + post.cf_set("ICODES", icode_var, icleg) + post.cf_set("ICODES", html_var, html_val) + + line = line.replace(post.words_markers[1][0], post.words_markers[1][4]) + line = line.replace(post.words_markers[1][1], post.words_markers[1][5]) + icodes = re.findall('%s(.*?)%s'%( + post.words_markers[1][4], post.words_markers[1][5] + ), line) + for icode in icodes: + post.stats_text_icodes += 1 + icnew = post.words_markers[1][4] + icode + post.words_markers[1][5] + line = line.replace(icnew, "") + # Set HTML [ICODES] to post database + icode_var = "icode_%s"%post.stats_text_icodes + icleg = post.words_markers[1][0] + icode + post.words_markers[1][1] + html_var = "html_%s"%post.stats_text_icodes + html_val = icnew.replace(post.words_markers[1][4], + post.words_markers[1][2]%css) + html_val = html_val.replace(post.words_markers[1][5], + post.words_markers[1][3]) + post.cf_set("ICODES", icode_var, icleg) + post.cf_set("ICODES", html_var, html_val) + + texts[ln - 1 - post.head_lines] = line + return True @@ -568,7 +649,7 @@ def sl_paired(markers): # Add stat for _image:logo # # Return True/False # #----------------------------# -def titles(): +def sl_tags(): for ln, line in enumerate(texts, post.head_lines + 1): # legacy Tyto Titles if line.startswith(post.tyto_titles): @@ -587,13 +668,13 @@ def titles(): # Create html value for this title in database link_var = "title_%s"%post.stats_titles - post.cf.set("TITLES", link_var, line) + post.cf_set("TITLES", link_var, line) html_var = "html_%s"%post.stats_titles mark = line[0:2] title = line[3:] - html_val = post.html_titles[mark]%(domain.css, title) - post.cf.set("TITLES", html_var, html_val) + html_val = post.html_titles[mark]%(css, title) + post.cf_set("TITLES", html_var, html_val) # Count Tyto Comments elif line.lstrip().startswith("#"): @@ -606,9 +687,9 @@ def titles(): if line.lstrip().startswith(post.text_comments[0]): real_com = line.lstrip()[3:] link_var = "comm_%s"%post.stats_html_coms - post.cf.set("COMMENTS", link_var, line.lstrip()) + post.cf_set("COMMENTS", link_var, line.lstrip()) html_var = "html_%s"%post.stats_html_coms - post.cf.set("COMMENTS", html_var, ''%real_com) + post.cf_set("COMMENTS", html_var, ''%real_com) # Add stat + html for [IMAGES] when user wants to show logo in post @@ -617,12 +698,13 @@ def titles(): link_var = "image_%s"%(post.ml_tags_stats["image:"] + 1) link_val = "_image:logo" html_var = "html_%s"%(post.ml_tags_stats["image:"] + 1) - html_val = '%s'%( - post.logo[1], "%%s", "%%s", post.title[1], "%%s" + html_val = tyto.image_link%( + post.logo[1], "post_logo image", "%%s", + post.title[1], post.title[1], "%%s" ) - post.cf.set("IMAGES", link_var, link_val) - post.cf.set("IMAGES", html_var, html_val) - + post.cf_set("IMAGES", link_var, link_val) + post.cf_set("IMAGES", html_var, html_val) + return True @@ -632,56 +714,79 @@ def titles(): def cf_update_values(): post.date = ("date:", tools.local_date(post.date[1])) - post.cf.set("DOMAIN", "name", domain.name) + post.cf_set("DOMAIN", "name", domain.name) - post.cf.set("FILE", "id", post.uri_id) - post.cf.set("FILE", "uri", post.uri) - post.cf.set("FILE", "db", post.cf_uri) - post.cf.set("FILE", "target", post.wrk_target) + # [FILE] + post.cf_set("FILE", "id", post.uri_id) + post.cf_set("FILE", "uri", post.uri) + post.cf_set("FILE", "db", post.cf_uri) + post.cf_set("FILE", "target", post.wrk_target) - post.cf.set("HEADERS", "title", post.title[1]) - post.cf.set("HEADERS", "about", post.about[1]) - post.cf.set("HEADERS", "date", post.date[1]) - post.cf.set("HEADERS", "tags", post.tags[1]) - post.cf.set("HEADERS", "authors", post.author[1]) - post.cf.set("HEADERS", "sitemap", str(sitemap)) + # [HEADERS] + # --------- + post.cf_set("HEADERS", "title", post.title[1]) + post.cf_set("HEADERS", "about", post.about[1]) + post.cf_set("HEADERS", "date", post.date[1]) + post.cf_set("HEADERS", "tags", post.tags[1]) + post.cf_set("HEADERS", "authors", post.author[1]) + post.cf_set("HEADERS", "sitemap", str(sitemap)) - post.cf.set("CHECK", "hash", post.wrk_id) - post.cf.set("CHECK", "date", chk_date) - post.cf.set("CHECK", "static", str(domain.static)) + # [check] + # ------- + post.cf_set("CHECK", "hash", post.wrk_id) + post.cf_set("CHECK", "date", chk_date) + post.cf_set("CHECK", "static", str(domain.static)) + post.cf_set("CHECK", "errors", "False") - post.cf.set("WIP", "web", "%s%s"%(domain.wip_url, post.wrk_target)) - post.cf.set("WIP", "uri", "%s%s"%(domain.wip, post.wrk_target)) + # [WIP] + # ----- + post.cf_set("WIP", "hash", post.wip_hash) + post.cf_set("WIP", "date", post.wip_date) + post.cf_set("WIP", "web", "%s%s"%(domain.wip_url, post.wrk_target)) + post.cf_set("WIP", "uri", "%s%s"%(domain.wip, post.wrk_target)) - post.cf.set("WWW", "web", "%s%s"%(domain.www_url, post.wrk_target)) - post.cf.set("WWW", "uri", "%s%s"%(domain.www, post.wrk_target)) + # [WWW] + # ----- + post.cf_set("WWW", "hash", post.www_hash) + post.cf_set("WWW", "date", post.www_date) + post.cf_set("WWW", "web", "%s%s"%(domain.www_url, post.wrk_target)) + post.cf_set("WWW", "uri", "%s%s"%(domain.www, post.wrk_target)) + # [STATS_FILE] + # ------------ stats_tyto_all_coms = post.stats_tyto_text_coms + post.stats_tyto_head_coms - post.cf.set("STATS_FILE", "lines", str(post.lines)) - post.cf.set("STATS_FILE", "tyto_coms", str(stats_tyto_all_coms)) - post.cf.set("STATS_FILE", "files", str(post.stats_total_files)) + post.cf_set("STATS_FILE", "lines", str(post.lines)) + post.cf_set("STATS_FILE", "tyto_coms", str(stats_tyto_all_coms)) + post.cf_set("STATS_FILE", "files", str(post.stats_total_files)) - post.cf.set("STATS_HEADERS", "lines", str(post.head_lines)) - post.cf.set("STATS_HEADERS", "tyto_coms", str(post.stats_tyto_head_coms)) - post.cf.set("STATS_HEADERS", "links", str(post.ml_tags_stats["link:"])) - post.cf.set("STATS_HEADERS", "files", str(post.ml_tags_stats["file:"])) - post.cf.set("STATS_HEADERS", "images", str(post.ml_tags_stats["image:"])) - post.cf.set("STATS_HEADERS", "abbrs", str(post.ml_tags_stats["abbr:"])) - post.cf.set("STATS_HEADERS", "codes", str(post.ml_tags_stats["code:"])) - post.cf.set("STATS_HEADERS", "raws", str(post.ml_tags_stats["raw:"])) + # [STATS_HEADERS] + # --------------- + post.cf_set("STATS_HEADERS", "lines", str(post.head_lines)) + post.cf_set("STATS_HEADERS", "tyto_coms", str(post.stats_tyto_head_coms)) + post.cf_set("STATS_HEADERS", "links", str(post.ml_tags_stats["link:"])) + post.cf_set("STATS_HEADERS", "files", str(post.ml_tags_stats["file:"])) + post.cf_set("STATS_HEADERS", "images", str(post.ml_tags_stats["image:"])) + post.cf_set("STATS_HEADERS", "abbrs", str(post.ml_tags_stats["abbr:"])) + post.cf_set("STATS_HEADERS", "codes", str(post.ml_tags_stats["code:"])) + post.cf_set("STATS_HEADERS", "raws", str(post.ml_tags_stats["raw:"])) - post.cf.set("STATS_TEXTS", "lines", str(post.text_lines)) - post.cf.set("STATS_TEXTS", "tyto_coms", str(post.stats_tyto_text_coms)) - post.cf.set("STATS_TEXTS", "html_coms", str(post.stats_html_coms)) - post.cf.set("STATS_TEXTS", "titles", str(post.stats_titles)) - post.cf.set("STATS_TEXTS", "links", str(post.stats_text_links)) - post.cf.set("STATS_TEXTS", "files", str(post.stats_text_files)) - post.cf.set("STATS_TEXTS", "images", str(post.stats_text_images)) - post.cf.set("STATS_TEXTS", "abbrs", str(post.stats_text_abbrs)) - post.cf.set("STATS_TEXTS", "codes", str(post.stats_text_codes)) - post.cf.set("STATS_TEXTS", "raws", str(post.stats_text_raws)) + # [STATS_TEXTS] + # ------------- + post.cf_set("STATS_TEXTS", "lines", str(post.text_lines)) + post.cf_set("STATS_TEXTS", "tyto_coms", str(post.stats_tyto_text_coms)) + post.cf_set("STATS_TEXTS", "html_coms", str(post.stats_html_coms)) + post.cf_set("STATS_TEXTS", "titles", str(post.stats_titles)) + post.cf_set("STATS_TEXTS", "bcodes", str(post.stats_bcodes)) + post.cf_set("STATS_TEXTS", "bcodes_lines", str(post.stats_bcodes_lines)) + # Founds from header tags + post.cf_set("STATS_TEXTS", "links", str(post.stats_text_links)) + post.cf_set("STATS_TEXTS", "files", str(post.stats_text_files)) + post.cf_set("STATS_TEXTS", "images", str(post.stats_text_images)) + post.cf_set("STATS_TEXTS", "abbrs", str(post.stats_text_abbrs)) + post.cf_set("STATS_TEXTS", "icodes", str(post.stats_text_icodes)) + post.cf_set("STATS_TEXTS", "codes", str(post.stats_text_codes)) + post.cf_set("STATS_TEXTS", "raws", str(post.stats_text_raws)) - with open(post.cf_uri, "w") as f: - post.cf.write(f) - - + # Write new values in database + post.cf_write() + diff --git a/src/var/lib/tyto/program/debug.py b/src/var/lib/tyto/program/debug.py index 4aaf6d0..79af455 100644 --- a/src/var/lib/tyto/program/debug.py +++ b/src/var/lib/tyto/program/debug.py @@ -113,6 +113,7 @@ def out(nbr, var, val, show, color, stop): 207 : langs.logs.updated_file, 208 : langs.logs.website_lang, 209 : langs.logs.domain_on, + 210 : langs.logs.post_chk_yet, 255 : langs.logs.later, } diff --git a/src/var/lib/tyto/program/domain.py b/src/var/lib/tyto/program/domain.py index f7c98cb..cfc8333 100644 --- a/src/var/lib/tyto/program/domain.py +++ b/src/var/lib/tyto/program/domain.py @@ -178,7 +178,7 @@ def cf_create(): # Create section, set key if not exists # # Ask yser when default is a key form and not value # #---------------------------------------------------# -def cf_set_value(section, key, default): +def cf_set(section, key, default): global new_val try: new_val except: new_val = False @@ -223,270 +223,270 @@ def cf_update_values(write): # ======== global activated, title, date, about, mail, tags, license, license_url try: activated = cf.getboolean("DOMAIN", "activated") - except: activated = cf_set_value("DOMAIN", "activated", "no") + except: activated = cf_set("DOMAIN", "activated", "no") - cf_set_value("DOMAIN", "name", name) + cf_set("DOMAIN", "name", name) - title = cf_set_value("DOMAIN", "title", "title") - date = cf_set_value("DOMAIN", "date", "date") - about = cf_set_value("DOMAIN", "about", "about") - mail = cf_set_value("DOMAIN", "mail", "mail") - tags = cf_set_value("DOMAIN", "tags", "tags") - license = cf_set_value("DOMAIN", "lincese", "") + title = cf_set("DOMAIN", "title", "title") + date = cf_set("DOMAIN", "date", "date") + about = cf_set("DOMAIN", "about", "about") + mail = cf_set("DOMAIN", "mail", "mail") + tags = cf_set("DOMAIN", "tags", "tags") + license = cf_set("DOMAIN", "lincese", "") if not license: - license = cf_set_value("DOMAIN", "lincese", "gfdl-1.3") - license_url = cf_set_value("DOMAIN", "lincese_url", + license = cf_set("DOMAIN", "lincese", "gfdl-1.3") + license_url = cf_set("DOMAIN", "lincese_url", "https://www.gnu.org/licenses/fdl-1.3.txt") elif not license == "gfdl-1.3": - license_url = cf_set_value("DOMAIN", "lincese_url","") + license_url = cf_set("DOMAIN", "lincese_url","") # Optional global legals_url, terms_url, statuses_url - legals_url = cf_set_value("DOMAIN", "legals_url", "") - terms_url = cf_set_value("DOMAIN", "terms_url", "") - statuses_url = cf_set_value("DOMAIN", "statuses_url", "") + legals_url = cf_set("DOMAIN", "legals_url", "") + terms_url = cf_set("DOMAIN", "terms_url", "") + statuses_url = cf_set("DOMAIN", "statuses_url", "") # [SERVER] # ======== global srv, srv_name, wip, www - srv = cf_set_value("SERVER", "root", "server") + srv = cf_set("SERVER", "root", "server") if not tools.dir_exists(srv, False): - srv = cf_set_value("SERVER", "root", "server") + srv = cf_set("SERVER", "root", "server") srv_name = os.path.join(srv, name + "/") - cf_set_value("SERVER", "domain", srv_name) + cf_set("SERVER", "domain", srv_name) wip = os.path.join(srv_name, "wip/") - cf_set_value("SERVER", "wip", wip) + cf_set("SERVER", "wip", wip) www = os.path.join(srv_name, "www/") - cf_set_value("SERVER", "www", www) + cf_set("SERVER", "www", www) # [WIP_DIRS] # ========== global wip_tpl, wip_images, wip_files wip_tpl = os.path.join(wip, "template/") - cf_set_value("WIP_DIRS", "template", wip_tpl) + cf_set("WIP_DIRS", "template", wip_tpl) wip_images = os.path.join(wip, "images/") - cf_set_value("WIP_DIRS", "images", wip_images) + cf_set("WIP_DIRS", "images", wip_images) wip_files = os.path.join(wip, "files/") - cf_set_value("WIP_DIRS", "files", wip_files) + cf_set("WIP_DIRS", "files", wip_files) # [WWW_DIRS] # ========== global www_tpl, www_images, www_files www_tpl = os.path.join(www, "template/") - cf_set_value("WWW_DIRS", "template", www_tpl) + cf_set("WWW_DIRS", "template", www_tpl) www_images = os.path.join(www, "images/") - cf_set_value("WWW_DIRS", "images", www_images) + cf_set("WWW_DIRS", "images", www_images) www_files = os.path.join(www, "files/") - cf_set_value("WWW_DIRS", "files", www_files) + cf_set("WWW_DIRS", "files", www_files) # [WEBSITE] # ========= global wip_url, www_url, lang, css, sep, article_code, static - wip_url = cf_set_value("WEBSITE", "wip_url", "") + wip_url = cf_set("WEBSITE", "wip_url", "") if not wip_url: - wip_url = cf_set_value("WEBSITE", "wip_url", create_wip_url()) + wip_url = cf_set("WEBSITE", "wip_url", create_wip_url()) - www_url = cf_set_value("WEBSITE", "www_url", "") + www_url = cf_set("WEBSITE", "www_url", "") if not www_url: - www_url = cf_set_value("WEBSITE", "www_url", "https://%s/"%name) + www_url = cf_set("WEBSITE", "www_url", "https://%s/"%name) - lang = cf_set_value("WEBSITE", "lang", "") + lang = cf_set("WEBSITE", "lang", "") if not lang: - lang = cf_set_value("WEBSITE", "lang", langs.load_website_lang()) + lang = cf_set("WEBSITE", "lang", langs.load_website_lang()) elif not langs.translation_exists("website", lang, False): lang = langs.get_sys_lang() langs.load_website_lang() - css = cf_set_value("WEBSITE", "css", "") + css = cf_set("WEBSITE", "css", "") if not css: - css = cf_set_value("WEBSITE", "css", "tyto") + css = cf_set("WEBSITE", "css", "tyto") - sep = cf_set_value("WEBSITE", "separator", "") + sep = cf_set("WEBSITE", "separator", "") if not sep or len(sep) > 2: - sep = cf_set_value("WEBSITE", "separator", "|") + sep = cf_set("WEBSITE", "separator", "|") try: article_code = cf.getboolean("WEBSITE", "article_code") - except: article_code = cf_set_value("WEBSITE", "article_code", "yes") + except: article_code = cf_set("WEBSITE", "article_code", "yes") try: static = cf.getboolean("WEBSITE", "static") - except: static = cf_set_value("WEBSITE", "static", "no") + except: static = cf_set("WEBSITE", "static", "no") # [WEBSITE_MODULES] # ================= global navbar, sidebar_title, sidebar_items, rss_items, sitemaps try: navbar = cf.getboolean("WEBSITE_MODULES", "navbar") - except: navbar = cf_set_value("WEBSITE_MODULES", "navbar", "yes") + except: navbar = cf_set("WEBSITE_MODULES", "navbar", "yes") - sidebar_title = cf_set_value("WEBSITE_MODULES", "sidebar_title", "") + sidebar_title = cf_set("WEBSITE_MODULES", "sidebar_title", "") if not sidebar_title: - sidebar_title = cf_set_value("WEBSITE_MODULES", "sidebar_title", + sidebar_title = cf_set("WEBSITE_MODULES", "sidebar_title", langs.site.sidebar_title) - sidebar_items = cf_set_value("WEBSITE_MODULES", "sidebar_items", "") + sidebar_items = cf_set("WEBSITE_MODULES", "sidebar_items", "") if not sidebar_items or not sidebar_items.isdigit(): - sidebar_items = cf_set_value("WEBSITE_MODULES", "sidebar_items", "0") + sidebar_items = cf_set("WEBSITE_MODULES", "sidebar_items", "0") - rss_items = cf_set_value("WEBSITE_MODULES", "rss_items", "") + rss_items = cf_set("WEBSITE_MODULES", "rss_items", "") if not rss_items or not rss_items.isdigit(): - rss_items = cf_set_value("WEBSITE_MODULES", "rss_items", "0") + rss_items = cf_set("WEBSITE_MODULES", "rss_items", "0") try: sitemaps = cf.getboolean("WEBSITE_MODULES", "sitemaps") - except: sitemaps = cf_set_value("WEBSITE_MODULES", "sitemaps", "yes") + except: sitemaps = cf_set("WEBSITE_MODULES", "sitemaps", "yes") # TEMPLATE_FILENAMES # ================== global favicon, logo, styles, rss, stats - favicon = cf_set_value("TEMPLATE_FILENAMES", "favicon", "") + favicon = cf_set("TEMPLATE_FILENAMES", "favicon", "") if not favicon: - favicon = cf_set_value("TEMPLATE_FILENAMES", "favicon", "favicon.png") + favicon = cf_set("TEMPLATE_FILENAMES", "favicon", "favicon.png") - logo = cf_set_value("TEMPLATE_FILENAMES", "logo", "") + logo = cf_set("TEMPLATE_FILENAMES", "logo", "") if not logo: - logo = cf_set_value("TEMPLATE_FILENAMES", "logo", "logo.png") + logo = cf_set("TEMPLATE_FILENAMES", "logo", "logo.png") - styles = cf_set_value("TEMPLATE_FILENAMES", "styles", "") + styles = cf_set("TEMPLATE_FILENAMES", "styles", "") if not styles: - styles = cf_set_value("TEMPLATE_FILENAMES", "styles", "styles.css") + styles = cf_set("TEMPLATE_FILENAMES", "styles", "styles.css") - rss = cf_set_value("TEMPLATE_FILENAMES", "rss", "") + rss = cf_set("TEMPLATE_FILENAMES", "rss", "") if not rss: - rss = cf_set_value("TEMPLATE_FILENAMES", "rss", "rss.xml") + rss = cf_set("TEMPLATE_FILENAMES", "rss", "rss.xml") - stats = cf_set_value("TEMPLATE_FILENAMES", "stats", "") + stats = cf_set("TEMPLATE_FILENAMES", "stats", "") if not stats: - stats = cf_set_value("TEMPLATE_FILENAMES", "stats", "tyto_stats.ini") + stats = cf_set("TEMPLATE_FILENAMES", "stats", "tyto_stats.ini") # [USER_DIRS] # =========== - cf_set_value("USER_DIRS", "root", wrk_dir) - cf_set_value("USER_DIRS", "articles", wrk_articles) - cf_set_value("USER_DIRS", "images", wrk_images) - cf_set_value("USER_DIRS", "files", wrk_files) - cf_set_value("USER_DIRS", "template", wrk_tpl) - cf_set_value("USER_DIRS", "modules", wrk_mods) - cf_set_value("USER_DIRS", "database", wrk_db) + cf_set("USER_DIRS", "root", wrk_dir) + cf_set("USER_DIRS", "articles", wrk_articles) + cf_set("USER_DIRS", "images", wrk_images) + cf_set("USER_DIRS", "files", wrk_files) + cf_set("USER_DIRS", "template", wrk_tpl) + cf_set("USER_DIRS", "modules", wrk_mods) + cf_set("USER_DIRS", "database", wrk_db) # [USER_TEMPLATE_FILES] # ===================== global wrk_favicon, wrk_logo, wri_styles wrk_favicon = os.path.join(wrk_tpl, favicon) - cf_set_value("USER_TEMPLATE_FILES", "favicon", wrk_favicon) + cf_set("USER_TEMPLATE_FILES", "favicon", wrk_favicon) wrk_logo = os.path.join(wrk_tpl, logo) - cf_set_value("USER_TEMPLATE_FILES", "logo", wrk_logo) + cf_set("USER_TEMPLATE_FILES", "logo", wrk_logo) wrk_styles = os.path.join(wrk_tpl, styles) - cf_set_value("USER_TEMPLATE_FILES", "styles", wrk_styles) + cf_set("USER_TEMPLATE_FILES", "styles", wrk_styles) # [USER_MODULES_FILES] # ==================== global wrk_metas, wrk_header, wrk_navbar, wrk_sidebar, wrk_footer wrk_metas = os.path.join(wrk_mods, "tyto_metas.raw") - cf_set_value("USER_MODULES_FILES", "metas", wrk_metas) + cf_set("USER_MODULES_FILES", "metas", wrk_metas) wrk_header = os.path.join(wrk_mods, "tyto_header.raw") - cf_set_value("USER_MODULES_FILES", "header", wrk_header) + cf_set("USER_MODULES_FILES", "header", wrk_header) wrk_navbar = os.path.join(wrk_mods, "tyto_navbar.raw") - cf_set_value("USER_MODULES_FILES", "navbar", wrk_navbar) + cf_set("USER_MODULES_FILES", "navbar", wrk_navbar) wrk_sidebar = os.path.join(wrk_mods, "tyto_sidebar.raw") - cf_set_value("USER_MODULES_FILES", "sidebar", wrk_sidebar) + cf_set("USER_MODULES_FILES", "sidebar", wrk_sidebar) wrk_footer = os.path.join(wrk_mods, "tyto_footer.raw") - cf_set_value("USER_MODULES_FILES", "footer", wrk_footer) + cf_set("USER_MODULES_FILES", "footer", wrk_footer) # [WIP_FILES] # =========== global wip_favicon, wip_logo, wip_styles, wip_rss, wip_stats wip_favicon = os.path.join(wip_tpl, favicon) - cf_set_value("WIP_FILES", "favicon", wip_favicon) + cf_set("WIP_FILES", "favicon", wip_favicon) wip_logo = os.path.join(wip_tpl, logo) - cf_set_value("WIP_FILES", "logo", wip_logo) + cf_set("WIP_FILES", "logo", wip_logo) wip_styles = os.path.join(wip_tpl, styles) - cf_set_value("WIP_FILES", "styles", wip_styles) + cf_set("WIP_FILES", "styles", wip_styles) wip_rss = os.path.join(wip_tpl, rss) - cf_set_value("WIP_FILES", "rss", wip_rss) + cf_set("WIP_FILES", "rss", wip_rss) wip_stats = os.path.join(wip_tpl, stats) - cf_set_value("WIP_FILES", "stats", wip_stats) + cf_set("WIP_FILES", "stats", wip_stats) global wip_metas, wip_header, wip_navbar, wip_sidebar, wip_footer wip_metas = os.path.join(wip_tpl, "metas.html") - cf_set_value("WIP_FILES", "metas", wip_metas) + cf_set("WIP_FILES", "metas", wip_metas) wip_header = os.path.join(wip_tpl, "header.html") - cf_set_value("WIP_FILES", "header", wip_header) + cf_set("WIP_FILES", "header", wip_header) wip_navbar = os.path.join(wip_tpl, "navbar.html") - cf_set_value("WIP_FILES", "navbar", wip_navbar) + cf_set("WIP_FILES", "navbar", wip_navbar) wip_sidebar = os.path.join(wip_tpl, "sidebar.html") - cf_set_value("WIP_FILES", "sidebar", wip_sidebar) + cf_set("WIP_FILES", "sidebar", wip_sidebar) wip_footer = os.path.join(wip_tpl, "footer.html") - cf_set_value("WIP_FILES", "footer", wip_footer) + cf_set("WIP_FILES", "footer", wip_footer) # [WWW_FILES] # =========== global www_favicon, www_logo, www_styles, www_rss, www_stats www_favicon = os.path.join(www_tpl, favicon) - cf_set_value("WWW_FILES", "favicon", www_favicon) + cf_set("WWW_FILES", "favicon", www_favicon) www_logo = os.path.join(www_tpl, logo) - cf_set_value("WWW_FILES", "logo", www_logo) + cf_set("WWW_FILES", "logo", www_logo) www_styles = os.path.join(www_tpl, styles) - cf_set_value("WWW_FILES", "styles", www_styles) + cf_set("WWW_FILES", "styles", www_styles) www_rss = os.path.join(www_tpl, rss) - cf_set_value("WWW_FILES", "rss", www_rss) + cf_set("WWW_FILES", "rss", www_rss) www_stats = os.path.join(www_tpl, stats) - cf_set_value("WWW_FILES", "stats", www_stats) + cf_set("WWW_FILES", "stats", www_stats) global www_metas, www_header, www_navbar, www_sidebar, www_footer www_metas = os.path.join(www_tpl, "metas.html") - cf_set_value("WWW_FILES", "metas", www_metas) + cf_set("WWW_FILES", "metas", www_metas) www_header = os.path.join(www_tpl, "header.html") - cf_set_value("WWW_FILES", "header", www_header) + cf_set("WWW_FILES", "header", www_header) www_navbar = os.path.join(www_tpl, "navbar.html") - cf_set_value("WWW_FILES", "navbar", www_navbar) + cf_set("WWW_FILES", "navbar", www_navbar) www_sidebar = os.path.join(www_tpl, "sidebar.html") - cf_set_value("WWW_FILES", "sidebar", www_sidebar) + cf_set("WWW_FILES", "sidebar", www_sidebar) www_footer = os.path.join(www_tpl, "footer.html") - cf_set_value("WWW_FILES", "footer", www_footer) + cf_set("WWW_FILES", "footer", www_footer) # [TYTO] # ====== - cf_set_value("TYTO", "domain_hash", cf_id) - cf_set_value("TYTO", "domain_conf", cf_uri) - cf_set_value("TYTO", "domain_user", ult_cf_uri) + cf_set("TYTO", "domain_hash", cf_id) + cf_set("TYTO", "domain_conf", cf_uri) + cf_set("TYTO", "domain_user", ult_cf_uri) # ================================= # diff --git a/src/var/lib/tyto/program/post.py b/src/var/lib/tyto/program/post.py index b009313..1bf5fea 100644 --- a/src/var/lib/tyto/program/post.py +++ b/src/var/lib/tyto/program/post.py @@ -33,10 +33,11 @@ #-------------------------- import os, sys, configparser -import domain, debug, tools, tyto +import args, domain, debug, tools, tyto error = 0 +write = False # When updating database in cf_set(), cf_write() #============================================# @@ -57,7 +58,7 @@ def is_article(target): # Article exists global uri - uri = os.path.join(domain.wrk_articles, target) + uri = os.path.join(domain.user_dir, target) if not os.path.exists(uri): error = debug.out(5, "False", uri, True, 2, False) return False @@ -77,11 +78,10 @@ def is_article(target): # Set target from articles/ wrk_target = uri.rsplit(domain.wrk_articles)[1] - # Load Database - global db - db = False - db = cf_load() # True or False - + # Load Database, get and compare values + cf_load() + cf_datas() + compare_datas() return True @@ -131,19 +131,112 @@ def cf_load(): cf = configparser.ConfigParser() cf.read(cf_uri) - + return True -#====================================================# -# Check if post database configuration file is valid # -#----------------------------------------------------# -def cf_valid(): - global chk_hash, wip_hash, www_hash +#================================# +# Return value from section, key # +#--------------------------------# +def cf_get(section, key, boolean): + if boolean: + try: return cf.getboolean(section, key) + except: return False - chk_hash = cf.get("CHECK", "hash") - wip_hash = cf.get("WIP", "hash") - www_hash = cf.get("WWW", "hash") + try: return cf.get(section, key) + except: return "" + + +#=============================================# +# Get and prepare new vars from post database # +#---------------------------------------------# +def cf_datas(): + # [CHECK] + # ------- + global chk_hash, chk_date, chk_static, chk_errors + chk_hash = cf_get("CHECK", "hash", False) + chk_date = cf_get("CHECK", "date", False) + chk_static = cf_get("CHECK", "static", True) + chk_errors = cf_get("CHECK", "errors", True) + + # [WIP] + # ----- + global wip_hash, wip_date, wip_uri, wip_static + wip_hash = cf_get("WIP", "hash", False) + wip_date = cf_get("WIP", "date", False) + wip_uri = cf_get("WIP", "uri", False) + wip_static = cf_get("WIP", "static", True) + + # [WIP] + # ----- + global www_hash, www_date, www_uri, www_static + www_hash = cf_get("WWW", "hash", False) + www_date = cf_get("WWW", "date", False) + www_uri = cf_get("WWW", "uri", False) + www_static = cf_get("WWW", "static", True) + + +#===============================# +# Do some datas comparisons # +# after post cf_datas() setup # +# Used to do processes (mainly) # +#-------------------------------# +def compare_datas(): + global do_chk, do_wip + + do_chk = False + + if chk_errors: + do_chk = True + do_wip = False + + if chk_static != domain.static: + do_chk = True + + if args.force: + do_chk = do_wip = True + + else: + do_chk = tools.compare_values(wrk_id, chk_hash) + do_wip = tools.compare_values(chk_hash, wip_hash) + + +#===============================# +# Set a value in post database # +# only if changed value # +# check for [section] in file # +# or create it with key and val # +# config file must be loaded # +#-------------------------------# +def cf_set(section, key, value): + global write + + try: cf + except: cf_load() + + if not cf.has_section(section): + cf.add_section(section) + + try: curval = cf.get(section, key) + except: curval = "" + + if not curval or curval != value: + cf.set(section, key, value) + write = True + + +#=====================# +# Write post database # +# if new value is set # +#---------------------# +def cf_write(): + global write + + if write: + with open(cf_uri, "w") as f: + cf.write(f) + + write = False #======# @@ -156,16 +249,16 @@ stats_tyto_text_coms = 0 stats_html_coms = 0 stats_titles = 0 stats_bcodes = 0 +stats_bcodes_lines = 0 stats_quotes = 0 stats_parags = 0 +stats_lists = 0 stats_links = 0 stats_images = 0 stats_files = 0 stats_raws = 0 stats_codes = 0 stats_abbrs = 0 -stats_codes = 0 -stats_raws = 0 stats_total_files = 0 @@ -175,27 +268,26 @@ stats_text_images = 0 stats_text_abbrs = 0 stats_text_codes = 0 stats_text_raws = 0 +stats_text_icodes = 0 # head_contents #============== - # Optional Tags nositemap = "! NoSitemap" # Article will not be included in sitemap # One Line needed -sep = "-----" # Splitter between header and article +sep = "-----" # Splitter between header and article texts # Will replace "Fals" with title value -title = ("title:", False) -about = ("about:", False) -date = ("date:", False) -tags = ("tags:", False) +title = ("title:", False) +about = ("about:", False) +date = ("date:", False) +tags = ("tags:", False) author = ("author:", False) -# optional -logo = ("logo:", False) +logo = ("logo:", False) # optional -# Multiple lines (3) +# Multiple lines (3) markers ml_tags = ("link:", "image:", "file:", "raw:", "code:", "abbr:") ml_tags_marks = { "link:" : "__", @@ -224,12 +316,7 @@ value2s_ext_uris = ("http", "ftp") bcodes = ("{{", "}}") quotes = ("[[", "]]") parags = ("((", "))") - -# markers with "protected" contents -raw_contents = ("bcodes", "quotes") - -# Comments -text_comments = (";;", "