diff --git a/CHANGELOG.md b/CHANGELOG.md index a63ffd3..f2f1697 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,11 @@ Tyto - Littérateur # CURRENTLY IN DEV (in devel branch) ! +## [1.11.5] +- fix show helps in some cases +- updated documentation website in usr/share/docs/www/ +- some minor more things from last + ## [1.11.4] - small changes when writing domain config in [WEBSITE_FOOTER] - check: added marker check (default "=", "+") diff --git a/debian/control b/debian/control index a8fb607..bbce87f 100644 --- a/debian/control +++ b/debian/control @@ -1,5 +1,5 @@ Package: tyto -Version: 1.11.4 +Version: 1.11.5 Section: custom Priority: optional Architecture: all diff --git a/src/usr/bin/tyto b/src/usr/bin/tyto index 9434ed4..cec0a1f 100755 --- a/src/usr/bin/tyto +++ b/src/usr/bin/tyto @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# version: 1.11.4 -# date: 2024-01-15 1705339348 +# version: 1.11.5 +# date: 2024-01-20 17057667032024-01-15 1705339348 # Tyto - Littérateur # Copyright (C) 2023 Cyrille Louarn @@ -97,24 +97,41 @@ if not __name__ == "__main__": # Check installed files check_install() -# Load some Tyto libs -import langs, debug, args, domain -#==========# -# Language # -#==========# +# Load some Tyto libs +# ------------------- +import langs, debug, args, domain, help + + +# Languages +# --------- langs.load_logs() # Load logs language -#========# -# Domain # -#========# +# Just help me ! +# -------------- +exit_sys = False +if len(sys.argv) == 1: + help.manage() + exit_sys = True + +try: + if sys.argv[1] in ("--help", "help", "-h"): + help.manage() + exit_sys = True +except: + pass + +exit_sys and sys.exit(0) + + +# Domain +# ------ domain.check_home() # Mainly check current directory -#===========# -# Arguments # -#===========# +# Arguments +# --------- args.get_arguments() # Get arguments from command line # First starting logs @@ -127,10 +144,9 @@ if args.err_action: # [action] error (only) debug.out(2, "[action]", args.err_action, False, 2, False) -#===============# -# Start process # -#===============# -import check, help, new, wip, publish, show +# Start process +# ------------- +import check, new, wip, publish, show # From command line [ACTION], do do = { @@ -145,7 +161,6 @@ do = { } # Test for errors in python module file (without try) -#do[args.action]() - +# do[args.action]() try: do[args.action]() except KeyError: debug.out(90, args.action, "", True, 2, True) diff --git a/src/var/lib/tyto/program/help.py b/src/var/lib/tyto/program/help.py index 7d2b9f5..4ddb075 100644 --- a/src/var/lib/tyto/program/help.py +++ b/src/var/lib/tyto/program/help.py @@ -26,6 +26,7 @@ import sys import args, langs, show + # # # @@ -55,27 +56,33 @@ def manage(): "file", ) + show_main = True + try: - sys.argv[2] - if not sys.argv[2] in helps: show_main = True - else: show_main = False + if sys.argv[2] in helps: + show_main = False except: - show_main = True + pass if show_main: print(langs.logs.help_man) - if args.commands["targets"]["all"]: - for h in helps: - if not h in norepeat: - print(helps[h]) - return + try: + if args.commands["targets"]["all"]: + for h in helps: + if not h in norepeat: + print(helps[h]) + return + except: + pass for arg in range(2, len(sys.argv)): if sys.argv[arg] in helps: print(helps[sys.argv[arg]]) # CSS references - if args.commands["targets"]["css"]: - show.contents_file("/var/lib/tyto/tpl_files/styles.css", True) - + try: + if args.commands["targets"]["css"]: + show.contents_file("/var/lib/tyto/tpl_files/styles.css", True) + except: + return diff --git a/src/var/lib/tyto/translations/logs_en.py b/src/var/lib/tyto/translations/logs_en.py index 76e0363..0aa22a0 100644 --- a/src/var/lib/tyto/translations/logs_en.py +++ b/src/var/lib/tyto/translations/logs_en.py @@ -215,7 +215,8 @@ tyto [ACTION] [ARGUMENTS] start > activate current domain stop > deactivate current domain check ? + [domain] : check current domain - show > show files contents [domain], [MODULES], [css]... + show > show files contents + [domain], [MODULES], [css], [article].html/.tyto wip ? create HTML in "wip/" server publish ? publish in "www/" server diff --git a/src/var/lib/tyto/translations/logs_fr.py b/src/var/lib/tyto/translations/logs_fr.py index be1417d..ea2a6a0 100644 --- a/src/var/lib/tyto/translations/logs_fr.py +++ b/src/var/lib/tyto/translations/logs_fr.py @@ -215,7 +215,8 @@ tyto [ACTION] [ARGUMENTS] start > activer le domain actuel stop > désactiver le domaine actuel check ? + [domain] : vérifier le domaine actuel - show > montre le contenu des fichiers [domain], [MODULES], [css]... + show > montre le contenu des fichiers + [domain], [MODULES], [css], [name].html/.tyto wip ? créer de l'HTML dans le serveur "wip/" publish ? publier dans le serveur "www/"