From 7945f5473f7ee02f456b6d428ebd4c29a5364677 Mon Sep 17 00:00:00 2001 From: Cyrille L Date: Tue, 22 Nov 2022 16:04:45 +0100 Subject: [PATCH] html: in very ealy dev --- src/var/lib/tyto/program/html.py | 48 ++++++++++++++++++++++++++++++++ src/var/lib/tyto/program/wip.py | 7 +++-- 2 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 src/var/lib/tyto/program/html.py diff --git a/src/var/lib/tyto/program/html.py b/src/var/lib/tyto/program/html.py new file mode 100644 index 0000000..1db253a --- /dev/null +++ b/src/var/lib/tyto/program/html.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 +# Name: Tyto - Littérateur +# Type: Global functions for HTML page +# Description: Create final HTML Page +# file: html.py +# Folder: /var/lib/tyto/programs/ +# By echolib (XMPP: im@echolib.re) +# License: GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 + +#------------ +# funny stats +#------------ +# lines: +# functions: +# comments: +#---------------------------------------------------------------------- + +#********************************************************************** +import check, log, domain + +def html_main_page(): + # Source DB variables + post_db = exec(open(check.curr_post_db).read(),globals()) + + # Metas in HTML page + scale = 'width=device-width, initial-scale=1.0' + visit = '3 days' + title = '%s %s %s'%(post_title, domain.sep_titles, domain.domain_title) + tags = '%s,%s'%(domain.domain_tags, post_tags) + + metas = '\n' + \ + '\n'%scale + \ + '\n' + \ + '\n' + \ + '\n'%visit + \ + '\n'%domain.domain_lang + \ + '\n'%domain.domain_mail + \ + '\n'%domain.domain_license + \ + '\n' + \ + '\n'%title + \ + '\n'%post_author + \ + '\n'%post_about + \ + '\n'%tags + \ + '\n'%post_date + \ + '%s\n'%title + + print(metas) + diff --git a/src/var/lib/tyto/program/wip.py b/src/var/lib/tyto/program/wip.py index 908caa4..5886ee0 100644 --- a/src/var/lib/tyto/program/wip.py +++ b/src/var/lib/tyto/program/wip.py @@ -17,7 +17,7 @@ #********************************************************************** import sys, os, re -import check, log, domain +import check, log, domain, html Post_Err = False @@ -116,6 +116,9 @@ def manage_wip(file_post, Force): print('> Article with Tabs:') tab_article(wip_html.rsplit('\n')) + # Create full page + html.html_main_page() + #============================# @@ -563,14 +566,12 @@ def wip_bruts(article): global wip_html wip_html = '' - all_vars = set(globals()) for var in all_vars: if var.startswith('brut_'): brut = globals()[var] - # Search in article lines for _image: for line in article: if not line.startswith('_brut:'):