From 6d5a75b4bf3b8b5318495576302304166022f9a5 Mon Sep 17 00:00:00 2001 From: Cyrille LOUARN Date: Sat, 14 Oct 2023 17:13:12 +0200 Subject: [PATCH] [1.9.24] - new list process (HTML prepared at 'check') --- CHANGELOG.md | 3 + README.md | 10 +- src/usr/bin/tyto | 6 +- .../program/__pycache__/args.cpython-311.pyc | Bin 2602 -> 2602 bytes .../program/__pycache__/check.cpython-311.pyc | Bin 34936 -> 35361 bytes .../program/__pycache__/debug.cpython-311.pyc | Bin 3905 -> 3905 bytes .../__pycache__/domain.cpython-311.pyc | Bin 24645 -> 24645 bytes .../program/__pycache__/forms.cpython-311.pyc | Bin 8310 -> 8310 bytes .../program/__pycache__/help.cpython-311.pyc | Bin 435 -> 435 bytes .../program/__pycache__/langs.cpython-311.pyc | Bin 3014 -> 3014 bytes .../program/__pycache__/new.cpython-311.pyc | Bin 729 -> 729 bytes .../program/__pycache__/post.cpython-311.pyc | Bin 9235 -> 9250 bytes .../program/__pycache__/show.cpython-311.pyc | Bin 1173 -> 1173 bytes .../program/__pycache__/tools.cpython-311.pyc | Bin 7063 -> 7063 bytes .../program/__pycache__/tyto.cpython-311.pyc | Bin 1457 -> 1457 bytes .../__pycache__/userset.cpython-311.pyc | Bin 1016 -> 1016 bytes .../program/__pycache__/wip.cpython-311.pyc | Bin 5532 -> 9003 bytes src/var/lib/tyto/program/args.py | 2 +- src/var/lib/tyto/program/check.py | 26 +++- src/var/lib/tyto/program/debug.py | 2 +- src/var/lib/tyto/program/domain.py | 2 +- src/var/lib/tyto/program/forms.py | 2 +- src/var/lib/tyto/program/help.py | 2 +- src/var/lib/tyto/program/langs.py | 2 +- src/var/lib/tyto/program/new.py | 2 +- src/var/lib/tyto/program/post.py | 6 +- src/var/lib/tyto/program/show.py | 2 +- src/var/lib/tyto/program/tools.py | 2 +- src/var/lib/tyto/program/tyto.py | 2 +- src/var/lib/tyto/program/userset.py | 2 +- src/var/lib/tyto/program/wip.py | 126 +++++++++++++++++- 31 files changed, 169 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8697067..755ab48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ Tyto - Littérateur # CURRENTLY IN DEV ! +## [1.9.24] +- new list process (HTML prepared at 'check') + ## [1.9.23] - new quote process (HTML prepared at 'check') diff --git a/README.md b/README.md index 75e361f..f4a0d0e 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,11 @@ tyto ``` ## ToDo next (working on) +- added lists to post database (prepared wip) + +## Working on - 'check' action processes -- - wip quotes -- - support for words tags (bolds...) -- - support lists, anchors -- - thinking about creating an auto top article menu from titles -- - stats for article words +- thinking about creating an auto top article menu from titles +- stats for article words - Translate logs in english ! diff --git a/src/usr/bin/tyto b/src/usr/bin/tyto index 9940ac8..c3fef68 100755 --- a/src/usr/bin/tyto +++ b/src/usr/bin/tyto @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Version: 1.9.23 -# Updated: 2023-10-14 1697274575 +# Version: 1.9.24 +# Updated: 2023-10-14 1697296197 # Tyto - Littérateur # Copyright (C) 2023 Cyrille Louarn @@ -19,7 +19,7 @@ # along with this program. If not, see . #---------------------------------------------------------------------- -# XMPP: echolib (im@echolib.re) +# XMPP: echolib > im@echolib.re # # Description: Main binary to execute. # Import modules and start checking/using arguments diff --git a/src/var/lib/tyto/program/__pycache__/args.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/args.cpython-311.pyc index 553053a0a1274f83e006dfea09ed722f94850f1a..34c0cfdb9c480c907260667e72e39ff1229974fe 100644 GIT binary patch delta 20 acmZ1_vPy(|IWI340}u$W)7r=_&jkQ62m~Vl delta 20 acmZ1_vPy(|IWI340}$|-Ds1GI=K=sN&jXnN 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 dbce621597f4a4f0687fef7293666ca96ffecc47..5fd69792cd3ba0c163a6df869f8df3e1f9ee3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|u@8;ymIkLoW}Y(+Ew&-gAh3h!KWSOLefOB|v*nwx=*3F~33w zaeM$mJ64tB`#^bAucI`MSgh1OP<8};0qo>=zkpsq*$9M5x@mAN`>Ut*@aB%qQauhL zwrQpJ`wM~tOq^|G7&Qewqb5&F&fi&fLIs*c;8x7y?$I+akh+=N36rVq^^0Ed`ovws zTCeA;`_)WLO{r;?_N9In_4`ZFMLj>MVmUQ5xaYmFrN5F;}4P!(08e5{5w$XSHwp|18?0MOfEl0$#EV?%MBw!d;T~_|P$j_SjgG zfM;xlW`EF1$XY0zsI14bs+;6pv>2CZLZETliNNQNZf4MJ@nJQYp$c6GdnUZ(E;uwH zlMmpt33&q38mKcKRw}LX9$LFFZo68^W&#?#odEnOVQz+T9*=#HsSCWRroe1;kY=C~qB-(=b z3h@epZy)Agm(;|Fn!7YtaOg7PuMj!7n!F3ygJJ9E>_8}QXn#96V}{os`B^|SN;g{7l~guem-dsYTN?`Y)4+_^1 jcGDKH2f7YV6z?S1xrFz?e-Hb-TL~$-Cft}bj~V+BDX5T^ 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 c1b80bbb344a1ed6aafdd68007f0c77540df2bd6..1110be40f44b6ce69d42ad895b0a26c0ead73d5d 100644 GIT binary patch delta 20 acmX>ocTkRdIWI340}u$W)7r>w#t#5C4FrJz delta 20 acmX>ocTkRdIWI340}#w{Q{BjI#t#5DLj;`w 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 f6bf54b6afd16b40b089b3894a1d67328af72c0c..2401256c75bc997ce1ba6fae2d5b2fb3e39aafc3 100644 GIT binary patch delta 22 ccmX?lfbr-7M(*Xjyj%=GAiPd%Bezuo08)GgBme*a delta 22 ccmX?lfbr-7M(*Xjyj%=GFjYunBezuo08&^62mk;8 diff --git a/src/var/lib/tyto/program/__pycache__/forms.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/forms.cpython-311.pyc index 9ef207c7f379489d83dba112f3b82d59a62c3eda..a581213989c64f3e448c5bcf1800b6cacac2de29 100644 GIT binary patch delta 20 acmez7@XdjHIWI340}u$W)7r?LtpET+E(LV} delta 20 acmez7@XdjHIWI340}z}QQryU$tpET-Zv~0~ diff --git a/src/var/lib/tyto/program/__pycache__/help.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/help.cpython-311.pyc index 5090c9a545d2eba6f64647d3a0835443a0b2f597..ff52e8ab679a5b22d3f81534c354bcde2d23e904 100644 GIT binary patch delta 20 acmdnYyqTGMIWI340}u$W)7r?rf)M~Q0|b)* delta 20 acmdnYyqTGMIWI340}xCVQryVBf)M~PyaaFn diff --git a/src/var/lib/tyto/program/__pycache__/langs.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/langs.cpython-311.pyc index 6403d4d4654cf12e5fd9663edfd9995f01cb8219..ee7fa5bcb3285d808be4fe3a1af5690099becab0 100644 GIT binary patch delta 20 acmX>meoUNuIWI340}u$W)7r?rn;QT&)dcmeoUNuIWI340}xCVQryVBn;QT&js)8P diff --git a/src/var/lib/tyto/program/__pycache__/new.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/new.cpython-311.pyc index b01872fc988f73481086d4e4603eb4945507781d..7a26788e75549d773f80918e1ff5de41e87479e6 100644 GIT binary patch delta 20 acmcb~dXtrVIWI340}u$W)7r>=jtKxaJOv5> delta 20 acmcb~dXtrVIWI340}xCVQryUWjtKxZ^#tbt 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 d95431518e21ab552c5b4066253a95e074586222..e4d963cb3ff6fcaffef991ee9e7025db6c6f9bde 100644 GIT binary patch delta 88 zcmbR2vB-mWIWI340}u$W(@Ooik=H~=&3 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 aa85f8a60eba26384e98354498832beff2b6c788..33f994e517bee4f894f26604e3c3397a731ead4c 100644 GIT binary patch delta 19 ZcmdnUy^))1IWI340}u$W+sL(?6#y;e1a<%b delta 19 ZcmdnUy^))1IWI340}vby+sL(?6#y_<1keBg diff --git a/src/var/lib/tyto/program/__pycache__/userset.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/userset.cpython-311.pyc index 058e4c4ff2aa946fe72d5d68f2bd1adbf96ad3ed..08a9d415338b5b55c7e24ae41a3ff223b23e3794 100644 GIT binary patch delta 20 acmeyt{)3%+IWI340}u$W)7r@WmKgv%T?K3a delta 20 acmeyt{)3%+IWI340}#9xQryV>mKgv(a0Qo~pzTJM+r*MBOKL(jvMWomQzJo8S5>&ILW!p2 zB^?XG5?lu^q67lE%&IlhqzGF$u22`L3jG*?TLdUjp#3RVSX2Z71L}uA`javU3K#~8 z_Rf;Bq#`cd;mnztJ9qBfIWu#)A0D~$E%z^7E(Zb0`^n+>{f@l55uMF<4~g^*;x$%c z067W0Ohnk<&VFe_eH-5+yAany6U0qIA&U9DccVx->5V@-0tmVFzwxi>&pW@MUjl>a zKWq%R+^D;y?W0paJypEAcK+6)(Q?deIkqmEEnnYiIl0+#(r6hpTL!ggKB}kOz5j=9 z_&Dnbu2WS4s`67Up+)rtA*>Gx{L?LC=|81QT6E)&LLahM0|f8a9pd?Xmg79OU6%AB z)tLXZ&6WBt2(z{rIc9 zBx<+)L~T9i_4{s<1aSvSEoJSBy~x2<+X;!0ScO^w=Oz0SlyZc`NsgM*ZD8b%#R|5B z?Z7?cCuB^DY{!5Hd-==~z5M%U(RnV(FATeNFb` z837Cj@Bn8Gypg$_Ok@8-R+2G|6$%f@r=j@?l(Yj8gi4foPtT7A-yJMa27l1x530{@ zyFF_E18-~LqT%f@y&YA;Mb$w6)b&bkn-i-9Vmj7X{96yNhfBc|TEEs`4j#hQKWW0# zS{VCSx;48l-nzX0O|$E{-%kzTn4_7Hn~;?Tj&;{KO^g~Pf@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X^DhK#~rg&0^kJESf$i(FwA zxxg&)fJm2?2K|BbK! diff --git a/src/var/lib/tyto/program/args.py b/src/var/lib/tyto/program/args.py index e5e1884..d257aec 100644 --- a/src/var/lib/tyto/program/args.py +++ b/src/var/lib/tyto/program/args.py @@ -17,7 +17,7 @@ # along with this program. If not, see . #---------------------------------------------------------------------- -# XMPP: echolib (im@echolib.re) +# XMPP: echolib > im@echolib.re # # Description: Manage arguments from command line # File: /var/lib/tyto/program/args.py diff --git a/src/var/lib/tyto/program/check.py b/src/var/lib/tyto/program/check.py index 175f827..0cb6573 100644 --- a/src/var/lib/tyto/program/check.py +++ b/src/var/lib/tyto/program/check.py @@ -17,7 +17,7 @@ # along with this program. If not, see . #---------------------------------------------------------------------- -# XMPP: echolib (im@echolib.re) +# XMPP: echolib > im@echolib.re # # Description: Mainly to check article, but also domain and more # File: /var/lib/tyto/program/check.py @@ -115,25 +115,35 @@ def valid(target): # Text article # ============ # Process bcodes and icodes first to protect their contents - post.error == 0 and sl_ptags(post.ptags[0]) or tools.exit(targets, post.error) - post.error == 0 and icodes() or tools.exit(targets, post.error) + post.error == 0 and sl_ptags(post.ptags[0]) \ + 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) + 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) + post.error == 0 and ml_tags() \ + or tools.exit(targets, post.error) # ============ # Text article # ============ # Single tags - post.error == 0 and sl_stags() or tools.exit(targets, post.error) + post.error == 0 and sl_stags() \ + or tools.exit(targets, post.error) # Quotes - post.error == 0 and sl_ptags(post.ptags[1]) or tools.exit(targets, post.error) + post.error == 0 and sl_ptags(post.ptags[1]) \ + or tools.exit(targets, post.error) + + # Lists + post.error == 0 and sl_ptags(post.ptags[3]) \ + or tools.exit(targets, post.error) return True @@ -496,6 +506,7 @@ def sl_ptags(markers): convert = { "bcodes" : wip.bcode, "quotes" : wip.quote, + "lists" : wip.list, } index0 = index1 = -1 @@ -815,6 +826,7 @@ def cf_update_values(): 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"])) + post.cf_set("STATS_TEXTS", "lists", str(post.ptags_stats["lists"])) # 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)) diff --git a/src/var/lib/tyto/program/debug.py b/src/var/lib/tyto/program/debug.py index 79af455..48ef622 100644 --- a/src/var/lib/tyto/program/debug.py +++ b/src/var/lib/tyto/program/debug.py @@ -17,7 +17,7 @@ # along with this program. If not, see . #---------------------------------------------------------------------- -# XMPP: echolib (im@echolib.re) +# XMPP: echolib > im@echolib.re # # Description: Add more logs when debug is set in command line # File: /var/lib/tyto/program/debug.py diff --git a/src/var/lib/tyto/program/domain.py b/src/var/lib/tyto/program/domain.py index 4ea381d..ba17c42 100644 --- a/src/var/lib/tyto/program/domain.py +++ b/src/var/lib/tyto/program/domain.py @@ -17,7 +17,7 @@ # along with this program. If not, see . #---------------------------------------------------------------------- -# XMPP: echolib (im@echolib.re) +# XMPP: echolib > im@echolib.re # # Description: Manage configuration domain(s) # File: /var/lib/tyto/program/domain.py diff --git a/src/var/lib/tyto/program/forms.py b/src/var/lib/tyto/program/forms.py index 09df2fb..3f2cbff 100644 --- a/src/var/lib/tyto/program/forms.py +++ b/src/var/lib/tyto/program/forms.py @@ -17,7 +17,7 @@ # along with this program. If not, see . #---------------------------------------------------------------------- -# XMPP: echolib (im@echolib.re) +# XMPP: echolib > im@echolib.re # # Description: Forms (edit, create domain, questions...) # File: /var/lib/tyto/program/form.py diff --git a/src/var/lib/tyto/program/help.py b/src/var/lib/tyto/program/help.py index d29a830..5974fc9 100644 --- a/src/var/lib/tyto/program/help.py +++ b/src/var/lib/tyto/program/help.py @@ -17,7 +17,7 @@ # along with this program. If not, see . #---------------------------------------------------------------------- -# XMPP: echolib (im@echolib.re) +# XMPP: echolib > im@echolib.re # # Description: Show help commands # File: /var/lib/tyto/program/help.py diff --git a/src/var/lib/tyto/program/langs.py b/src/var/lib/tyto/program/langs.py index be4b326..636b9b4 100644 --- a/src/var/lib/tyto/program/langs.py +++ b/src/var/lib/tyto/program/langs.py @@ -17,7 +17,7 @@ # along with this program. If not, see . #---------------------------------------------------------------------- -# XMPP: echolib (im@echolib.re) +# XMPP: echolib > im@echolib.re # # Description: Load lang logs file according to system language # Load lang site file according to domain configuration diff --git a/src/var/lib/tyto/program/new.py b/src/var/lib/tyto/program/new.py index d8b6141..d3aace2 100644 --- a/src/var/lib/tyto/program/new.py +++ b/src/var/lib/tyto/program/new.py @@ -17,7 +17,7 @@ # along with this program. If not, see . #---------------------------------------------------------------------- -# XMPP: echolib (im@echolib.re) +# XMPP: echolib > im@echolib.re # # Description: When user wants to create something new # File: /var/lib/tyto/program/new.py diff --git a/src/var/lib/tyto/program/post.py b/src/var/lib/tyto/program/post.py index 08452bc..686e5a2 100644 --- a/src/var/lib/tyto/program/post.py +++ b/src/var/lib/tyto/program/post.py @@ -17,7 +17,7 @@ # along with this program. If not, see . #---------------------------------------------------------------------- -# XMPP: echolib (im@echolib.re) +# XMPP: echolib > im@echolib.re # # Description: About post (from target) database, uri... # File: /var/lib/tyto/program/new.py @@ -317,7 +317,7 @@ ptags = ( ("{{", "}}", "bcodes"), ("[[", "]]", "quotes"), ("((", "))", "parags", '

