diff twisted/plugins/libervia_server.py @ 1275:334d044f2713

server: default theme can now be specified in site section of `sat.conf` with `theme` key
author Goffi <goffi@goffi.org>
date Fri, 19 Jun 2020 16:47:50 +0200
parents f511f8fbbf8a
children 2da573bf3f8b
line wrap: on
line diff
--- a/twisted/plugins/libervia_server.py	Fri May 29 21:56:42 2020 +0200
+++ b/twisted/plugins/libervia_server.py	Fri Jun 19 16:47:50 2020 +0200
@@ -49,7 +49,6 @@
 import configparser
 
 
-CONFIG_SECTION = C.APP_NAME.lower()
 if libervia.__version__ != sat.__version__:
     import sys
 
@@ -185,7 +184,7 @@
         for param in self.optParameters + OPT_PARAMETERS_CFG:
             name = param[0]
             try:
-                value = config.getConfig(config_parser, CONFIG_SECTION, name, Exception)
+                value = config.getConfig(config_parser, C.CONFIG_SECTION, name, Exception)
                 # if isinstance(value, str):
                 #     value = value.encode("utf-8")
                 try:
@@ -206,13 +205,13 @@
         replacements = (("ssl_certificate", "tls_certificate"),)
         for old, new in replacements:
             try:
-                value = config.getConfig(config_parser, CONFIG_SECTION, old, Exception)
+                value = config.getConfig(config_parser, C.CONFIG_SECTION, old, Exception)
             except (configparser.NoSectionError, configparser.NoOptionError):
                 pass
             else:
                 print(("\n/!\\ Use of {old} is deprecated, please use {new} instead\n"
                       .format(old=old, new=new)))
-                config_parser.set(CONFIG_SECTION, new, value)
+                config_parser.set(C.CONFIG_SECTION, new, value)
 
 
 @implementer(IServiceMaker, IPlugin)