jquast / x84

A python telnet/ssh server for modern terminals. In spirit of classic software such as ami/x, teleguard, renegade, iniquity.

Home Page:http://x84.readthedocs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

child config directory

nolageek opened this issue · comments

suggestion: implementing a directory in you can isolate modified files that will be read before/override the /default directory?

So, if we edit say, main.py we can put in in .. /x84-path/custom-name. unmodified files can be left in /x84-path/default?
Kind of like child themes. Child config directory...

Placing this path into default.ini under scriptpath would tell x84 to look in this directory first and fall back on /default

Would be a clean way to isolate modified files and keep /default from being polluted. Also, help prevent overwriting files when upgrading.

so, i guess this would turn scriptpath into an array, of preferred precedence order, comma-delimited. By default this would be only the same value as-is.

if you make such a PR I'll accept it, you need to:

  • update documentation (docs/) folder where scriptpath is described.
  • update CHANGES file to reflect the new value type of scriptpath as a comma-delimited list.
  • update bbs/session.py - @property def script_path(self).
  • update bbs/session.py - @property def script_module(self).
  • update bbs/session.py - method def runscript(self, script).
  • update x84/webserve.py - def main(background_daemon=True)
  • update x84/webmodules/static.py - def web_module().

For the last one, you will have to either invent a new configuration option, or re-purpose the existing and document it, such as "the static folder is the last-most scriptpath specified". I don't think it would be wise to have multiple static web folders.

First pass at this in above commit. Appears to work well with web and console modules.

It does not work with local web modules, but I think I have a fix.

thanks hali

Going to be replacing web.py stack with Flask, and then this should be easy to resolve.