[moin-user] Help on xapian configuration

Paul Boddie paul at boddie.org.uk
Tue Jul 24 10:15:02 EDT 2018


On Tuesday 24. July 2018 15.38.38 mor fall wrote:
> Hello,
> Thank you Paul,
> 
> i ve  configured xapian correctly but  when i run the moin command to buld
> an index i got a lots of  error.

I'll extract the parts you need to look at more closely:

> 2018-07-24 15:00:46,885 ERROR MoinMoin.config.multiconfig:53 Your source
> code / config file is not correctly indented! Traceback (most recent call
> last):
>   File
> "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/c
> onfig/multiconfig.py", line 48, in _importConfigModule module =
> __import__(name, globals(), {})
>   File "/srv/moin-private/wiki/wikiconfig.py", line 176
>     xapian_search = 1
>     ^
> IndentationError: unexpected indent

[...]

> MoinMoin.error.ConfigurationError: IndentationError: unexpected indent
> (wikiconfig.py, line 176)
> 
> The configuration files are Python modules. Therefore, whitespace is
> important. Make sure that you use only spaces, no tabs are allowed here!
> You have to use four spaces at the beginning of the line mostly.

So what this means is that you have to be careful how you edit the file. In 
the wikiconfig.py file, you will see the following close to the top of the 
file:

class Config(DefaultConfig):

Below this, there are lots of different settings that appear indented, 
normally using four spaces at the start of each line, followed by the actual 
text. For example:

    sitename = 'Documentation Wiki'
^^^^
These will be the spaces!

You just need to make sure that below these settings, you add the new setting 
with four spaces and then the actual text:

    xapian_search = 1
^^^^
These will be the spaces!

If you use a tab character and your editor doesn't turn it into spaces, you 
will get an error. Maybe the easiest approach that might still work is to put 
the new setting right below the sitename setting, making sure it lines up 
using spaces.

If you and/or your editor have changed the file to use tabs instead, which 
isn't really recommended, you should also use tabs for the new setting. But 
I'm assuming that your wikiconfig.py file is just a modified version of the 
standard one.

Paul


More information about the moin-user mailing list