From 423ead1aa1a6c4133967580bf00bca9562861ede Mon Sep 17 00:00:00 2001 From: Holger Frey Date: Tue, 12 Dec 2017 15:37:55 +0100 Subject: [PATCH] Added wiki config --- hooks/pre_gen_project.py | 3 +- .../{{cookiecutter.directory_name}}.py | 37 +++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 {{cookiecutter.directory_name}}/{{cookiecutter.directory_name}}.py diff --git a/hooks/pre_gen_project.py b/hooks/pre_gen_project.py index d398a9f..6387e8f 100644 --- a/hooks/pre_gen_project.py +++ b/hooks/pre_gen_project.py @@ -18,8 +18,7 @@ try: except ModuleNotFoundError: pass - wiki_path = Path(MOIN_PATH) / module_name if wiki_path.exists(): print('ERROR: wiki %s already exists!' % module_name) - sys.exit(1) + sys.exit(3) diff --git a/{{cookiecutter.directory_name}}/{{cookiecutter.directory_name}}.py b/{{cookiecutter.directory_name}}/{{cookiecutter.directory_name}}.py new file mode 100644 index 0000000..7a5f64b --- /dev/null +++ b/{{cookiecutter.directory_name}}/{{cookiecutter.directory_name}}.py @@ -0,0 +1,37 @@ +# -*- coding: iso-8859-1 -*- +# IMPORTANT! This encoding (charset) setting MUST be correct! If you live in a +# western country and you don't know that you use utf-8, you probably want to +# use iso-8859-1 (or some other iso charset). If you use utf-8 (a Unicode +# encoding) you MUST use: coding: utf-8 +# That setting must match the encoding your editor uses when you modify the +# settings below. If it does not, special non-ASCII chars will be wrong. + +""" +This is a sample config for a wiki that is part of a wiki farm and uses +farmconfig for common stuff. Here we define what has to be different from +the farm's common settings. +""" + +# we import the FarmConfig class for common defaults of our wikis: +from farmconfig import FarmConfig + +# now we subclass that config (inherit from it) and change what's different: +class Config(FarmConfig): + + # basic options (you normally need to change these) + sitename = u'{{cookiecutter.directory_name}}' # [Unicode] + interwikiname = '{{cookiecutter.directory_name}}' + + # name of entry page / front page [Unicode], choose one of those: + page_front_page = u"FrontPage" + + data_dir = '/var/www/moin/wikis/{{cookiecutter.directory_name}}/data/' + + acl_rights_before = u"HolgerFrey:read,write,delete,revert,admin OswaldPrucker:read,write,delete,revert,admin" + + acl_rights_default = u"{{cookiecutter.wiki_name}}Group:read,write,delete,revert All:" + + logo_string = u'Logo' + + # style the "today" calendar cell + html_head = u''