From 8843fd3f76f8a95ef2f1cf59fa7fe1a382222d96 Mon Sep 17 00:00:00 2001 From: Cyrille LOUARN Date: Sat, 14 Oct 2023 11:11:47 +0200 Subject: [PATCH] [1.9.23] - new quote process (HTML prepared at 'check') --- CHANGELOG.md | 3 + src/usr/bin/tyto | 7 +- .../program/__pycache__/check.cpython-311.pyc | Bin 34781 -> 34936 bytes .../program/__pycache__/post.cpython-311.pyc | Bin 9401 -> 9235 bytes .../program/__pycache__/tyto.cpython-311.pyc | Bin 1384 -> 1457 bytes .../program/__pycache__/wip.cpython-311.pyc | Bin 1601 -> 5532 bytes src/var/lib/tyto/program/check.py | 2 +- src/var/lib/tyto/program/post.py | 11 +- src/var/lib/tyto/program/tyto.py | 5 + src/var/lib/tyto/program/wip.py | 142 +++++++++++++++--- 10 files changed, 135 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69ac60a..8697067 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ Tyto - Littérateur # CURRENTLY IN DEV ! +## [1.9.23] +- new quote process (HTML prepared at 'check') + ## [1.9.22] - new bcode process (html prepared for wip) - new post database management values diff --git a/src/usr/bin/tyto b/src/usr/bin/tyto index 30ad4a3..9940ac8 100755 --- a/src/usr/bin/tyto +++ b/src/usr/bin/tyto @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Version: 1.9.22 -# Updated: 2023-10-13 1697190846 +# Version: 1.9.23 +# Updated: 2023-10-14 1697274575 # Tyto - Littérateur # Copyright (C) 2023 Cyrille Louarn @@ -94,7 +94,8 @@ prog_files = { "show", "tools", "tyto", - "userset" + "userset", + "wip" } lang_files = { "logs_en", 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 1500ab5def8b815c7229a2cc43f56e3caafc21c8..dbce621597f4a4f0687fef7293666ca96ffecc47 100644 GIT binary patch delta 238 zcmccH&-7yg6Yp|fUM>b8IANuk+P;z3AeYHUV6%O$BJbp5RSuIyYNRG7RBp1c~Q^nik{a+X74M^ V-WQm?HwUzwV`LQGEZ??|5dfF)R~Y~R delta 163 zcmew{f$45P6Yp|fUM>b8I3lK*+Od(>AeZSA|7QDKMc&E3D!CYSCtobLpUhG%GdZEk zVRAyX)MSNfhsnEubQO>msgas|1xPQblA5en<1qOIklz8Mg({>bKdLdAY*WiMxvEx# zQGauPtsWy!(HfvVMTS5^Q*ZM1x{s6Z)WgnR Jc~{#$MgS@5KFI(8 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 324c0db008ed07d429619f706915fbfe195faafb..d95431518e21ab552c5b4066253a95e074586222 100644 GIT binary patch delta 368 zcmW-cyG{Z@6o%Pxmx9Zd1`v$9T-OUm8+BP$N-ea(0*4T@FcU%qcG+1h22o$ZOiRSh zR;BUL6)$l4#;3Q5V zZ6?D5q{Bm$MLCp51yn@(Oo2zJ1WjbX3fhDg+JaTI4Q;dokC9Xl8Rd5{NJ_tKxJFYh zkM~Ccovu89*y0AI|>D*5(S2_41136 zbO}{0Z==(92&w9MqT5uqc0F56S{4Piy;S-=5)ec7Ct}yFz*OLlL&RnGxb`XgOg~9C z3}a5? akyqX&agp&NrpEv)=jyUrd5E%kF7*d_5oJXH delta 557 zcmbR2vD1@pIWI340}v<+Yo^AkPvnzeys}X}m9aiWG0HqeDas;6Im$9cCCVyQEL9>^ zGF2)?bq-6Eb&6V)O^SMoMv7*NR*H6t+8ov>+Z3HByA<6h`xLz>hg6Fc21$^yV34Ap z#uViU6q800GXRP?r5Hvzrx-=Kq%a0EXd1r+srGYAW@KR4e4Q~#lCf&Cm2{O<9#FKX z07T@2h++^?2qKCmpOaRtXZpodUHyxxwpJ6!ijMxp6dMa-X=wan($v&s`Nd>o^NY#O z?iZu&FGg)m7ER`&Dv;)CAaRQ=DLFqSwHPQ?0}`tRixrmUmw?6UKw|Y^v4X^+#B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9)u;3i$92@#HUJI@C%W4 zVu1;a)CD5KSI@9sT!0Vy>N#FN)+02W)cCWBGys({<~-rrToM+dQWQR3EL@PKV^IEk ztbnJLhVJshuQKmu-V?9Q>E3H8{Y1HaSBW1e^RPv;?6Es8-*W2aM#`=cEpCJc3e$z@-}yfcuAcZbwE9Lla^$oAQsj6M{=Oe-bNF}1>bT-wa^GZc z2>SjTP92Vm!ICvnwnp$SbL^XZ6eCB9zN1z13Ij?+lT7o7l`xYkmmy=&2fZL4VX6l= zUN5AJzeU7=tffcRu~bI9n2b+I<4}*6fc!29a86N`XDLK=7g6}h{}q3L+EzhzG4W#x X=bPj^G)4IV_PTKK6!hY8K`{OwUF@ZF delta 512 zcmaKnJxeP=6o${4*^R~+lSQLz{E8na!A8YOHx?EWEws1@qBi$BTjVN!OjZQhK!g+) zHp>(iDp&~j+S)0K_zx7V1i|uFvcEt)BO-!uhna_$nRniE&SC#eZQY-Eyas5!T3I(1 z4eD$h2>RNaSOw;};6y_hL{s1o$eO|L*62S3*ashugP>j=8+LHfkvd;w03}x9J`;SI zG=S_4UPja~TIQh7ym)Y#P6}h2YJEK8US4^4Z=LygfC7DffJeN9dlzbsiAdzv(wcD9 z4Vy7n3af5WrFg!opJI!zpajpyM*nV{jNK)M9uh<9l3%L@D~jXFwYr&yRO=^Fhtx5f z-Zr)h>z$|gXs*k`s&|UAUdPZ7kde*AM{{Fy&2wdj^dy~P8=(wOyn45BCs)apb6Tc$ zoQhL+o@)|iN4AhdOZKvQ q*+WtX6qg7gN5pUf0h@2Z{{Ie>Hl{-OgkxYbgiqLr4IzBT`vh<7V0(1{ diff --git a/src/var/lib/tyto/program/check.py b/src/var/lib/tyto/program/check.py index 89e022c..175f827 100644 --- a/src/var/lib/tyto/program/check.py +++ b/src/var/lib/tyto/program/check.py @@ -812,8 +812,8 @@ def cf_update_values(): 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_lines", str(post.stats_bcodes_lines)) post.cf_set("STATS_TEXTS", "bcodes", str(post.ptags_stats["bcodes"])) + post.cf_set("STATS_TEXTS", "bcodes_lines", str(post.stats_bcodes_lines)) post.cf_set("STATS_TEXTS", "quotes", str(post.ptags_stats["quotes"])) # Founds from header tags post.cf_set("STATS_TEXTS", "links", str(post.stats_text_links)) diff --git a/src/var/lib/tyto/program/post.py b/src/var/lib/tyto/program/post.py index 2079bee..08452bc 100644 --- a/src/var/lib/tyto/program/post.py +++ b/src/var/lib/tyto/program/post.py @@ -312,17 +312,11 @@ value2s_ext_uris = ("http", "ftp") # text_contents # ============= -# Start lines tags -bcodes = ("{{", "}}") -quotes = ("[[", "]]") -parags = ("((", "))") -lists = ("<<", ">>", "=", "+") - # Paired markers ptags = ( ("{{", "}}", "bcodes"), ("[[", "]]", "quotes"), - ("((", "))", "parags"), + ("((", "))", "parags", '

