diff --git a/src/var/lib/tyto/program/db.py b/src/var/lib/tyto/program/db.py index c07810b..3a62151 100644 --- a/src/var/lib/tyto/program/db.py +++ b/src/var/lib/tyto/program/db.py @@ -100,6 +100,8 @@ domain_values = \ 'www_sidebar', 'www_metas', 'www_footer', + 'www_rss', + 'domain_rss', 'domain_footer_about', 'domain_active', ) diff --git a/src/var/lib/tyto/program/domain.py b/src/var/lib/tyto/program/domain.py index 9aa95b1..aad5529 100644 --- a/src/var/lib/tyto/program/domain.py +++ b/src/var/lib/tyto/program/domain.py @@ -193,10 +193,53 @@ def create_domain(target): 'www_navbar = "%snavbar.html"\n'%srv_www_tpl + \ 'www_sidebar = "%ssidebar.html"\n'%srv_www_tpl + \ 'www_metas = "%smetas.html"\n'%srv_www_tpl + \ - 'www_footer = "%sfooter.html"\n'%srv_www_tpl + 'www_footer = "%sfooter.html"'%srv_www_tpl tyto.set_file(db.domain_conf, False, set_f) + + # Get logo's website + #------------------- + try: domain_logo = db.domain_logo + except: domain_logo = 'logo.png' + ask = '' + try: + ask = input(' ├ logo filename ? {%s} '%domain_logo) + except KeyboardInterrupt: + print('') + logs.out("255", '', True) + + if ask: domain_logo = ask + + set_f = 'wip_logo = "%s%s"\n'%(srv_wip_tpl, domain_logo) + \ + 'www_logo = "%s%s"'%(srv_www_tpl, domain_logo) + tyto.set_file(db.domain_conf, False, set_f) + + + # RSS/Atom filename + #------------------ + try: domain_rss = db.domain_rss + except: domain_rss = 'rss.xml' + + ask = '' + try: + ask = input(' ├ Atom/RSS filename ? {%s} '%domain_rss) + except KeyboardInterrupt: + print('') + logs.out("255", '', True) + + if ask: + www_rss = ask + + set_f = 'www_rss = "%s/www/%s"\n'%(root_srv_dom, domain_rss) + \ + '\n# Domain user\'s settings\n' + \ + 'domain_logo = "%s"\n'%domain_logo + \ + 'domain_rss = "%s"'%domain_rss + + + tyto.set_file(db.domain_conf, False, set_f) + + # Get title domain #----------------- try: domain_title = db.domain_title @@ -213,8 +256,7 @@ def create_domain(target): if '"' in domain_title: domain_title = domain_title.replace('"', '') - set_f = '# Domain user\'s settings\n' + \ - 'domain_title = "%s"'%domain_title + set_f = 'domain_title = "%s"'%domain_title tyto.set_file(db.domain_conf, False, set_f) @@ -319,27 +361,6 @@ def create_domain(target): tyto.set_file(db.domain_conf, False, set_f) - # Get logo's website - #------------------- - try: domain_logo = db.domain_logo - except: domain_logo = 'logo.png' - - ask = '' - try: - ask = input(' ├ logo filename ? {%s} '%domain_logo) - except KeyboardInterrupt: - print('') - logs.out("255", '', True) - - if ask: domain_logo = ask - - set_f = 'domain_logo = "%s"\n'%domain_logo + \ - 'wip_logo = "%s%s"\n'%(srv_wip_tpl, domain_logo) + \ - 'www_logo = "%s%s"\n'%(srv_www_tpl, domain_logo) - tyto.set_file(db.domain_conf, False, set_f) - - - # Get License domain #------------------- try: domain_license = db.domain_license @@ -419,7 +440,7 @@ def create_domain(target): set_f = 'domain_termsurl = "%s"'%domain_termsurl tyto.set_file(db.domain_conf, False, set_f) - + # CSS Prefix #----------- @@ -520,6 +541,7 @@ def create_domain(target): set_f = 'sidebar_items = %d'%int(sidebar_items) tyto.set_file(db.domain_conf, False, set_f) + # Create domain_footer_about (user custom description in footer) #--------------------------------------------------------------- try: @@ -609,7 +631,6 @@ def create_sidebar(option): # Create new file, or ask if exists with option = 'reset' ask = ' ├ Reset sidebar configuration file ? ' - log = ' ├ Create source file: %s'%db.sidebar_load res = '' if os.path.exists(db.sidebar_load): try: @@ -669,7 +690,7 @@ def create_sidebar(option): tyto.set_file(db.sidebar_load, 'new', sdb_load) tyto.create_db_load(db.sidebar_load, db.sidebar_load_db) - print(log) + logs.out("33", db.sidebar_load, False) #=============================# @@ -686,7 +707,6 @@ def create_navbar(option): # Create new file, or ask if exists ask = ' ├ Reset navbar configuration file ? ' - log = ' ├ Create source file: %s'%db.navbar_load res = '' if os.path.exists(db.navbar_load): try: @@ -747,7 +767,7 @@ def create_navbar(option): tyto.set_file(db.navbar_load, 'new', nvb_load) tyto.create_db_load(db.navbar_load, db.navbar_load_db) - print(log) + logs.out("33", db.navbar_load, False) #========================# @@ -810,7 +830,6 @@ def create_metas(option): # Create new default file, or ask if exists ask = ' ├ Reset metas configuration file ? ' - log = ' ├ Create source file: %s'%db.metas_load res = '' if os.path.exists(db.metas_load): try: @@ -822,7 +841,7 @@ def create_metas(option): tyto.set_file(db.metas_load, 'new', metas_tags) tyto.create_db_load(db.metas_load, db.metas_load_db) - print(log) + logs.out("33", db.metas_load, False) #=============================# @@ -839,7 +858,6 @@ def create_footer(option): # Create new default file, or ask if exists ask = ' ├ Reset footer configuration file ? ' - log = ' ├ Create source file: %s'%db.footer_load res = '' if os.path.exists(db.footer_load): try: @@ -955,6 +973,11 @@ def create_footer(option): tyto.trans[14][tyto.n] ) + \ ' \n' + \ + '
  • \n' + \ + ' RSS 2.0\n' + \ + '
  • \n' + \ ' \n' + \ ' \n' + \ '