Skip to content
This repository was archived by the owner on Aug 20, 2021. It is now read-only.

Commit

Permalink
Second pass at child directory configuration change. Adding styling a…
Browse files Browse the repository at this point in the history
…nd syntax recommendations from jquast.
  • Loading branch information
jesseward committed Mar 17, 2015
1 parent 3910cb3 commit 9f068dc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
2 changes: 0 additions & 2 deletions x84/bbs/ini.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,6 @@ def init_bbs_ini():
cfg_bbs.set('web', 'chain', os.path.expanduser(
os.path.join('~', '.x84', 'ca.cer')))
cfg_bbs.set('web', 'modules', 'msgserve')
cfg_bbs.set('web', 'static_files', os.path.abspath(
os.path.join(os.path.dirname(__file__), os.path.pardir, 'default')))

# default path if cmd argument is not absolute,
cfg_bbs.add_section('door')
Expand Down
22 changes: 9 additions & 13 deletions x84/bbs/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,24 +253,19 @@ def show_traceback(self):

@property
def script_path(self):
""" Base filepath folder for all scripts.
"""
Base filepath folder for all scripts.
rtype: list
:rtype: list
"""
val = get_ini('system', 'scriptpath')

# system.scriptpath setting.
# coerce scriptpath to a list. Multiple scriptpath values allow the
# ability to override the x84/default modules, without modifying the
# original source tree files.
val = val.split(',')
scriptpath_dirs = get_ini('system', 'scriptpath', split=True)

# ensure all specified folders exist
for directory in val:
for directory in scriptpath_dirs:
assert os.path.isdir(directory), (
'configuration section [system], value scriptpath: '
'not a folder: {!r}'.format(directory))
return val
return scriptpath_dirs

@property
def current_script(self):
Expand All @@ -282,9 +277,10 @@ def current_script(self):

@property
def script_module(self):
""" Base python module instance for userland scripts.
"""
Base python module instance for userland scripts.
rtype: list
:rtype: list
"""
if not self._script_module:

Expand Down
4 changes: 2 additions & 2 deletions x84/webmodules/static.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def web_module():

# determine document root for web server
static_root = (get_ini('web', 'document_root')
or os.path.join(get_ini('system', 'scriptpath').split(',')[0],
'www-static'))
or os.path.join(get_ini('system', 'scriptpath',
split=True)[0], 'www-static'))
StaticApp.static_root = static_root

return {
Expand Down
2 changes: 1 addition & 1 deletion x84/webserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def main(background_daemon=True):

log = logging.getLogger(__name__)

SCRIPT_PATH = get_ini(section='system', key='scriptpath').split(',')
SCRIPT_PATH = get_ini(section='system', key='scriptpath', split=True)

# ensure the SCRIPT_PATH is in os environment PATH for module lookup.
for directory in SCRIPT_PATH:
Expand Down

0 comments on commit 9f068dc

Please sign in to comment.