From 9393bdc01ad31168b5f388a8aeeedce446dc87fd Mon Sep 17 00:00:00 2001 From: Cyrille LOUARN Date: Thu, 5 Oct 2023 16:44:06 +0200 Subject: [PATCH] [1.9.19] - 'check', added post logo set and configs --- CHANGELOG.md | 4 + src/usr/bin/tyto | 4 +- .../program/__pycache__/check.cpython-311.pyc | Bin 24583 -> 26438 bytes .../__pycache__/domain.cpython-311.pyc | Bin 24618 -> 24793 bytes .../program/__pycache__/post.cpython-311.pyc | Bin 6036 -> 5915 bytes .../program/__pycache__/tools.cpython-311.pyc | Bin 4503 -> 5114 bytes src/var/lib/tyto/program/check.py | 251 ++++++++++-------- src/var/lib/tyto/program/domain.py | 3 +- src/var/lib/tyto/program/post.py | 8 +- src/var/lib/tyto/program/tools.py | 19 ++ 10 files changed, 169 insertions(+), 120 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c43af1a..697b74a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ Tyto - Littérateur # CURRENTLY IN DEV ! +## [1.9.19] +- working on 'check' process +- - Added post 'logo: URI' (for social network share + opt show on page) + ## [1.9.18] - working on 'check' process - - added image: tag diff --git a/src/usr/bin/tyto b/src/usr/bin/tyto index 110e81f..fe0bf51 100755 --- a/src/usr/bin/tyto +++ b/src/usr/bin/tyto @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Version: 1.9.18 -# Updated: 2023-10-04 1696374079 +# Version: 1.9.19 +# Updated: 2023-10-05 1696512944 # 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 c1016f5aa71c42277fa99d70c7cbdcd05ff8b9f5..813b7d576c1b08fb347f34318cacd5d458d7ee8e 100644 GIT binary patch delta 7095 zcmbVRdvFv-dY_qn@9fULpGew=B*aR9jL=FTA%u{Yw|Qg02;_y4K|x1MMx8KtD%NbtkfIAUHw;sjJ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ADiFpdb>+x3njJ?xQj8}HiU;GCASWJPT1Ny=T>g!F(`M`?>h<5vnAXbCrgi{R?i zTKujsYYNy%MX!Lo{#4y4Toq%(L)gr*NjlLePNKYb<({s5(S_{A9di3>PTUxCIb&gPq$2=7l zgD@}4X(pM1@p)_A)0}}b!dgReq`yXH#ZjW}gGK2$8^BH>taW2d&*}SznXvn`DMUA= z+dnicI~q1(7xXNCWZg7SRy%R`yx4iB-Vhy45D%CtGdx;)>Ir`d-ZPWKYZgJX@Zb=^ww8WuKWTJ(4BQ z%=GL?rR;^&3d5gkqyv5MvH>reEW94SE~2kq?mtknJ5KlR+0{L;J5HT&zu}2feFKBr z`9Dis#vSEx_8w<;Z13*fzHdL@0ln0#dKYeO#n1x~XWVCm<0pA9--`a=mDdB; zu}qbGGao(qhBwLYadOgGkvck3c_|)@k5B#{wx%JwcBLcJqsNkIw|bI)-IaQ0PsPp- z%Xj19H!-v(ePDC&5x@^P{|hW)CdW>JtBJTA8qk}ZTV!%&#oH}{Rb0V&omvI;E8zzK3FX|e`+SrInLKp$B{ Nni9l!fye3C{{WnM+eQEY diff --git a/src/var/lib/tyto/program/__pycache__/domain.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/domain.cpython-311.pyc index c07260d75f2082a19468825d59e787c02980a586..dfc4f981970cb8fa3bf0ff5a73b05b140808009b 100644 GIT binary patch delta 1881 zcmaJ>eP~-%6n{52FCjLcd#O#9rQal7Khq{@mh@vwlO;{NZcV#JtIjp%IZCbFS}$|f zY)p{}I*NM4KZcZwTE{kJ8YyKWnjr%}*jA8~YxHv#=|9rx9%ATfpR+%$ihrsHtHM{e{?L{;_TWEY_DwlB0$(fTrSwfiS$T66%+llv*8F8;9MBJ;%ak@9a)%qPUR;R}i zGArUyl7^M?sP4puPKF^z;Lm`?oZKy=?&SmI)Rxe3ArxM1G_bvVCpo>vKSBLgxZ==L ze|H)|yrN4tn=i%3;9jGh?c@8&%R(-ig^~sv*CVUk#}ANKa^9C3Z17u?o@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B2Wau7N+R4d8r3r3S zvQ{1BG!2B|nooiQRTAzcGZc@(8uk0gJ36;mO}R%TTuaXAxVT1wHHrtwtd7r8e84B+ zLGm8t)$7u~@VQLGbkS#7plsWc_Zegj(-%6QsKl^T%_@WBLLwkQNsS8+EA1fHbkF+f zC79q`4NK`Db2KFkGj$Sp{7m`0j_at}1&aH~B^@*Mo?52l1H{HML-ep74Lsy3P)2B3X{zAZ$c9fRzTN1| zwUF)YzHO8omgh0cj1(Gpy>a;w)v`d@B|U>>Ax@vOz0=+%38r>u?MyZ+-QEnd|B!c^ zT)CMBF7aNgO;X7+8<05n=`u=R=l{Fd;Yh%jKNd>aTR)QPNp)Lir_^~gt>tHo#ICNwRPIN2KTxv(HfNZFgvK**L1tw6GQVb)a#`-s@u!G_ozR&&qHnh$m_+=xMFey|8lkzhF}Iw*2($;5==lUQb0qc$PTEi zNEJjV1BqK4$!YOri8+}mMIJzI9}pKiPF^G6z|x@6pfQfe4??8wCX!jaNpy`1?9~`o(f_MZ0xUVolV4;Ef8d8&}Ms)8b-#l$$LZ>@Ut>1e_((U3X`+NG*~z! V8dxSz7kkgAAi&bV1A<`B008N_K{|dC$6>kv 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 31eda4eec383b39254d9724473403bbbfcc8a934..8a96161eb99ec65126ef75049c1d64cd1e907ec5 100644 GIT binary patch delta 965 zcmZuwT}xC!7(O%S%vl}X<8Ek}AGM^m9XBa03Hq?W5F!df5iv-Po-GgUN6c9aZA~wP zNHUdkpRf|R~nOF>`D)@{t7_e!tVpe=v{Y6d^)D#_`9-uyCftiB)v=8vY24DFgb5hNgoMGqX|=$x^SPyoRrktdxs*hD!*lE;!G)>Lc=7exq|>(Jdd z0Mp72H|8U=k%f^hUboHbmfN>^<8<@Sl59zBOG&mVrz?%26RQ*w3$^_#RlGebWR)&_~)&qTBTO8?Jyki6=#5x?3r+&tOaLpi1)HPK#yfM_yhIa zHQaUJD{jKv^dI#p?(H%{B@uwCKxyyILL4=WM)E*rkphs= zWGhkvu_Zx-GLX2%k(-#Envz*mT%-aLQw0*5j6ib^aLTai0XbotA9D6GIfG0H0UPo1 zJdo*D1hV|)IUu3QS)>T0(9A6o1&ZBbEicL}Nrjp`c_U9St2IzKc{3+(G_#HlNEgD~ zA_E{_lNa3_h^r<~5Kv$go4ip#niphnkqJmGTanr1n*#ETmXm)9sIs~Ng~~Q73nnv$ z3EX1ONG#6C$xJF@2B~HR5nzAYf>=C2;ucFuW-i2Kx7bqha}zW3ir7Gs{2&4p%0-~? kD*^>U5y;U+Zj>", ln, line) + for ln, line in enumerate(texts, post.head_lines + 1): + if not line or line.isspace(): continue - if not line or line.isspace(): continue + # legacy Tyto Titles + if line.startswith(post.tyto_titles): + if not line[3:]: + post.error = \ + debug.out(52, "%s. %s ?"%(ln, line), post.uri, True, 2, False) + return False - # legacy Tyto Titles - if line.startswith(post.tyto_titles): - if not line[3:]: - post.error = \ - debug.out(52, "%s. %s ?"%(ln, line), post.uri, True, 2, False) - return False - - # Avoic wanting #6 - #9 (but accept #1x.. #5x.. as comments...) - elif line[1].isdigit() and int(line[1]) >= 6: - post.error = \ - debug.out(52, "%s) %s..."%(ln, line[0:10]), post.uri, True, 1, False) - return False + # Avoic wanting #6 - #9 (but accept #1x.. #5x.. as comments...) + elif line[1].isdigit() and int(line[1]) >= 6: + post.error = \ + debug.out(52, "%s) %s..."%(ln, line[0:10]), post.uri, True, 1, False) + return False - post.stats_titles += 1 + post.stats_titles += 1 - # Count Tyto Comments - elif line.startswith("#"): - post.stats_tyto_text_coms += 1 + # Count Tyto Comments + elif line.lstrip().startswith("#"): + post.stats_tyto_text_coms += 1 - # Count HTML comments - elif line.startswith(post.text_comments): - post.stats_html_coms += 1 + # Count HTML comments + elif line.lstrip().startswith(post.text_comments): + post.stats_html_coms += 1 + # Add stat for [] when user wants to show logo in post + elif line.lstrip().startswith("_image:logo"): + post.stats_text_images += 1 + link_var = "image_%s"%(post.stats_images+1) + link_val = "_image:logo" + html_var = "html_%s"%(post.stats_images+1) + html_val = '%s'%( + post.logo[1], "%%s", "%%s", post.title[1], "%%s") + post.cf.set("IMAGES", link_var, link_val) + post.cf.set("IMAGES", html_var, html_val) + return True @@ -538,6 +567,8 @@ def titles(): # Update post configuration file # #--------------------------------# def cf_update_values(): + post.date = ("date:", tools.local_date(post.date[1])) + post.cf.set("DOMAIN", "name", domain.name) post.cf.set("FILE", "id", post.uri_id) diff --git a/src/var/lib/tyto/program/domain.py b/src/var/lib/tyto/program/domain.py index e0a25f3..1a4b6b1 100644 --- a/src/var/lib/tyto/program/domain.py +++ b/src/var/lib/tyto/program/domain.py @@ -227,7 +227,7 @@ def cf_update_values(write): cf_set_value("DOMAIN", "name", name) - title = cf_set_value("DOMAIN", "title", "title") + 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") @@ -347,6 +347,7 @@ def cf_update_values(write): # TEMPLATE_FILENAMES # ================== + global favicon, logo, styles, rss, stats favicon = cf_set_value("TEMPLATE_FILENAMES", "favicon", "") if not favicon: favicon = cf_set_value("TEMPLATE_FILENAMES", "favicon", "favicon.png") diff --git a/src/var/lib/tyto/program/post.py b/src/var/lib/tyto/program/post.py index 733cc30..138628b 100644 --- a/src/var/lib/tyto/program/post.py +++ b/src/var/lib/tyto/program/post.py @@ -146,8 +146,6 @@ def cf_valid(): wip_hash = cf.get("WIP", "hash") www_hash = cf.get("WWW", "hash") - print("post: chk_hash", chk_hash) - #======# # MAIN #======================================================================= @@ -169,7 +167,7 @@ date = ("date:", False) tags = ("tags:", False) author = ("author:", False) # optional -snpic = ("snpic:", False) +logo = ("logo:", False) # Multiple lines (3) ml_tags = ("link:", "image:", "file:", "raw:", "code:", "abbr:") @@ -240,16 +238,12 @@ ini_template = """[DOMAIN] [FILE] [HEADERS] -snpic = [CHECK] -static = [WIP] -static = [WWW] -static = [LINKS] diff --git a/src/var/lib/tyto/program/tools.py b/src/var/lib/tyto/program/tools.py index 290e3c2..e750bdc 100644 --- a/src/var/lib/tyto/program/tools.py +++ b/src/var/lib/tyto/program/tools.py @@ -54,6 +54,25 @@ def nowdate(): return(now.strftime('%Y-%m-%d %H:%M:%S')) +# +# convert int date to local date +# Return date (only year) for post database +# +def local_date(date): + date = date.rsplit(" ")[0] # if nowdate() + + year = date.rsplit("-")[0] + month = date.rsplit("-")[1] + day = date.rsplit("-")[2] + + dates = { + "fr" : "%s/%s/%s"%(day, month, year), + "en" : date, + } + + return dates[domain.lang] + + #========================# # Return sum of src file # # src: True = Content #