diff --git a/src/var/lib/tyto/program/domain.py b/src/var/lib/tyto/program/domain.py index 80a257b..be2c8f8 100644 --- a/src/var/lib/tyto/program/domain.py +++ b/src/var/lib/tyto/program/domain.py @@ -17,6 +17,7 @@ #********************************************************************** +from datetime import datetime import os, sys, locale, importlib import logs, db, tyto, html @@ -218,6 +219,26 @@ def create_domain(target): tyto.set_file(db.domain_conf, False, set_f) + # Get creation date + #------------------ + try: domain_date + except: domain_date = datetime.now().year + + ask = '' + try: + ask = input(' ├ Domain creation yeay ? {%s} '%domain_date) + except KeyboardInterrupt: + print('') + logs.out("255", '', True) + + if ask: + if not ask.isdigit(): logs.out("3", ask, True) + domain_date = ask + + set_f = 'domain_date = "%s"'%domain_date + tyto.set_file(db.domain_conf, False, set_f) + + # Get Description domain #----------------------- try: domain_about = db.domain_about @@ -229,6 +250,7 @@ def create_domain(target): except KeyboardInterrupt: print('') logs.out("255", '', True) + if ask: domain_about = ask elif not domain_about: logs.out("255", '', True) if '"' in domain_about: @@ -248,6 +270,7 @@ def create_domain(target): except KeyboardInterrupt: print('') logs.out("255", '', True) + if ask: if len(ask) == 2: domain_lang = ask else: logs.out("3", ask, True) @@ -268,6 +291,7 @@ def create_domain(target): except KeyboardInterrupt: print('') logs.out("255", '', True) + if ask: if not "@" in ask and not "." in ask: logs.out("3", ask, True) domain_mail = ask @@ -288,6 +312,7 @@ def create_domain(target): except KeyboardInterrupt: print('') logs.out("255", '', True) + if ask: domain_tags = ask elif not domain_tags: logs.out("255", '', True) @@ -306,6 +331,7 @@ def create_domain(target): except KeyboardInterrupt: print('') logs.out("255", '', True) + if ask: domain_logo = ask set_f = 'domain_logo = "%s"\n'%domain_logo + \ @@ -326,6 +352,7 @@ def create_domain(target): except KeyboardInterrupt: print('') logs.out("255", '', True) + if ask: domain_license = ask elif not domain_license: logs.out("255", '', True) if '"' in domain_license: @@ -346,6 +373,7 @@ def create_domain(target): except KeyboardInterrupt: print('') logs.out("255", '', True) + if ask: if not ask.startswith('http'): logs.out("3", ask, True) domain_licurl = ask @@ -365,6 +393,7 @@ def create_domain(target): except KeyboardInterrupt: print('') logs.out("255", '', True) + if ask: if not ask.isalnum(): logs.out("3", ask, True) domain_css = ask.lower() @@ -384,6 +413,7 @@ def create_domain(target): except KeyboardInterrupt: print('') logs.out("255", '', True) + if ask: if not len(ask) == 1: logs.out("3", ask, True) domain_sep = ask @@ -403,6 +433,7 @@ def create_domain(target): except KeyboardInterrupt: print('') logs.out("255", '', True) + if ask: if not ask.startswith('http'): logs.out("3", ask, True) domain_relme = ask @@ -422,6 +453,7 @@ def create_domain(target): except KeyboardInterrupt: print('') logs.out("255", '', True) + if ask: sidebar_title = ask if '"' in sidebar_title: sidebar_title = sidebar_title.replace('"', '') @@ -441,6 +473,7 @@ def create_domain(target): except KeyboardInterrupt: print('') logs.out("255", '', True) + if ask: if not ask.isdigit(): logs.out("3", ask, True) elif int(ask) in range(1,17): sidebar_items = int(ask) @@ -763,6 +796,20 @@ def create_footer(option): Tytosrc = '(%s)'%tyto.trans[3][tyto.n] + tyto_show = \ + '%s %s'%(tyto.Tyto, Tytosrc) + + if db.domain_date == datetime.now().year: + footer_date = db.domain_date + else: + footer_date = '%s - %s'%(db.domain_date, datetime.now().year) + + domain_home = \ + '%s'%db.domain_title footer = \ '\n' + \ '' # Create new default file, or ask if exists @@ -818,3 +862,12 @@ def create_footer(option): tyto.set_file(db.footer_load, 'new', footer) tyto.create_db_load(db.footer_load, db.footer_load_db) print(log) + +# +""" + '