diff options
author | Nick Daly <Nick.M.Daly@gmail.com> | 2013-04-23 17:49:22 -0500 |
---|---|---|
committer | Nick Daly <Nick.M.Daly@gmail.com> | 2013-04-23 17:49:22 -0500 |
commit | f55c7a48ea534e342e6efbd4c7edaf1b1e07f61b (patch) | |
tree | fec45d97e4e976ef7ba5dde83f538fcf19092bc0 /cfg.py | |
parent | 157226f1b88bc090b677f9896aa62a0c734ebf14 (diff) |
Merged with James's upstream.
Hope I did it right. If I screwed up, withsqlite is borked.
Diffstat (limited to 'cfg.py')
-rw-r--r-- | cfg.py | 42 |
1 files changed, 42 insertions, 0 deletions
@@ -0,0 +1,42 @@ +from menu import Menu +import os + +from ConfigParser import SafeConfigParser +parser = SafeConfigParser( + defaults={ + 'root':os.path.dirname(os.path.realpath(__file__)), + 'product_name':"", + 'box_name':"", + 'file_root':"", + 'data_dir':"", + 'store_file':"", + 'user_db':"", + 'status_log_file':"", + 'access_log_file':"", + 'users_dir':"", + 'host':"127.0.0.1", + 'pidfile':"", + 'port':"", + }) +parser.read(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'plinth.config')) + +product_name = parser.get('Name', 'product_name') +box_name = parser.get('Name', 'box_name') +root = parser.get('Path', 'root') +file_root = parser.get('Path', 'file_root') +data_dir = parser.get('Path', 'data_dir') +store_file = parser.get('Path', 'store_file') +user_db = parser.get('Path', 'user_db') +status_log_file = parser.get('Path', 'status_log_file') +access_log_file = parser.get('Path', 'access_log_file') +users_dir = parser.get('Path', 'users_dir') +pidfile = parser.get('Path', 'pidfile') +host = parser.get('Network', 'host') +port = int(parser.get('Network', 'port')) + +html_root = None +main_menu = Menu() +base_href = "" + +if store_file.endswith(".sqlite3"): + store_file = os.path.splitext(store_file)[0] |