', "

"), ("<<", ">>", "lists" ), ) @@ -347,8 +341,7 @@ html_brline = ("|", '
') html_hrline = ("--", '
') text_comments = (";;", "" + block_time_on = block_time_off = "" + blockquote_cite = blockquote_lang = blockquote_title = "" + footer_cite = footer_book = footer_date = "" + footer = "%s%s%s" + # Metas datas + metas = post.quote_metas + cite = date = book = lang = link = "" - return lines + # Construct blockquote HTML + for ln, line in enumerate(lines): + line = line.lstrip() + + # Open Marker (Unused in HTML). Get user CSS class + if ln == 0: + css = tools.get_css(line, post.ptags[1][0]) + continue + + # Closed marker (Unused in HTML) + elif ln == len(lines) - 1: + continue + + # Meta is set. Get datas. (Unused line in HTML) + elif line.startswith(metas): + if line.startswith(metas[0]) and not cite: + try: cite = line.rsplit(metas[0])[1].lstrip() + except: cite = "" + elif line.startswith(metas[1]) and not date: + try: date = line.rsplit(metas[1])[1].lstrip() + except: date = "" + elif line.startswith(metas[2]) and not book: + try: book = line.rsplit(metas[2])[1].lstrip() + except: book = "" + elif line.startswith(metas[3]) and not lang: + try: lang = line.rsplit(metas[3])[1].lstrip() + except: lang = "" + elif line.startswith(metas[4]) and not link: + try: link = line.rsplit(metas[4])[1].lstrip() + except: link = "" + continue + + # Real content quote + else: + html_quote = "%s\n%s"%(html_quote, line) + + # Create template from datas + #
tag + if link: + blockquote_cite = ' cite="%s"'%link + cite = cite or "Source" + footer = '%s'%( + domain.css, link, footer + ) + if lang: + blockquote_lang = ' lang="%s"'%lang + + #