]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - bin/optionsgen.py
add dynamic configuration support
[irc/quakenet/qwebirc.git] / bin / optionsgen.py
index f9982835abb99f015af279f250a435585a0110e7..4b9dd875b605f32729bff2dae11982e3b5a9eb0a 100644 (file)
@@ -10,7 +10,9 @@ def get_options():
     baseURL=config.BASE_URL,
     staticBaseURL=config.STATIC_BASE_URL,
     dynamicBaseURL=config.DYNAMIC_BASE_URL,
-    validateNickname=False
+    dynamicConfiguration=False,
+    validateNickname=False,
+    customMenuItems=[]
   )
   
   if hasattr(config, "NICKNAME_VALIDATE") and config.NICKNAME_VALIDATE:
@@ -20,5 +22,20 @@ def get_options():
       validFirstChar=config.NICKNAME_VALID_FIRST_CHAR,
       validSubChars=config.NICKNAME_VALID_SUBSEQUENT_CHARS
     )
-    
+
+  if hasattr(config, "HELP_URL") and config.HELP_URL:
+    options["helpURL"] = config.HELP_URL
+
+  if hasattr(config, "LOGO_URL"):
+    options["logoURL"] = config.LOGO_URL
+
+  if hasattr(config, "CUSTOM_MENU_ITEMS"):
+    options["customMenuItems"] = config.CUSTOM_MENU_ITEMS
+
+  if hasattr(config, "ACCOUNT_WHOIS_COMMAND") and config.ACCOUNT_WHOIS_COMMAND:
+    options["accountWhoisCommand"] = config.ACCOUNT_WHOIS_COMMAND
+
+  if hasattr(config, "DYNAMIC_CONFIGURATION") and config.DYNAMIC_CONFIGURATION:
+    options["dynamicConfiguration"] = True
+
   return json.dumps(options)