include default.ini in package
share/isso.conf symlink actually. Fix broken isso.dispatch module.
This commit is contained in:
parent
bffcc3af6f
commit
5f71b735e5
@ -1,6 +1,7 @@
|
||||
include man/man1/isso.1
|
||||
include man/man5/isso.conf.5
|
||||
|
||||
include isso/defaults.ini
|
||||
include share/isso.conf
|
||||
|
||||
include isso/js/embed.min.js
|
||||
|
@ -220,7 +220,7 @@ def main():
|
||||
serve = subparser.add_parser("run", help="run server")
|
||||
|
||||
args = parser.parse_args()
|
||||
conf = config.load(join(dist.location, "share", "isso.conf"), args.conf)
|
||||
conf = config.load(join(dist.location, "isso", "defaults.ini"), args.conf)
|
||||
|
||||
if args.command == "import":
|
||||
conf.set("guard", "enabled", "off")
|
||||
|
1
isso/defaults.ini
Symbolic link
1
isso/defaults.ini
Symbolic link
@ -0,0 +1 @@
|
||||
../share/isso.conf
|
@ -20,16 +20,17 @@ class Dispatcher(DispatcherMiddleware):
|
||||
a relative URI, e.g. /foo.example and /other.bar.
|
||||
"""
|
||||
|
||||
default = os.path.join(dist.location, "share", "isso.conf")
|
||||
conf = os.path.join(dist.location, "isso", "defaults.ini")
|
||||
|
||||
def __init__(self, *confs):
|
||||
|
||||
self.isso = {}
|
||||
|
||||
for i, conf in enumerate(map(config.load(Dispatcher.default, conf))):
|
||||
for path in confs:
|
||||
conf = config.load(Dispatcher.conf, path)
|
||||
|
||||
if not conf.get("general", "name"):
|
||||
logger.warn("unable to dispatch %r, no 'name' set", confs[i])
|
||||
logger.warn("unable to dispatch %r, no 'name' set", path)
|
||||
continue
|
||||
|
||||
self.isso["/" + conf.get("general", "name")] = make_app(conf)
|
||||
|
@ -7,6 +7,6 @@ from isso import dist, config
|
||||
|
||||
application = make_app(
|
||||
config.load(
|
||||
os.path.join(dist.location, "share", "isso.conf"),
|
||||
os.path.join(dist.location, "isso", "defaults.ini"),
|
||||
os.environ.get('ISSO_SETTINGS')),
|
||||
multiprocessing=True)
|
||||
|
@ -32,7 +32,7 @@ class TestComments(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
fd, self.path = tempfile.mkstemp()
|
||||
conf = config.load(os.path.join(dist.location, "share", "isso.conf"))
|
||||
conf = config.load(os.path.join(dist.location, "isso", "defaults.ini"))
|
||||
conf.set("general", "dbpath", self.path)
|
||||
conf.set("guard", "enabled", "off")
|
||||
conf.set("hash", "algorithm", "none")
|
||||
@ -380,7 +380,7 @@ class TestModeratedComments(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
fd, self.path = tempfile.mkstemp()
|
||||
conf = config.load(os.path.join(dist.location, "share", "isso.conf"))
|
||||
conf = config.load(os.path.join(dist.location, "isso", "defaults.ini"))
|
||||
conf.set("general", "dbpath", self.path)
|
||||
conf.set("moderation", "enabled", "true")
|
||||
conf.set("guard", "enabled", "off")
|
||||
@ -412,7 +412,7 @@ class TestPurgeComments(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
fd, self.path = tempfile.mkstemp()
|
||||
conf = config.load(os.path.join(dist.location, "share", "isso.conf"))
|
||||
conf = config.load(os.path.join(dist.location, "isso", "defaults.ini"))
|
||||
conf.set("general", "dbpath", self.path)
|
||||
conf.set("moderation", "enabled", "true")
|
||||
conf.set("guard", "enabled", "off")
|
||||
|
@ -37,7 +37,7 @@ class TestGuard(unittest.TestCase):
|
||||
|
||||
def makeClient(self, ip, ratelimit=2, direct_reply=3, self_reply=False):
|
||||
|
||||
conf = config.load(os.path.join(dist.location, "share", "isso.conf"))
|
||||
conf = config.load(os.path.join(dist.location, "isso", "defaults.ini"))
|
||||
conf.set("general", "dbpath", self.path)
|
||||
conf.set("hash", "algorithm", "none")
|
||||
conf.set("guard", "enabled", "true")
|
||||
|
@ -26,7 +26,7 @@ class TestVote(unittest.TestCase):
|
||||
|
||||
def makeClient(self, ip):
|
||||
|
||||
conf = config.load(os.path.join(dist.location, "share", "isso.conf"))
|
||||
conf = config.load(os.path.join(dist.location, "isso", "defaults.ini"))
|
||||
conf.set("general", "dbpath", self.path)
|
||||
conf.set("guard", "enabled", "off")
|
||||
conf.set("hash", "algorithm", "none")
|
||||
|
Loading…
Reference in New Issue
Block a user