2010-10-30 00:56:40 +01:00
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
_DEFAULT_THEME = os.sep.join([os.path.dirname(os.path.abspath(__file__)),
|
2010-10-30 16:47:59 +01:00
|
|
|
"themes/notmyidea"])
|
2010-10-30 00:56:40 +01:00
|
|
|
_DEFAULT_CONFIG = {'PATH': None,
|
|
|
|
|
'THEME': _DEFAULT_THEME,
|
|
|
|
|
'OUTPUT_PATH': 'output/',
|
2010-10-31 00:08:16 +01:00
|
|
|
'MARKUP': ('rst', 'md'),
|
2010-10-30 00:56:40 +01:00
|
|
|
'STATIC_PATHS': ['css', 'images'],
|
|
|
|
|
'FEED': 'feeds/all.atom.xml',
|
|
|
|
|
'CATEGORY_FEED': 'feeds/%s.atom.xml',
|
|
|
|
|
'SITENAME': 'A Pelican Blog',
|
2010-11-05 02:05:00 +00:00
|
|
|
'DISPLAY_PAGES_ON_MENU': True,
|
2010-11-06 02:25:47 +00:00
|
|
|
'PDF_PROCESSOR': False,
|
2010-11-07 14:35:10 +00:00
|
|
|
'DEFAULT_CATEGORY': 'misc',
|
2010-10-30 00:56:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def read_settings(filename):
|
|
|
|
|
"""Load a Python file into a dictionary.
|
|
|
|
|
"""
|
|
|
|
|
context = _DEFAULT_CONFIG.copy()
|
|
|
|
|
if filename:
|
|
|
|
|
tempdict = {}
|
|
|
|
|
execfile(filename, tempdict)
|
|
|
|
|
for key in tempdict:
|
|
|
|
|
if key.isupper():
|
|
|
|
|
context[key] = tempdict[key]
|
|
|
|
|
return context
|