mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-02-04 08:13:38 +00:00
* Read python.config from script dir * Make dirs for pid and run Maybe making DESTDIR/var/run during make install is not needed because we can expect the target system to have /var/run, but if it's missing the CherryPy engine will fail when it tries to write the pid. So I added it.
41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
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 = ""
|
|
|