From 2bcda76cd030ca59912b7a65cfa89b7b6a9e83c0 Mon Sep 17 00:00:00 2001 From: Cyrille LOUARN Date: Fri, 29 Sep 2023 15:06:12 +0200 Subject: [PATCH] Cleaner code, better update process for domain configuration file --- src/usr/bin/tyto | 4 +- .../__pycache__/domain.cpython-311.pyc | Bin 34888 -> 23959 bytes .../program/__pycache__/forms.cpython-311.pyc | Bin 8779 -> 8779 bytes .../program/__pycache__/post.cpython-311.pyc | Bin 3893 -> 3668 bytes .../program/__pycache__/tyto.cpython-311.pyc | Bin 2241 -> 2572 bytes src/var/lib/tyto/program/domain.py | 696 +++++++----------- src/var/lib/tyto/program/forms.py | 2 +- src/var/lib/tyto/program/post.py | 12 +- src/var/lib/tyto/program/tyto.py | 27 +- 9 files changed, 306 insertions(+), 435 deletions(-) diff --git a/src/usr/bin/tyto b/src/usr/bin/tyto index 2b0113c..b8255aa 100755 --- a/src/usr/bin/tyto +++ b/src/usr/bin/tyto @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Version: 1.9.8 -# Updated: 2023-09-27 1695826135 +# Version: 1.9.9 +# Updated: 2023-09-29 1695992721 # Tyto - Littérateur # Copyright (C) 2023 Cyrille Louarn 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 cf79271eb992e9e037ca08241b2d1d8a3e178cb7..c5f7f011412a5637051f47888be4657a9466c3a8 100644 GIT binary patch literal 23959 zcmeHvYj6}-msn3f=GmH&G&$EzW*d6!%e|+_&?@_PaUPGzrv5?<4SmbaI+Nk z86{AHZIT+%-nJ2&`c03}>YEv1)HgfAs&8(DQ{VOxyZUyFI0X78HR2Q)a9simu3O;1 z^$2!wdBFj0hTsI(E4aY*32tyR1rNAc0uOGskO8h=@PeD;qG&2iP2?ss`vrKuOny*; zZw~w;c>s~042%^dea5$t`GpNq!cTif3a3h{C>vsDCW?}wLY9y%_=OyJ=X_xYc=&0L zjXFh5F;|#V)T}L>7b{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_k1R#PFwZ169JCppX7I6@7>kvu zauCcPyEYjeXXF!T-is4gVscgxSK!A%1_zIEfPbdJ{uK`J@pBgI4)(8c@B{+Mi%&}8 zegRSD8Er&zT1S0KEuI(!NF@dz^8naHxlCMROtZxhRh$mdlk06%Ki~}#4@I*xm@;weP`1N3OzyZqzJ*e?H;PHzd z)Z{qwo>O|z5O5UX!fMb|>nM9p>A@+-b&mtAEh2n99CE-z89iw7IN-^M9&Dx^CGezF z3kqomh`1g=F071-@4fTj%tvP*oQ3zp=2Rx(`5inm`8ua+F{di!5_0OqoVw)J?lt^S38M*%JL^;&t^?9L~UN8(90+#@qs~< L5uGUF2I>R=65$g@ 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 1dc8c493d3ec7b1a262890455bf35bb5e83d84fa..be29656677e727be0afa8b91907b258d392e2558 100644 GIT binary patch delta 722 zcmZ8eO=uHA6rP#Q{w2FvOPjP}Op~ZdL|dp@ibRTn2*nBoAs4kF&8~IR)D5$nhKSNs zBB&@D27eA7^iVDIA`~y4J@sT{K^PFcc=BKoym)fPkVt*QeDmge-+S|B=3U&6>2GvB z2$*ebN3C>QzlXL_`*~I|;SEN0$`KPt`#+p%OYe39s94uU9|eI1eq4b zgu?)|KSt3lNPY^ZXCo9jE|nH7uT(c_(DjPgbL+NujY_7oT(qxKt&W!pjI~P@%cY`e zEz}mN;M6>7l&%(PF75|OBak1FxZGTz5)WdV%51GTMU#l)neim+cZ^L}g#a|cH$iNj zT+6j`j|V%#&}WqRgc9pfKY5~qCVezXZj1S01*oA1@+0lO_9X8|vK#4+GT|!|Y7a+6hhhp{Zv2mjo1JtUQ+$wT(ifejO60qI z0H(GKB?e)d9975TS+3|OP=#G!rC6~|e4GX5iK|{=`i^=DWipJQ5_YQ<+r#|p@Bn9& zs^fYE*Q(+$=L~XDn=umH9qz%>)~5Cp&Z>NWkb}nIuY81iybk8C)$Ny`+)duy+;8R7 kvSZdN)-*m#9){;f_rZZ3(1&wSf#Ds{hZqSOnE=1qA4{UHH2?qr delta 898 zcmZ8f%}*0S6rYdoc9-q8wX}SNj|y0dL`<|4q{PI;kC<>UG4`NnQ`p69Q)r!TH6$1y z=|Kzz%c$|)m-ut~bZ+6D){M0SK zlI12~kE+qEZdBz}G=;0r<3R{?j=Ae2hpTV9pobc;83P^AC?BEspxj;T)n!)$K+fxO z1u58(h3P5SUQeVM7?%&I=@WR&j(vthkd+LF7r_<+VB4Pck@e{w>PMFjrA?!yMw%aw zE@4*>z?Mz78|Hnu2uV;MY&Z_ZAyB|op!e*@a}k&8F_!_L2lsid#pQ0V)F;SP#i>xM z#VdumtTu0XXJ#|`LRO(KaeHULHp(TE$r4?g$*U!cQ`G75Z3`F5I{l5)N%6lxnYMUF ziDn7*_ii??DV8)t)U2*%X0^O(N!q;T)}hxu=O+5>W=`0%bRGh*41OV@GHjrbi9)+5 zw1>IMnUz!}^|;x<;qNH=4MjIw%%h_Q8Z*%t{o+ZtHUUvu^RD|I`ktoE$k6MwAtX#8 zL6h9nq}djKAN!DebJCE;O=)~N_J;>TU}d4Qu-yBD^VR^wBahlvJJvcLIM1HwH^q(@ z$<2h>ciIpWrkL1uU;2^TgA!fmQ{jHQU((BfT|5V_(Vu(_3Y7Eq!Ty~=ZzqItdQli| zKh6~U30=%&pwJEBrY)@rH_!k(UyCQDVqVh;yJ6%A^9aR4NzatjA_*{GkP_)~z*)DI z*$nRNe3hQTNr~C)yot!bk+(6%>Javi>#aJ=JIM$8`YTM#6_j#bJxeaock->C9yn41 U4Y&eD=&ykWbkjlqfQRksANGmGnE(I) 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 4f5195bf4fca0f2c25010bee7b3b825c42887f3c..32be38606cd0132bc776db4e6f1dedcaeca9c843 100644 GIT binary patch delta 541 zcmZXPJx{_w7{~8up{3A5@r_08%Alel(Z%=;a8Q>gMpAuFgYqJG#e@kKot$KFad%Y1 zC-6Hsm`)~6ZcX?C-Vsbnyi5Q2{h!?ZE`4|J=ljpLZ4tSucZRR+nKsY!7*#`|`xI5E!sFRU^vUMa=rWZ}xqm6R(R&#Q1{j5s}` zD_n?LJz!1Y?RuN#vL#gUuT||aF&ZaM^mM5hCePcvDTar}ao@ONJyEN4Lf02pHEcKi zdaEWFzhOMg$3{UtXs|FBo1h=CnIrybyBo|Lk+R0jAn-3l=uDpMbeRb1TDv8NFUG^_ zmiz}QKk+If(kP`-g;0BtRXehVM`n4OWcCKeS8@5HxbdlSeUfYccrCJxf)f!L11Iu^ Kx8{ysmfByozKGfY delta 222 zcmeAXIVf1aoR^o20SF8)3#Y#0V_yY85tQrSWV94G?;vW(}G0}C 2: - cf.set("WEBSITE", "separator", "|") - write = True + css = cf_set_value("WEBSITE", "css", "tyto") + + sep = cf_set_value("WEBSITE", "separator", "") + if not sep or len(sep) > 2: + sep = cf_set_value("WEBSITE", "separator", "|") + + try: article_code = cf.getboolean("WEBSITE", "article_code") + except: article_code = cf_set_value("WEBSITE", "article_code", "yes") + try: static = cf.getboolean("WEBSITE", "static") + except: static = cf_set_value("WEBSITE", "static", "no") + - global article_code, static - try: cf.getboolean("WEBSITE", "article_code") - except: cf.set("WEBSITE", "article_code", "yes") ; write = True - try: cf.getboolean("WEBSITE", "static") - except: cf.set("WEBSITE", "static", "no") ; write = True - # [WEBSITE_MODULES] # ================= - global navbar - try: cf.getboolean("WEBSITE_MODULES", "navbar") - except: cf.set("WEBSITE_MODULES", "navbar", "yes") ; write = True + 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") - global sidebar_title - sidebar_title = cf.get("WEBSITE_MODULES", "sidebar_title") + sidebar_title = cf_set_value("WEBSITE_MODULES", "sidebar_title", "") if not sidebar_title: - cf.set("WEBSITE_MODULES", "sidebar_title", langs.site.sidebar_title) - write = True + sidebar_title = cf_set_value("WEBSITE_MODULES", "sidebar_title", + langs.site.sidebar_title) - global sidebar_items - sidebar_items = cf.get("WEBSITE_MODULES", "sidebar_items") - if not sidebar_items.isdigit(): - cf.set("WEBSITE_MODULES", "sidebar_items", "0") - write = True + sidebar_items = cf_set_value("WEBSITE_MODULES", "sidebar_items", "") + if not sidebar_items or not sidebar_items.isdigit(): + sidebar_items = cf_set_value("WEBSITE_MODULES", "sidebar_items", "0") - try: cf.getboolean("WEBSITE_MODULES", "sitemaps") - except: cf.set("WEBSITE_MODULES", "sitemaps", "yes") ; write = True + rss_items = cf_set_value("WEBSITE_MODULES", "rss_items", "") + if not rss_items or not rss_items.isdigit(): + rss_items = cf_set_value("WEBSITE_MODULES", "rss_items", "0") + + try: sitemaps = cf.getboolean("WEBSITE_MODULES", "sitemaps") + except: sitemaps = cf_set_value("WEBSITE_MODULES", "sitemaps", "yes") - global rss_items - rss_items = cf.get("WEBSITE_MODULES", "rss_items") - if not rss_items.isdigit(): - cf.set("WEBSITE_MODULES", "rss_items", "0") - write = True - # TEMPLATE_FILES - # ============== - favicon = cf.get("TEMPLATE_FILENAMES", "favicon") + # TEMPLATE_FILENAMES + # ================== + favicon = cf_set_value("TEMPLATE_FILENAMES", "favicon", "") if not favicon: - favicon = "favicon.png" - cf.set("TEMPLATE_FILENAMES", "favicon", favicon) - write = True - usr_favicon = os.path.join(cf_usr_tpl, favicon) - if cf.get("USER_TEMPLATE_FILES", "favicon") != usr_favicon: - cf.set("USER_TEMPLATE_FILES", "favicon", usr_favicon) - write = True + favicon = cf_set_value("TEMPLATE_FILENAMES", "favicon", "favicon.png") - - logo = cf.get("TEMPLATE_FILENAMES", "logo") + logo = cf_set_value("TEMPLATE_FILENAMES", "logo", "") if not logo: - logo = "logo.png" - cf.set("TEMPLATE_FILENAMES", "logo", logo) - write = True - usr_logo = os.path.join(cf_usr_tpl, logo) - if cf.get("USER_TEMPLATE_FILES", "logo") != usr_logo: - cf.set("USER_TEMPLATE_FILES", "logo", usr_logo) - write = True + logo = cf_set_value("TEMPLATE_FILENAMES", "logo", "logo.png") - styles = cf.get("TEMPLATE_FILENAMES", "styles") + styles = cf_set_value("TEMPLATE_FILENAMES", "styles", "") if not styles: - styles = "styles.css" - cf.set("TEMPLATE_FILENAMES", "styles", styles) - write = True - usr_styles = os.path.join(cf_usr_tpl, styles) - if cf.get("USER_TEMPLATE_FILES", "styles") != usr_styles: - cf.set("USER_TEMPLATE_FILES", "styles", usr_styles) - write = True + styles = cf_set_value("TEMPLATE_FILENAMES", "styles", "styles.css") - rss = cf.get("TEMPLATE_FILENAMES", "rss") + rss = cf_set_value("TEMPLATE_FILENAMES", "rss", "") if not rss: - rss = "rss.xml" - cf.set("TEMPLATE_FILENAMES", "rss", rss) - write = True + rss = cf_set_value("TEMPLATE_FILENAMES", "rss", "rss.xml") - stats = cf.get("TEMPLATE_FILENAMES", "stats") + stats = cf_set_value("TEMPLATE_FILENAMES", "stats", "") if not stats: - stats = "tyto_stats.ini" - cf.set("TEMPLATE_FILENAMES", "stats", stats) - write = True - + stats = cf_set_value("TEMPLATE_FILENAMES", "stats", "tyto_stats.ini") + + # [USER_DIRS] # =========== - if cf.get("USER_DIRS", "root") != cf_dir: - cf.set("USER_DIRS", "root", cf_dir) - write = True - if cf.get("USER_DIRS", "articles") != cf_usr_articles: - cf.set("USER_DIRS", "articles", cf_usr_articles) - write = True - if cf.get("USER_DIRS", "images") != cf_usr_images: - cf.set("USER_DIRS", "images", cf_usr_images) - write = True - if cf.get("USER_DIRS", "files") != cf_usr_files: - cf.set("USER_DIRS", "files", cf_usr_files) - write = True - if cf.get("USER_DIRS", "template") != cf_usr_tpl: - cf.set("USER_DIRS", "template", cf_usr_tpl) - write = True - if cf.get("USER_DIRS", "modules") != cf_usr_mods: - cf.set("USER_DIRS", "modules", cf_usr_mods) - write = True - if cf.get("USER_DIRS", "database") != cf_usr_db: - cf.set("USER_DIRS", "database", cf_usr_db) - write = True + 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) - # USER_MODULES_FILES - # ================== - global usr_metas - usr_metas = os.path.join(cf_usr_mods, "tyto_metas.raw") - if cf.get("USER_MODULES_FILES", "metas") != usr_metas: - cf.set("USER_MODULES_FILES", "metas", usr_metas) - debug.out(204, "[USER_MODULES_FILES] metas", usr_metas, False, 0, False) - write = True - - global usr_header - usr_header = os.path.join(cf_usr_mods, "tyto_header.raw") - if cf.get("USER_MODULES_FILES", "header") != usr_header: - cf.set("USER_MODULES_FILES", "header", usr_header) - debug.out(204, "[USER_MODULES_FILES] header", usr_header, False, 0, False) - write = True - global usr_navbar - usr_navbar = os.path.join(cf_usr_mods, "tyto_navbar.raw") - if cf.get("USER_MODULES_FILES", "navbar") != usr_navbar: - cf.set("USER_MODULES_FILES", "navbar", usr_navbar) - debug.out(204, "[USER_MODULES_FILES] navbar", usr_navbar, False, 0, False) - write = True + # [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) - global usr_sidebar - usr_sidebar = os.path.join(cf_usr_mods, "tyto_sidebar.raw") - if cf.get("USER_MODULES_FILES", "sidebar") != usr_sidebar: - cf.set("USER_MODULES_FILES", "sidebar", usr_sidebar) - debug.out(204, "[USER_MODULES_FILES] sidebar", usr_sidebar, False, 0, False) - write = True + wrk_logo = os.path.join(wrk_tpl, logo) + cf_set_value("USER_TEMPLATE_FILES", "logo", wrk_logo) + + wrk_styles = os.path.join(wrk_tpl, styles) + cf_set_value("USER_TEMPLATE_FILES", "styles", wrk_styles) + + + # [USER_MODULES_FILES] + # ==================== + global wri_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) + + wrk_header = os.path.join(wrk_mods, "tyto_header.raw") + cf_set_value("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) + + wrk_sidebar = os.path.join(wrk_mods, "tyto_sidebar.raw") + cf_set_value("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) - global usr_footer - usr_footer = os.path.join(cf_usr_mods, "tyto_footer.raw") - if cf.get("USER_MODULES_FILES", "footer") != usr_footer: - cf.set("USER_MODULES_FILES", "footer", usr_footer) - debug.out(204, "[USER_MODULES_FILES] footer", usr_footer, False, 0, False) - write = True # [WIP_FILES] # =========== - wip_favicon = os.path.join(srv_wip_tpl, favicon) - if cf.get("WIP_FILES", "favicon") != wip_favicon: - cf.set("WIP_FILES", "favicon", wip_favicon) - write = True - - wip_logo = os.path.join(srv_wip_tpl, logo) - if cf.get("WIP_FILES", "logo") != wip_logo: - cf.set("WIP_FILES", "logo", wip_logo) - write = True - - wip_styles = os.path.join(srv_wip_tpl, styles) - if cf.get("WIP_FILES", "styles") != wip_styles: - cf.set("WIP_FILES", "styles", wip_styles) - write = True - - wip_rss = os.path.join(srv_wip_tpl, rss) - if cf.get("WIP_FILES", "rss") != wip_rss: - cf.set("WIP_FILES", "rss", wip_rss) - write = True - - wip_stats = os.path.join(srv_wip_tpl, stats) - if cf.get("WIP_FILES", "stats") != wip_stats: - cf.set("WIP_FILES", "stats", wip_stats) - write = True + 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) - global wip_metas - wip_metas = os.path.join(srv_wip_tpl, "metas.html") - if cf.get("WIP_FILES", "metas") != wip_metas: - cf.set("WIP_FILES", "metas", wip_metas) - debug.out(204, "[WIP_FILES] metas", wip_metas, False, 0, False) - write = True - - global wip_header - wip_header = os.path.join(srv_wip_tpl, "header.html") - if cf.get("WIP_FILES", "header") != wip_header: - cf.set("WIP_FILES", "header", wip_header) - debug.out(204, "[WIP_FILES] header", wip_header, False, 0, False) - write = True + wip_logo = os.path.join(wip_tpl, logo) + cf_set_value("WIP_FILES", "logo", wip_logo) - global wip_navbar - wip_navbar = os.path.join(srv_wip_tpl, "navbar.html") - if cf.get("WIP_FILES", "navbar") != wip_navbar: - cf.set("WIP_FILES", "navbar", wip_navbar) - debug.out(204, "[WIP_FILES] navbar", wip_navbar, False, 0, False) - write = True + wip_styles = os.path.join(wip_tpl, styles) + cf_set_value("WIP_FILES", "styles", wip_styles) - global wip_sidebar - wip_sidebar = os.path.join(srv_wip_tpl, "sidebar.html") - if cf.get("WIP_FILES", "sidebar") != wip_sidebar: - cf.set("WIP_FILES", "sidebar", wip_sidebar) - debug.out(204, "[WIP_FILES] sidebar", wip_sidebar, False, 0, False) - write = True + wip_rss = os.path.join(wip_tpl, rss) + cf_set_value("WIP_FILES", "rss", wip_rss) + + wip_stats = os.path.join(wip_tpl, stats) + cf_set_value("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) + + wip_header = os.path.join(wip_tpl, "header.html") + cf_set_value("WIP_FILES", "header", wip_header) + + wip_navbar = os.path.join(wip_tpl, "navbar.html") + cf_set_value("WIP_FILES", "navbar", wip_navbar) + + wip_sidebar = os.path.join(wip_tpl, "sidebar.html") + cf_set_value("WIP_FILES", "sidebar", wip_sidebar) + + wip_footer = os.path.join(wip_tpl, "footer.html") + cf_set_value("WIP_FILES", "footer", wip_footer) - global wip_footer - wip_footer = os.path.join(srv_wip_tpl, "footer.html") - if cf.get("WIP_FILES", "footer") != wip_footer: - cf.set("WIP_FILES", "footer", wip_footer) - debug.out(204, "[WIP_FILES] footer", wip_footer, False, 0, False) - write = True # [WWW_FILES] # =========== - www_favicon = os.path.join(srv_www_tpl, favicon) - if cf.get("WWW_FILES", "favicon") != www_favicon: - cf.set("WWW_FILES", "favicon", www_favicon) - write = True - - www_logo = os.path.join(srv_www_tpl, logo) - if cf.get("WWW_FILES", "logo") != www_logo: - cf.set("WWW_FILES", "logo", www_logo) - write = True - - www_styles = os.path.join(srv_www_tpl, styles) - if cf.get("WWW_FILES", "styles") != www_styles: - cf.set("WWW_FILES", "styles", www_styles) - write = True - - www_rss = os.path.join(srv_www_tpl, rss) - if cf.get("WWW_FILES", "rss") != www_rss: - cf.set("WWW_FILES", "rss", www_rss) - write = True - - www_stats = os.path.join(srv_www_tpl, stats) - if cf.get("WWW_FILES", "stats") != www_stats: - cf.set("WWW_FILES", "stats", www_stats) - write = True - - global www_metas - www_metas = os.path.join(srv_www_tpl, "metas.html") - if cf.get("WWW_FILES", "metas") != www_metas: - cf.set("WWW_FILES", "metas", www_metas) - debug.out(204, "[WWW_FILES] metas", www_metas, False, 0, False) - write = True + 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) - global www_header - www_header = os.path.join(srv_www_tpl, "header.html") - if cf.get("WWW_FILES", "header") != www_header: - cf.set("WWW_FILES", "header", www_header) - debug.out(204, "[WWW_FILES] header", www_header, False, 0, False) - write = True + www_logo = os.path.join(www_tpl, logo) + cf_set_value("WWW_FILES", "logo", www_logo) - global www_navbar - www_navbar = os.path.join(srv_www_tpl, "navbar.html") - if cf.get("WWW_FILES", "navbar") != www_navbar: - cf.set("WWW_FILES", "navbar", www_navbar) - debug.out(204, "[WWW_FILES] navbar", www_navbar, False, 0, False) - write = True + www_styles = os.path.join(www_tpl, styles) + cf_set_value("WWW_FILES", "styles", www_styles) - global www_sidebar - www_sidebar = os.path.join(srv_www_tpl, "sidebar.html") - if cf.get("WWW_FILES", "sidebar") != www_sidebar: - cf.set("WWW_FILES", "sidebar", www_sidebar) - debug.out(204, "[WWW_FILES] sidebar", www_sidebar, False, 0, False) - write = True + www_rss = os.path.join(www_tpl, rss) + cf_set_value("WWW_FILES", "rss", www_rss) + + www_stats = os.path.join(www_tpl, stats) + cf_set_value("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) + + www_header = os.path.join(www_tpl, "header.html") + cf_set_value("WWW_FILES", "header", www_header) + + www_navbar = os.path.join(www_tpl, "navbar.html") + cf_set_value("WWW_FILES", "navbar", www_navbar) + + www_sidebar = os.path.join(www_tpl, "sidebar.html") + cf_set_value("WWW_FILES", "sidebar", www_sidebar) + + www_footer = os.path.join(www_tpl, "footer.html") + cf_set_value("WWW_FILES", "footer", www_footer) - global www_footer - www_footer = os.path.join(srv_www_tpl, "footer.html") - if cf.get("WWW_FILES", "footer") != www_footer: - cf.set("WWW_FILES", "footer", www_footer) - debug.out(204, "[WWW_FILES] footer", www_footer, False, 0, False) - write = True # [TYTO] # ====== - if cf.get("TYTO", "domain_hash") != cf_id: - cf.set("TYTO", "domain_hash", cf_id) - write = True - if cf.get("TYTO", "domain_conf") != cf_uri: - cf.set("TYTO", "domain_conf", cf_uri) - write = True - if cf.get("TYTO", "domain_user") != ult_cf_uri: - cf.set("TYTO", "domain_user", ult_cf_uri) - write = True - - # Write Configuration file - # Only if needed or when new domain - if write: + 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) + + + # ================================= # + # Write Configuration file # + # Only if needed or when new domain # + # --------------------------------- # + if new_val or write: with open(cf_uri, "w") as f: cf.write(f) - debug.out(204, "True", cf_uri, True, 0, False) #=============================================# @@ -654,8 +511,8 @@ def cf_update_values(write): ult_cf.set("DOMAIN", "hash", cf_hash_c) ult_write = True - if ult_cf.get("DOMAIN", "root") != cf_dir: - ult_cf.set("DOMAIN", "root", cf_dir) + if ult_cf.get("DOMAIN", "root") != wrk_dir: + ult_cf.set("DOMAIN", "root", wrk_dir) ult_write = True if ult_cf.get("DOMAIN", "conf") != cf_uri: @@ -670,19 +527,20 @@ def cf_update_values(write): with open(ult_cf_uri, "w") as f: ult_cf.write(f) + # Update User local Domains List File #------------------------------------ ult_dlf_load() dlf_write = False try: dlf_line = ult_dlf.get("DOMAINS", name) - if dlf_line != cf_dir: + if dlf_line != wrk_dir: dlf_write = True except: dlf_write = True if dlf_write: - ult_dlf.set("DOMAINS", name, cf_dir) + ult_dlf.set("DOMAINS", name, wrk_dir) with open(ult_dlf_uri, "w") as f: ult_dlf.write(f) @@ -705,7 +563,7 @@ def cf_valid(): cf_update_values(False) active = is_active() - active and create_work_dirs() + active and create_wrk_dirs() return active @@ -736,7 +594,7 @@ def is_active(): #===================================# # Create user domain work directory # #-----------------------------------# -def create_work_dirs(): +def create_wrk_dirs(): cf_load() for key, directory in cf.items("USER_DIRS"): @@ -762,20 +620,20 @@ except: # cf: Domain Configuration File # #------------------------------------------# # Domain Configuration directory -cf_dir = user_dir.rsplit("articles/")[0] -cf_usr_articles = os.path.join(cf_dir, "articles/") -cf_usr_tpl = os.path.join(cf_dir, "template/") -cf_usr_images = os.path.join(cf_dir, "images/") -cf_usr_files = os.path.join(cf_dir, "files/") -cf_usr_mods = os.path.join(cf_dir, "modules/") -cf_usr_db = os.path.join(cf_dir, ".db/") +wrk_dir = user_dir.rsplit("articles/")[0] +wrk_articles = os.path.join(wrk_dir, "articles/") +wrk_tpl = os.path.join(wrk_dir, "template/") +wrk_images = os.path.join(wrk_dir, "images/") +wrk_files = os.path.join(wrk_dir, "files/") +wrk_mods = os.path.join(wrk_dir, "modules/") +wrk_db = os.path.join(wrk_dir, ".db/") # Domain name from current basename directory # Exit if not format at least "abc.tld" -name = os.path.basename(os.path.dirname(cf_dir)) +name = os.path.basename(os.path.dirname(wrk_dir)) cf_name = "tyto_domain.ini" -cf_uri = os.path.join(cf_dir, cf_name) +cf_uri = os.path.join(wrk_dir, cf_name) cf_id = tools.get_filesum(cf_uri, False) # ID from URI # Tyto directory in home local user files diff --git a/src/var/lib/tyto/program/forms.py b/src/var/lib/tyto/program/forms.py index 38c2370..e7fc2f7 100644 --- a/src/var/lib/tyto/program/forms.py +++ b/src/var/lib/tyto/program/forms.py @@ -262,5 +262,5 @@ def ask_domain_server(update): return if update: tools.update_ini_file(domain.cf_uri, "SERVER", "root", answer) - else: return srv + else: return answer diff --git a/src/var/lib/tyto/program/post.py b/src/var/lib/tyto/program/post.py index 66310a9..6bd45f8 100644 --- a/src/var/lib/tyto/program/post.py +++ b/src/var/lib/tyto/program/post.py @@ -44,8 +44,7 @@ import domain, debug, tools, tyto #--------------------------------------------# def is_article(target): # User MUST be in articles/ - domain.cf_load() - (os.getcwd() + "/").startswith(domain.cf_usr_articles) or \ + (os.getcwd() + "/").startswith(domain.wrk_articles) or \ debug.out(2, "-> articles/", domain.cf_usr_articles, True, 2, True) # Target URI most be from legacy directory or not begins with @@ -54,8 +53,7 @@ def is_article(target): # Article exists global uri - - uri = os.path.join(domain.cf_usr_articles, target) + uri = os.path.join(domain.wrk_articles, target) os.path.exists(uri) or debug.out(5, "False", uri, True, 2, True) # Article is a Tyto format and not empty (exit on errors) @@ -68,13 +66,10 @@ def is_article(target): uri_id = tools.get_filesum(uri, False) # Set post configuration file database - cf_uri = os.path.join(domain.cf_usr_db, uri_id + ".ini") + cf_uri = os.path.join(domain.wrk_db, uri_id + ".ini") # Load Database db = cf_load() # True or False - if db: cf_valid() - else: tools.create_file(cf_uri, tyto.ini_article) - @@ -87,7 +82,6 @@ def cf_load(): return False global cf - cf = configparser.ConfigParser() cf.read(cf_uri) diff --git a/src/var/lib/tyto/program/tyto.py b/src/var/lib/tyto/program/tyto.py index b30d3ea..1bcc1c0 100644 --- a/src/var/lib/tyto/program/tyto.py +++ b/src/var/lib/tyto/program/tyto.py @@ -23,6 +23,8 @@ # File: /var/lib/tyto/program/tyto.py #---------------------------------------------------------------------- +import forms + # # Arguments in command line # # @@ -53,12 +55,29 @@ web_url = "https://tyto.echolib.re" git_url = "https://git.a-lec.org/echolib/tyto-litterateur" +#=============================================================# +# Domain questions # +# Used by domain.cf_set_value() # +# to check for configuration domain in [SECTION]: key = value # +# Ask user if no value and update configuration file # +#-------------------------------------------------------------# +keys_4q = ("server", "title", "date", "about", "mail", "tags") +keys_questions = { + "server" : forms.ask_domain_server, + "title" : forms.ask_domain_title, + "date" : forms.ask_domain_date, + "about" : forms.ask_domain_about, + "mail" : forms.ask_domain_mail, + "tags" : forms.ask_domain_tags + } + #===========================# # Templates #================================================== #===========================# -#===========================# -# Domain configuration file # -#---------------------------# +#=============================# +# Domain configuration file # +# Create file with new domain # +#-----------------------------# ini_domain = """[DOMAIN] activated = no name = %s @@ -86,8 +105,8 @@ static = no navbar = yes sidebar_title = sidebar_items = 6 -sitemaps = yes rss_items = 100 +sitemaps = yes [TEMPLATE_FILENAMES] favicon = favicon.png