From f4fbb825db035baa86f1f040ce923e6f57648145 Mon Sep 17 00:00:00 2001 From: Cyrille L Date: Mon, 21 Nov 2022 17:06:46 +0100 Subject: [PATCH] domain: fix smileys --- src/var/lib/tyto/program/domain.py | 62 ++++++++++++------------------ 1 file changed, 24 insertions(+), 38 deletions(-) diff --git a/src/var/lib/tyto/program/domain.py b/src/var/lib/tyto/program/domain.py index 3d0016b..6a0ecf2 100644 --- a/src/var/lib/tyto/program/domain.py +++ b/src/var/lib/tyto/program/domain.py @@ -90,7 +90,7 @@ def append_f(f,line_val): #--------------------------------------# def exiting(process,out,msg): msgs = [ - '\n:) All done !', + '\n:D All done !', '\n:/ Maybe next time...', '%s'%msg ] @@ -133,9 +133,9 @@ def manage_domain(Domain, Opt): # Compare before and after domain conf file new_conf_ID = check.get_filesum(domain_conf,True) if not old_conf_ID == new_conf_ID: - exiting('root',2,':) Updated domain configuration file.') + exiting('root',2,':D Updated domain configuration file.') else: - exiting('root',2,':) Unchanged domain configuration file.') + exiting('root',2,':D Unchanged domain configuration file.') else: sys.exit(0) @@ -222,10 +222,8 @@ def domain_input_confirn(set_domain): def domain_input(): global domain_name set_domain = input(' ├ Enter Domain Name: ') - if not set_domain: - exiting('root',1,'') - else: - domain_name = set_domain + if not set_domain: exiting('root', 1, '') + else : domain_name = set_domain #====================# # Domain FORM # @@ -274,7 +272,7 @@ def domain_form(): srv = set_srv[:-1] if not os.path.exists(srv): - exiting('form',2,'\n:( Unsed directory "%s"'%srv) + exiting('form',2,'\n:< Unsed directory "%s"'%srv) # Settings for server srv_domain = '%s/%s/'%(srv,domain_name) @@ -330,7 +328,7 @@ def domain_form(): set_sep = input(' ├ Website pages separator (%s) ? '%sep_titles) if set_sep: if len(set_sep) > 2: - exiting('form',2,'\n:( Seperator is 2 characters max') + exiting('form', 2, '\n:< Seperator is 2 characters max') sep_titles = set_sep append_f(temp_domain,'sep_titles = "%s"'%sep_titles) @@ -345,12 +343,9 @@ def domain_form(): domain_about = show_about = '' set_about = input(' ├ Domain description (%s) ? '%show_about) - if not set_about and not domain_about: - exiting('form',1,'') - if set_about: - domain_about = set_about - if '"' in domain_about: - domain_about = domain_about.replace('"','\\"') + if not set_about and not domain_about: exiting('form',1,'') + if set_about: domain_about = set_about + if '"' in domain_about: domain_about = domain_about.replace('"','\\"') append_f(temp_domain,'domain_about = "%s"'%domain_about) @@ -367,7 +362,7 @@ def domain_form(): set_lang = input(' ├ Website HTML lang (%s) ? '%domain_lang) if set_lang: if len(set_lang) > 3: - exiting('form',2,'\n:( HTML Lang is 3 characters max') + exiting('form',2,'\n:< HTML Lang is 3 characters max') domain_lang = set_lang append_f(temp_domain,'domain_lang = "%s"'%domain_lang) @@ -399,14 +394,13 @@ def domain_form(): domain_mail = show_mail = '' set_mail = input(' ├ Contact admin mail (%s) ? '%show_mail) - if not set_mail and not domain_mail: - exiting('form',1,'') + if not set_mail and not domain_mail: exiting('form', 1, '') if set_mail: if not '@' and not '.' in set_mail: - exiting('form',2,'\n:( Invalid mail format (x@x.x)') + exiting('form', 2, '\n:< Invalid mail format (x@x.x)') domain_mail = set_mail elif not domain_mail: - exiting('form',2,'\n:( Mail is required.') + exiting('form', 2, '\n:< Mail is required.') append_f(temp_domain,'domain_mail = "%s"'%domain_mail) @@ -420,10 +414,8 @@ def domain_form(): domain_tags = show_tags = '' set_tags = input(' ├ Domain Tags [x,y] (%s) ? '%show_tags) - if not set_tags and not domain_tags: - exiting('form',1,'') - if set_tags: - domain_tags = set_tags + if not set_tags and not domain_tags: exiting('form', 1, '') + if set_tags: domain_tags = set_tags append_f(temp_domain,'domain_tags = "%s"'%domain_tags) @@ -437,8 +429,7 @@ def domain_form(): domain_license = show_license = 'CC BY-NC-SA' set_license = input(' ├ Website copyright (%s) ? '%show_license) - if set_license: - domain_license = set_license + if set_license: domain_license = set_license if '"' in domain_license: domain_license = domain_license.replace('"','\\"') @@ -451,14 +442,11 @@ def domain_form(): sidebar_title show_st = sidebar_title[:14] + '...' except: - if 'fr' in domain_lang: - sidebar_title = show_st = "À l'affiche !" - else: - sidebar_title = show_st = "Featured !" + if 'fr' in domain_lang: sidebar_title = show_st = "À l'affiche !" + else : sidebar_title = show_st = "Featured !" set_st = input(' ├ Sidebar title (%s) ? '%show_st) - if set_st: - sidebar_title = set_st + if set_st: sidebar_title = set_st if '"' in sidebar_title: sidebar_title = sidebar_title.replace('"','\\"') @@ -473,7 +461,7 @@ def domain_form(): set_si = input(' ├ Sidebar max items [1-16] (%s) ? '%sidebar_items) if set_si and set_si.isdigit(): if set_si in range(1,16): - exiting('form',2,'\n:( Items number: 1-16') + exiting('form',2,'\n:< Items number: 1-16') sidebar_items = set_si # Domain LOGO (optional) @@ -486,8 +474,7 @@ def domain_form(): domain_logo = show_logo = '' set_logo = input(' ├ Optional. Logo filename (%s) ? '%show_logo) - if set_logo: - domain_logo = set_logo + if set_logo: domain_logo = set_logo append_f(temp_domain,'domain_logo = "%s"'%domain_logo) # External URL profile (optional) @@ -500,8 +487,7 @@ def domain_form(): domain_exturl = show_e = '' set_e = input(' └ Optionnal. URL to a social network (%s) ? '%show_e) - if set_e: - domain_exturl = set_e + if set_e: domain_exturl = set_e append_f(temp_domain,'domain_exturl = "%s"'%domain_exturl) @@ -533,6 +519,6 @@ def create_domain(): check.create_domain_dirs('all') # Will rename temp_domain conf to legacy domain conf file - exiting('form',2,'\n:) Activated domain: "%s"'%domain_name) + exiting('form',2,'\n:D Activated domain: "%s"'%domain_name)