Tuesday, August 2, 2016

I continued on #1089 and found the explanation. The new appy.pod seems more strict about whitespace in for statements.

The real error message (which I saw after rendering the document with raiseOnError=False was:

Bad “for” expression “row in”. A “for” expression must be of the form: {name} in {expression}. {name} must be a Python variable name. It is the name of the iteration variable. {expression} is a Python expression that, when evaluated, produces a Python sequence (tuple, string, list, etc).

The template used to render ISIP contracts contained the following statement at three places:

do text for p in self.contractpartner_set.all()

The problem disappeared after I had gone through all three statements, deleted the whitespace between “p” and “in”, and inserted a new space. Don’t ask me what was wrong with the previous whitespace. There was no visible difference. I was (h)appy that it worked and didn’t want to investigate the content.xml.

Inline strong start-string without end-string

Yet another problem caused indirectly by the Ubuntu upgrade: I cannot build the docs for atelier (without setting tolerate_sphinx_warnings to True):

atelier/atelier/tasks.py:docstring of atelier.tasks:0: WARNING: Inline strong start-string without end-string.

This is actually an old problem. It comes because autosummary includes imported objects (and because some external code may contain invalid docstrings). See Sphinx ticket #1061. I manualy patched my copy of Sphinx as explained there.

Transferred GitHub repositories for Lino and Lino Book

I transferred ownership of the GitHub repositories for Lino and Lino Book from my personal account to our team account, and I renamed “lino_book” to simply “book”.

Old

New

https://github.com/lsaffre/lino

https://gitlab.com/lino-framework/lino

https://github.com/lsaffre/lino_book

https://github.com/lino-framework/book

As explained in About repository transfers I then was supposed to do:

$ cd ~/repositories/lino
$ git remote set-url origin https://gitlab.com/lino-framework/lino.git
$ cd ~/repositories/book
$ git remote set-url origin https://github.com/lino-framework/book.git

Formatting Belgian national id numbers

The national_id of a BeIdCardHolder is now being formatted and validated immediately when the object is saved.

This behaviour is optional, though. In order to activate it, you must set lino_xl.lib.beid.mixins.BeIdCardHolder.validate_national_id to True. This is because in Lino Welfare they might not want it.

In Lino Voga they now see the MessagesByOwner panel on every partner view.

Yet another documentation bug

Grigorij found yet another “bug” in The Lino Polls tutorial: The “config” directory must not be “under your project directory” but in the “mysite” directory.

I also noted that the <div class=”htmlText”> is no longer necessary since we now have lino.modlib.extjs.ext_renderer.ExtRenderer.html_text().

Sphinx: search index couldn’t be loaded

The following warning is nagging me:

Warning, treated as error:
WARNING: search index couldn't be loaded, but not all documents will be built: the index will be incomplete.

It seems that the html builder has a problem when loading an existing searchindex.js file. (the exception there is an IOError “read error at pos 99758”). And because I use -W, I cannot do an incremental build any more. As a temporary workaround I patched my copy of Sphinx sphinx/builders/html.py. Before:

except (IOError, OSError, ValueError):
    if keep:
        self.warn('search index couldn\'t be loaded, but not all '
                  'documents will be built: the index will be '
                  'incomplete.'.)

After:

except (IOError, OSError, ValueError) as e:
    if keep:
        self.info('search index couldn\'t be loaded, but not all '
                  'documents will be built: the index will be '
                  'incomplete. ({})'.format(e))

Lino and Django 1.10

Yes, lino_xl.lib.sepa.fields still uses SubfieldBase. Django 1.9 issues a DeprecationWarning, and Django 1.10 says AttributeError: 'module' object has no attribute 'SubfieldBase'.