', "

"), - ("<<", ">>", "lists" ), + ("<<", ">>", "lists", "=", "+"), ) ptags_stats = { @@ -380,6 +380,8 @@ ini_template = """[DOMAIN] [QUOTES] +[LISTS] + [RAWS] [CODES] diff --git a/src/var/lib/tyto/program/show.py b/src/var/lib/tyto/program/show.py index ee3f698..d7ff1da 100644 --- a/src/var/lib/tyto/program/show.py +++ b/src/var/lib/tyto/program/show.py @@ -17,7 +17,7 @@ # along with this program. If not, see . #---------------------------------------------------------------------- -# XMPP: echolib (im@echolib.re) +# XMPP: echolib > im@echolib.re # # Description: When user wants to see something # File: /var/lib/tyto/program/show.py diff --git a/src/var/lib/tyto/program/tools.py b/src/var/lib/tyto/program/tools.py index b5edb51..3e54974 100644 --- a/src/var/lib/tyto/program/tools.py +++ b/src/var/lib/tyto/program/tools.py @@ -17,7 +17,7 @@ # along with this program. If not, see . #---------------------------------------------------------------------- -# XMPP: echolib (im@echolib.re) +# XMPP: echolib > im@echolib.re # # Description: Tools used by Tyto - Littérateur # File: /var/lib/tyto/program/tools.py diff --git a/src/var/lib/tyto/program/tyto.py b/src/var/lib/tyto/program/tyto.py index 0046ff9..08ce0c5 100644 --- a/src/var/lib/tyto/program/tyto.py +++ b/src/var/lib/tyto/program/tyto.py @@ -17,7 +17,7 @@ # along with this program. If not, see . #---------------------------------------------------------------------- -# XMPP: echolib (im@echolib.re) +# XMPP: echolib > im@echolib.re # # Description: Templates, settings, values # File: /var/lib/tyto/program/tyto.py diff --git a/src/var/lib/tyto/program/userset.py b/src/var/lib/tyto/program/userset.py index e08b000..ede333d 100644 --- a/src/var/lib/tyto/program/userset.py +++ b/src/var/lib/tyto/program/userset.py @@ -17,7 +17,7 @@ # along with this program. If not, see . #---------------------------------------------------------------------- -# XMPP: echolib (im@echolib.re) +# XMPP: echolib > im@echolib.re # # Description: When user wants to set something (mainly in domain) # File: /var/lib/tyto/program/set.py diff --git a/src/var/lib/tyto/program/wip.py b/src/var/lib/tyto/program/wip.py index c8bfb0c..71b13fc 100644 --- a/src/var/lib/tyto/program/wip.py +++ b/src/var/lib/tyto/program/wip.py @@ -2,6 +2,7 @@ # Tyto - Littérateur # Copyright (C) 2023 Cyrille Louarn +# Copyright (C) 2023 Adrien Bourmault # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,9 +18,11 @@ # along with this program. If not, see . #---------------------------------------------------------------------- -# XMPP: echolib (im@echolib.re) +# XMPP: echolib > im@echolib.re +# XMPP: neox > neox@a-lec.org # # Description: Convert texts to HTML +# Create HTML page with 'wip' command # File: /var/lib/tyto/program/wip.py #---------------------------------------------------------------------- @@ -34,6 +37,7 @@ import tyto, tools, post, domain + #=========================================================# # Prepared HTML datas in post Database at 'check' process #==================== # Return new string to be converted to one line base64 # @@ -158,11 +162,129 @@ def quote(lines): footer ) - print(html_quote) + #print(html_quote) return html_quote +#===================# +# Create HTML list # +# convert raw lines # +#-------------------# +def list(lines): + lines = lines.rsplit("\n") + + list_raw = "" + + 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[3][0]) + continue + + # Closed marker (Unused in HTML) + elif ln == len(lines) - 1: + continue + + if list_raw: list_raw = "%s\n%s"%(list_raw, line) + else: list_raw = line + + # Final HTML list with css class + list_html = convert_list(list_raw, post.ptags[3][3], post.ptags[3][4]) + list_html = list_html.replace(">", ' class="%s">'%css, 1) + list_html = list_html.replace("
  • ", '
  • \n", "\n"] + OPENING = ["ERROR", "
      \n", "
        \n"] + + rank_stack = [] + rank = 0 + cur_rank = 0 + state = 0 + old_state = 0 + work_str = "" + + for i in range(len(items)): + rank = cur_rank + descriptor = items[i].split(" ")[0] + text = items[i][items[i].find(" "):].lstrip() + cur_rank = len(descriptor) + + if "=" in descriptor: + state = UL + elif "+" in descriptor: + state = OL + else: + raise(Exception) + + # rank up + if cur_rank > rank: + for i in range(cur_rank - rank): + work_str += " "*(rank+i) + OPENING[state] + rank_stack.append(state) + + # rank down + elif cur_rank < rank: + for i in range(rank - cur_rank): + work_str += " "*(rank-i-1) + CLOSING[rank_stack.pop()] + + work_str += " "*cur_rank + '
      1. ' + text + "
      2. \n" + + for i in range(cur_rank): + work_str += " "*(cur_rank-i-1) + CLOSING[rank_stack.pop()] + + return work_str + + +#=========================# +# WIP process #==================================================== +# Convert article to HTML # +# Create new file # +#-------------------------# + #============================# # code # # Used by check module that #