Check, create, update a domain should be ready
This commit is contained in:
parent
beecb0ee5e
commit
02cad1789e
|
@ -7,6 +7,11 @@ Tyto - Littérateur
|
||||||
- License:
|
- License:
|
||||||
- Documentation:
|
- Documentation:
|
||||||
|
|
||||||
|
# CURRENTLY IN DEV !
|
||||||
|
|
||||||
|
## [1.9.8]
|
||||||
|
- Check/create/update a domain is ready
|
||||||
|
|
||||||
## [1.9.7]
|
## [1.9.7]
|
||||||
- new process to check and update configuration file (bug at write some values)
|
- new process to check and update configuration file (bug at write some values)
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ tyto
|
||||||
```
|
```
|
||||||
|
|
||||||
## ToDo next (working on)
|
## ToDo next (working on)
|
||||||
- Manage domain configuration file values
|
|
||||||
- check action
|
- check action
|
||||||
- create template post database
|
- create template post database
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Version: 1.9.7
|
# Version: 1.9.8
|
||||||
# Updated: 2023-09-27 1695799605
|
# Updated: 2023-09-27 1695826135
|
||||||
# Tyto - Littérateur
|
# Tyto - Littérateur
|
||||||
|
|
||||||
# Copyright (C) 2023 Cyrille Louarn <echolib+tyto@a-lec.org>
|
# Copyright (C) 2023 Cyrille Louarn <echolib+tyto@a-lec.org>
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -180,9 +180,7 @@ def cf_create():
|
||||||
# Ensure to set correct values #
|
# Ensure to set correct values #
|
||||||
#-------------------------------------------#
|
#-------------------------------------------#
|
||||||
def cf_update_values(write):
|
def cf_update_values(write):
|
||||||
global cf
|
|
||||||
# Load Domain Configuration file
|
# Load Domain Configuration file
|
||||||
cf = ""
|
|
||||||
cf_load()
|
cf_load()
|
||||||
|
|
||||||
if cf.get("DOMAIN", "name") != name:
|
if cf.get("DOMAIN", "name") != name:
|
||||||
|
@ -201,7 +199,6 @@ def cf_update_values(write):
|
||||||
|
|
||||||
global srv_name
|
global srv_name
|
||||||
srv_name = os.path.join(srv, name + "/")
|
srv_name = os.path.join(srv, name + "/")
|
||||||
print("domain: srv_name", srv_name)
|
|
||||||
if cf.get("SERVER", "domain") != srv_name:
|
if cf.get("SERVER", "domain") != srv_name:
|
||||||
cf.set("SERVER", "domain", srv_name)
|
cf.set("SERVER", "domain", srv_name)
|
||||||
debug.out(204, "[SERVER] domain", srv_name, False, 0, False)
|
debug.out(204, "[SERVER] domain", srv_name, False, 0, False)
|
||||||
|
@ -313,17 +310,28 @@ def cf_update_values(write):
|
||||||
cf.set("DOMAIN", "license_url", "https://www.gnu.org/licenses/fdl-1.3.txt")
|
cf.set("DOMAIN", "license_url", "https://www.gnu.org/licenses/fdl-1.3.txt")
|
||||||
write = True
|
write = True
|
||||||
|
|
||||||
|
# Optional
|
||||||
|
global legals_url, terms_url, statuses_url
|
||||||
|
legals_url = cf.get("DOMAIN", "legals_url")
|
||||||
|
terms_url = cf.get("DOMAIN", "terms_url")
|
||||||
|
statuses_url = cf.get("DOMAIN", "statuses_url")
|
||||||
|
|
||||||
# [WEBSITE]
|
# [WEBSITE]
|
||||||
# =========
|
# =========
|
||||||
global www_url, wip_url
|
global www_url
|
||||||
www_url = cf.get("WEBSITE", "www_url")
|
www_url = cf.get("WEBSITE", "www_url")
|
||||||
if not www_url:
|
if not www_url:
|
||||||
cf.set("WEBSITE", "www_url", "https://%s/"%name)
|
www_url = "https://%s/"%name
|
||||||
|
cf.set("WEBSITE", "www_url", www_url)
|
||||||
|
debug.out(204, "[WEBSITE] www_url", www_url, False, 0, False)
|
||||||
write = True
|
write = True
|
||||||
|
|
||||||
|
global wip_url
|
||||||
wip_url = cf.get("WEBSITE", "wip_url")
|
wip_url = cf.get("WEBSITE", "wip_url")
|
||||||
if not wip_url:
|
if not wip_url:
|
||||||
cf.set("WEBSITE", "wip_url", create_wip_url())
|
wip_url = create_wip_url()
|
||||||
|
cf.set("WEBSITE", "wip_url", wip_url)
|
||||||
|
debug.out(204, "[WEBSITE] wip_url", wip_url, False, 0, False)
|
||||||
write = True
|
write = True
|
||||||
|
|
||||||
global lang
|
global lang
|
||||||
|
@ -340,7 +348,8 @@ def cf_update_values(write):
|
||||||
global css
|
global css
|
||||||
css = cf.get("WEBSITE", "css")
|
css = cf.get("WEBSITE", "css")
|
||||||
if not css:
|
if not css:
|
||||||
cf.set("WEBSITE", "css", "tyto")
|
cf.set("WEBSITE", "css", "tyto")
|
||||||
|
write = True
|
||||||
|
|
||||||
global sep
|
global sep
|
||||||
sep = cf.get("WEBSITE", "separator")
|
sep = cf.get("WEBSITE", "separator")
|
||||||
|
@ -355,6 +364,7 @@ def cf_update_values(write):
|
||||||
except: cf.set("WEBSITE", "static", "no") ; write = True
|
except: cf.set("WEBSITE", "static", "no") ; write = True
|
||||||
|
|
||||||
# [WEBSITE_MODULES]
|
# [WEBSITE_MODULES]
|
||||||
|
# =================
|
||||||
global navbar
|
global navbar
|
||||||
try: cf.getboolean("WEBSITE_MODULES", "navbar")
|
try: cf.getboolean("WEBSITE_MODULES", "navbar")
|
||||||
except: cf.set("WEBSITE_MODULES", "navbar", "yes") ; write = True
|
except: cf.set("WEBSITE_MODULES", "navbar", "yes") ; write = True
|
||||||
|
@ -391,14 +401,7 @@ def cf_update_values(write):
|
||||||
if cf.get("USER_TEMPLATE_FILES", "favicon") != usr_favicon:
|
if cf.get("USER_TEMPLATE_FILES", "favicon") != usr_favicon:
|
||||||
cf.set("USER_TEMPLATE_FILES", "favicon", usr_favicon)
|
cf.set("USER_TEMPLATE_FILES", "favicon", usr_favicon)
|
||||||
write = True
|
write = True
|
||||||
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
|
|
||||||
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
|
|
||||||
|
|
||||||
logo = cf.get("TEMPLATE_FILENAMES", "logo")
|
logo = cf.get("TEMPLATE_FILENAMES", "logo")
|
||||||
if not logo:
|
if not logo:
|
||||||
|
@ -409,14 +412,6 @@ def cf_update_values(write):
|
||||||
if cf.get("USER_TEMPLATE_FILES", "logo") != usr_logo:
|
if cf.get("USER_TEMPLATE_FILES", "logo") != usr_logo:
|
||||||
cf.set("USER_TEMPLATE_FILES", "logo", usr_logo)
|
cf.set("USER_TEMPLATE_FILES", "logo", usr_logo)
|
||||||
write = True
|
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
|
|
||||||
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
|
|
||||||
|
|
||||||
styles = cf.get("TEMPLATE_FILENAMES", "styles")
|
styles = cf.get("TEMPLATE_FILENAMES", "styles")
|
||||||
if not styles:
|
if not styles:
|
||||||
|
@ -427,42 +422,18 @@ def cf_update_values(write):
|
||||||
if cf.get("USER_TEMPLATE_FILES", "styles") != usr_styles:
|
if cf.get("USER_TEMPLATE_FILES", "styles") != usr_styles:
|
||||||
cf.set("USER_TEMPLATE_FILES", "styles", usr_styles)
|
cf.set("USER_TEMPLATE_FILES", "styles", usr_styles)
|
||||||
write = True
|
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
|
|
||||||
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
|
|
||||||
|
|
||||||
rss = cf.get("TEMPLATE_FILENAMES", "rss")
|
rss = cf.get("TEMPLATE_FILENAMES", "rss")
|
||||||
if not rss:
|
if not rss:
|
||||||
rss = "rss.xml"
|
rss = "rss.xml"
|
||||||
cf.set("TEMPLATE_FILENAMES", "rss", rss)
|
cf.set("TEMPLATE_FILENAMES", "rss", rss)
|
||||||
write = True
|
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
|
|
||||||
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
|
|
||||||
|
|
||||||
stats = cf.get("TEMPLATE_FILENAMES", "stats")
|
stats = cf.get("TEMPLATE_FILENAMES", "stats")
|
||||||
if not stats:
|
if not stats:
|
||||||
stats = "tyto_stats.ini"
|
stats = "tyto_stats.ini"
|
||||||
cf.set("TEMPLATE_FILENAMES", "stats", stats)
|
cf.set("TEMPLATE_FILENAMES", "stats", stats)
|
||||||
write = True
|
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
|
|
||||||
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
|
|
||||||
|
|
||||||
# [USER_DIRS]
|
# [USER_DIRS]
|
||||||
# ===========
|
# ===========
|
||||||
|
@ -488,6 +459,167 @@ def cf_update_values(write):
|
||||||
cf.set("USER_DIRS", "database", cf_usr_db)
|
cf.set("USER_DIRS", "database", cf_usr_db)
|
||||||
write = True
|
write = True
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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_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
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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_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
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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]
|
# [TYTO]
|
||||||
# ======
|
# ======
|
||||||
if cf.get("TYTO", "domain_hash") != cf_id:
|
if cf.get("TYTO", "domain_hash") != cf_id:
|
||||||
|
@ -500,35 +632,60 @@ def cf_update_values(write):
|
||||||
cf.set("TYTO", "domain_user", ult_cf_uri)
|
cf.set("TYTO", "domain_user", ult_cf_uri)
|
||||||
write = True
|
write = True
|
||||||
|
|
||||||
|
|
||||||
# Write Configuration file
|
# Write Configuration file
|
||||||
# Only if needed or when new domain
|
# Only if needed or when new domain
|
||||||
print("domain: write", write)
|
|
||||||
if write:
|
if write:
|
||||||
with open(cf_uri, "w") as f:
|
with open(cf_uri, "w") as f:
|
||||||
cf.write(f)
|
cf.write(f)
|
||||||
|
debug.out(204, "True", cf_uri, True, 0, False)
|
||||||
|
|
||||||
# Update User local domain configuration file
|
|
||||||
#--------------------------------------------
|
#=============================================#
|
||||||
|
# Update User local domain configuration file #
|
||||||
|
#---------------------------------------------#
|
||||||
|
ult_write = False
|
||||||
ult_cf_load()
|
ult_cf_load()
|
||||||
ult_cf.set("DOMAIN", "name", name)
|
if ult_cf.get("DOMAIN", "name") != name:
|
||||||
ult_cf.set("DOMAIN", "hash", tools.get_filesum(cf_uri, True))
|
ult_cf.set("DOMAIN", "name", name)
|
||||||
ult_cf.set("DOMAIN", "root", cf_dir)
|
ult_write = True
|
||||||
ult_cf.set("DOMAIN", "conf", cf_uri)
|
|
||||||
ult_cf.set("SERVER", "root", srv)
|
|
||||||
|
|
||||||
with open(ult_cf_uri, "w") as f:
|
cf_hash_c = tools.get_filesum(cf_uri, True)
|
||||||
ult_cf.write(f)
|
if ult_cf.get("DOMAIN", "hash") != cf_hash_c:
|
||||||
|
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)
|
||||||
|
ult_write = True
|
||||||
|
|
||||||
|
if ult_cf.get("DOMAIN", "conf") != cf_uri:
|
||||||
|
ult_cf.set("DOMAIN", "conf", cf_uri)
|
||||||
|
ult_write = True
|
||||||
|
|
||||||
|
if ult_cf.get("SERVER", "root") != srv:
|
||||||
|
ult_cf.set("SERVER", "root", srv)
|
||||||
|
ult_write = True
|
||||||
|
|
||||||
|
if ult_write:
|
||||||
|
with open(ult_cf_uri, "w") as f:
|
||||||
|
ult_cf.write(f)
|
||||||
|
|
||||||
# Update User local Domains List File
|
# Update User local Domains List File
|
||||||
#------------------------------------
|
#------------------------------------
|
||||||
ult_dlf_load()
|
ult_dlf_load()
|
||||||
ult_dlf.set("DOMAINS", name, cf_dir)
|
dlf_write = False
|
||||||
|
try:
|
||||||
|
dlf_line = ult_dlf.get("DOMAINS", name)
|
||||||
|
if dlf_line != cf_dir:
|
||||||
|
dlf_write = True
|
||||||
|
except:
|
||||||
|
dlf_write = True
|
||||||
|
|
||||||
with open(ult_dlf_uri, "w") as f:
|
if dlf_write:
|
||||||
ult_dlf.write(f)
|
ult_dlf.set("DOMAINS", name, cf_dir)
|
||||||
|
with open(ult_dlf_uri, "w") as f:
|
||||||
|
ult_dlf.write(f)
|
||||||
|
|
||||||
debug.out(204, "True", cf_uri, True, 0, False)
|
|
||||||
|
|
||||||
|
|
||||||
#=============================================#
|
#=============================================#
|
||||||
|
|
|
@ -110,8 +110,8 @@ def get_website_lang():
|
||||||
global site_lang, tr_website_uri
|
global site_lang, tr_website_uri
|
||||||
|
|
||||||
tr_website_uri = "%swebsite_%s.py"
|
tr_website_uri = "%swebsite_%s.py"
|
||||||
domain.cf_load()
|
try: site_lang = domain.cf.get("WEBSITE", "lang")
|
||||||
site_lang = domain.cf.get("WEBSITE", "lang") or get_sys_lang()
|
except: site_lang = get_sys_lang()
|
||||||
|
|
||||||
if not translation_exists("website", site_lang, False):
|
if not translation_exists("website", site_lang, False):
|
||||||
site_lang = get_sys_lang() # or default "en"
|
site_lang = get_sys_lang() # or default "en"
|
||||||
|
|
Loading…
Reference in New Issue