[moin-user] Help on xapian configuration

mor fall fall.mor at outlook.com
Tue Jul 24 09:38:38 EDT 2018


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.





(python-env) fall at mor:/srv/moin-private/python-env/bin$ moin --config-dir=/srv/moin-private/wiki --wiki-url=localhost/ index build --mode=add
2018-07-24 15:00:43,723 INFO MoinMoin.log:151 using logging configuration read from built-in fallback in MoinMoin.log module
2018-07-24 15:00:43,743 INFO MoinMoin.log:157 Running MoinMoin 1.9.9 release code from /srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin
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/config/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
Traceback (most recent call last):
  File "/srv/moin-private/python-env/bin/moin", line 6, in <module>
    run()
  File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/script/moin.py", line 15, in run
    MoinScript().run(showtime=0)
  File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/script/__init__.py", line 138, in run
    self.mainloop()
  File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/script/__init__.py", line 266, in mainloop
    plugin_class(args[2:], self.options).run() # all starts again there
  File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/script/__init__.py", line 138, in run
    self.mainloop()
  File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/script/index/build.py", line 80, in mainloop
    self.init_request()
  File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/script/__init__.py", line 185, in init_request
    self.request = ScriptContext(url, self.options.page)
  File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/web/contexts.py", line 439, in __init__
    wsgiapp.init(self)
  File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/wsgiapp.py", line 52, in init
    context.lang = setup_i18n_preauth(context)
  File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/wsgiapp.py", line 241, in setup_i18n_preauth
    i18n.i18n_init(context)
  File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/i18n/__init__.py", line 73, in i18n_init
    meta_cache = caching.CacheEntry(request, 'i18n', 'meta', scope='wiki', use_pickle=True)
  File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/caching.py", line 73, in __init__
    self.arena_dir = get_arena_dir(request, arena, scope)
  File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/caching.py", line 32, in get_arena_dir
    return os.path.join(request.cfg.cache_dir, request.cfg.siteid, arena)
  File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/web/contexts.py", line 56, in get
    res = obj.environ.setdefault(self.name, factory(obj))
  File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/web/contexts.py", line 128, in cfg
    cfg = multiconfig.getConfig(self.request.url)
  File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/config/multiconfig.py", line 193, in getConfig
    cfg = _makeConfig(cfgName)
  File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/config/multiconfig.py", line 123, in _makeConfig
    module, mtime = _importConfigModule(name)
  File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/config/multiconfig.py", line 62, in _importConfigModule
    raise error.ConfigurationError(msg)
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.

regards,




________________________________
De : moin-user <moin-user-bounces+fall.mor=outlook.com at python.org> de la part de Paul Boddie <paul at boddie.org.uk>
Envoyé : lundi 23 juillet 2018 22:19
À : moin-user at python.org
Objet : Re: [moin-user] Help on xapian configuration

On Monday 23. July 2018 21.31.40 mor fall wrote:
> Hello
> I need help,
> I v installed and configured my moinmoin wiki on a virtualenv but I am
> having lots of problems to configure xapian. If anyone here have a
> tutorial that explains clearly the way to configure xapian on moinmoin it
> may be very beneficial for me.

Are you having problems installing the Xapian software itself, or are you
satisfied that Xapian is properly installed and now find yourself with
problems configuring MoinMoin to use it?

Last time I had to install or upgrade Xapian, I had to install lots of other
things, and it took a lot more work than it previously did. But it should be
something like this:

wget https://oligarchy.co.uk/xapian/1.4.5/xapian-core-1.4.5.tar.xz
cd xapian-core-1.4.5/
./configure --prefix=/myprefix
make
make install
cd ..

wget https://oligarchy.co.uk/xapian/1.4.5/xapian-bindings-1.4.5.tar.xz
cd xapian-bindings-1.4.5/
./configure --with-python --prefix=/myprefix \
  PYTHON_LIB=/myprefix/lib/python2.7 PYTHON=/myprefix/bin/python2.7
make
make install
cd ..

Here, /myprefix is the usual "prefix" that indicates where the libraries
should be installed. With the bindings, the PYTHON_LIB and PYTHON variables
are needed to tell the configure script about the Python installation. This is
something of a peculiarity with this package, and the configure script will
complain if you don't specify them.

The configure script will also complain about things like Sphinx as far as I
remember, and it was with Sphinx that I had to track down lots of dependencies
(typing, six, docutils, Babel, Jinja2, MarkupSafe, packaging, imagesize,
requests, urllib3, certifi, idna, alabaster) which your virtualenv might
already have.

As far as configuring MoinMoin is concerned, adding this to the class in your
wikiconfig.py should be enough:

  xapian_search = 1

You then need to create an index:

moin --config-dir=/wiki --wiki-url=wikisite.tld/ index build --mode=add

Here, /wiki is the place where the wikiconfig.py file is found, also
containing the data directory.

There can be all sorts of problems here: permissions, locks, configuration
errors. But let us know where you are now and whether this is helpful. Then we
might be able to see you through the process.

Paul
_______________________________________________
moin-user mailing list
moin-user at python.org
https://mail.python.org/mailman/listinfo/moin-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/moin-user/attachments/20180724/14a2c0a0/attachment-0001.html>


More information about the moin-user mailing list