diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f6b1e4..03a4276 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,16 @@ Tyto - Littérateur # CURRENTLY IN DEV (in devel branch) ! +## [1.9.35] +- Working on creating modules +- - Todo last: metas +- check +- - target: domain, wip, www to check directories and files +- - - domain: create .raw modules and wip modules (.html) +- wip +- - html values are now in wip.py +- fixes and more... + ## [1.9.34] - Working on creating modules - - fixes typos codes diff --git a/README.md b/README.md index 3e75292..116e566 100644 --- a/README.md +++ b/README.md @@ -7,15 +7,18 @@ This program can ve tested but not at all usable. Lots of work to do... tyto ``` # Create new domain -- create a domain directory, line www.domain.tld +- create a domain directory, like www.domain.tld - Go to this directory - type `tyto new domain` +- type `tyto check domain` +- create in new directory domain ".../articles/", an article (see tuto below) +- type `check myfile.tyto` (or use "wip" instead of check) ## Working on - 'wip' action processes - Create HTML full page from article -- Create/Manage modules (header, navbar, sidebar, footer) +- Create/Manage modules (metas, header, navbar, sidebar, footer) ## ToDo - thinking about creating an auto top article menu from titles diff --git a/debian/control b/debian/control index 1104f3e..5280379 100644 --- a/debian/control +++ b/debian/control @@ -1,5 +1,5 @@ Package: tyto -Version: 1.9.33 +Version: 1.9.35 Section: custom Priority: optional Architecture: all diff --git a/src/usr/bin/tyto b/src/usr/bin/tyto index 2d28505..541fdf3 100755 --- a/src/usr/bin/tyto +++ b/src/usr/bin/tyto @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Version: 1.9.34 +# Version: 1.9.35 # Updated: 2023-10-18 1697613100 # Tyto - Littérateur 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 0e09008..73017bf 100644 Binary files a/src/var/lib/tyto/program/__pycache__/check.cpython-311.pyc and b/src/var/lib/tyto/program/__pycache__/check.cpython-311.pyc differ 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 3368d15..ebbefbe 100644 Binary files a/src/var/lib/tyto/program/__pycache__/domain.cpython-311.pyc and b/src/var/lib/tyto/program/__pycache__/domain.cpython-311.pyc differ 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 67d1412..467b6a1 100644 Binary files a/src/var/lib/tyto/program/__pycache__/tyto.cpython-311.pyc and b/src/var/lib/tyto/program/__pycache__/tyto.cpython-311.pyc differ diff --git a/src/var/lib/tyto/program/__pycache__/wip.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/wip.cpython-311.pyc index 20bf17d..4862efe 100644 Binary files a/src/var/lib/tyto/program/__pycache__/wip.cpython-311.pyc and b/src/var/lib/tyto/program/__pycache__/wip.cpython-311.pyc differ diff --git a/src/var/lib/tyto/program/check.py b/src/var/lib/tyto/program/check.py index b9f8534..d276a4b 100644 --- a/src/var/lib/tyto/program/check.py +++ b/src/var/lib/tyto/program/check.py @@ -64,7 +64,40 @@ def manage(action, target): # target is not "all" ready() target.endswith(".tyto") and is_article(target) + target == "domain" and wrk_domain() + target in ("wip", "www") and srv_domain(target) +#==========================================# +# Check some things used by current domain # +#------------------------------------------# +def wrk_domain(): + wrk_template_files() + wip.get_modules("wip") + + if post.error != 0: + sys.exit(post.error) + + +#==========================================================# +# Warn if unused registred file in wrk template/ directory # +#----------------------------------------------------------# +def wrk_template_files(): + for key, uri in domain.cf.items("USER_TEMPLATE_FILES"): + if not os.path.exists(uri): + debug.out(5, key, uri, True, 1, False) + + +#==================================# +# Check wip and www dirs and files # +#----------------------------------# +def srv_domain(target): + for section in ("%s_DIRS"%target.upper(), "%s_FILES"%target.upper()): + if section.endswith("DIRS"): err = 6 + else: err = 5 + for key, uri in domain.cf.items(section): + if not os.path.exists(uri): + debug.out(err, key, uri, True, 1, False) + #================================# # Check article(S) # diff --git a/src/var/lib/tyto/program/domain.py b/src/var/lib/tyto/program/domain.py index 25b3f6b..ae6295f 100644 --- a/src/var/lib/tyto/program/domain.py +++ b/src/var/lib/tyto/program/domain.py @@ -197,8 +197,11 @@ def cf_set(section, key, default): # Optional key elif not default: - if not val: return default - else: default = val + if not val: + cf.set(section, key, default) + return default + else: + default = val # Force set default value if val != default: @@ -234,17 +237,18 @@ def cf_update_values(write): tags = cf_set("DOMAIN", "tags", "tags") license = cf_set("DOMAIN", "lincese", "") if not license: - license = cf_set("DOMAIN", "lincese", "gfdl-1.3") - license_url = cf_set("DOMAIN", "lincese_url", - "https://www.gnu.org/licenses/fdl-1.3.txt") - elif not license == "gfdl-1.3": - license_url = cf_set("DOMAIN", "lincese_url","") + license = cf_set("DOMAIN", "license", "gfdl-1.3") + license_url = cf_set("DOMAIN", "license_url", + "https://www.gnu.org/licenses/fdl-1.3.txt") + elif not license == "gfdl-1.3" and \ + license_url == "https://www.gnu.org/licenses/fdl-1.3.txt": + license_url = cf_set("DOMAIN", "license_url", "") - # Optional - global legals_url, terms_url, statuses_url - legals_url = cf_set("DOMAIN", "legals_url", "") - terms_url = cf_set("DOMAIN", "terms_url", "") - statuses_url = cf_set("DOMAIN", "statuses_url", "") + # [WEBSITE_FOOTER] + global legals_url, terms_url, bylaws_url + legals_url = cf_set("WEBSITE_FOOTER", "legals_url", "") + terms_url = cf_set("WEBSITE_FOOTER", "terms_url", "") + bylaws_url = cf_set("WEBSITE_FOOTER", "bylaws_url", "") # [SERVER] @@ -613,9 +617,6 @@ tags = mail = license = gfdl-1.3 license_url = https://www.gnu.org/licenses/fdl-1.3.txt -legals_url = -terms_url = -statuses_url = [WEBSITE] www_url = @@ -627,6 +628,11 @@ article_code = yes static = no navbar = yes +[WEBSITE_FOOTER] +legals_url = +terms_url = +bylaws_url = + [WEBSITE_MODULES] navbar = yes sidebar_title = diff --git a/src/var/lib/tyto/program/tyto.py b/src/var/lib/tyto/program/tyto.py index 0046ee5..4a1c135 100644 --- a/src/var/lib/tyto/program/tyto.py +++ b/src/var/lib/tyto/program/tyto.py @@ -23,7 +23,7 @@ # File: /var/lib/tyto/program/tyto.py #---------------------------------------------------------------------- -import forms +import forms, wip # # Arguments in command line # @@ -116,65 +116,4 @@ quote = """
%s %s
""" -page_tpl = """ - - - -%s - - -
-%s - -%s - - -
-
-
-

%s

-
-%s -
-%s -
-
-%s -
- -
- -""" - -module_header = """ -