Wednesday, July 29, 2015

Today I finally continued to edit the StageForem.odt template for immersion contracts. They really want to edit this file manually using the .rtf format.

Lino Noi

Before actually starting to work, I triaged my own tickets after yesterday’s optimizations. An activity which is currently deemed to mix up with more optimizations to Lino Noi.

  • Changed some column layouts
  • The checkboxes standby and feedback are no longer used.

Cannot add column with master_key

Above optimizations also caused a optimization to the framework itself: Users (until today) were not able to manually add, in the grid of a slave table, the column of the master key. Even when the column_names contained a * wildcard.

For example when I have the following table definition:

class TicketsByProject(Tickets):
    master_key = 'project'
    column_names = "overview product reporter state *"

then it was not possible to manually add the column “Project”.

That was because the master_key was not automatically added as hidden element.

About Linux user permissions

Yet another subtle problem: when I change the umask in Apache’s /etc/apache2/envvars configuration file from the default 0022 to 0002, then any new files generated by Lino will be group writable. This is my preferred configuration because I can then avoid permission conflicts by defining myself as member of the www-data group (and make sure to run chmod g+w on every file I create). Permission conflics are possible for

  • log files
  • generated printable files
  • local config files (when exposed via webdav)

All this seems clear and understandable. But for AppyPdfBuildMethod it gets more complicated, and I did not yet fully understand. Currently the files get created with owner root and no write permission for group.

It has probably to do with the fact that Lino (or more precisely appy.shared.utils) here runs a subprocess for converting the .odt file to .pdf:

childStdIn, childStdOut, childStdErr = os.popen3(cmd)

Editing the template

The EditTemplate action had a subtle bug: For printables with more than one template group, when creating a local copy of the factory template, it copied the factory file to the directory given by the last group. But it must select the directory given by the first group.

For example when printing an excerpts.Excerpt, we have two template groups: the first is given by the owner (e.g. “immersion/Contract”) and the second is just “excerpts”.

Added a test case to Miscellaneous.

“This will discard all changes in the generated file”

And yet another bug fixed (in ClearCacheAction):

The confirmation message This will discard all changes in the generated file. (Ceci va écraser toute modification manuelle dans le document généré. D'accord ?) came even when the generated file was a .pdf file which certainly does not contain user changes. This was because we must remove the microseconds from the datetime returned by get_cache_mtime because Django’s DateTimeField ignores them.

Miscellaneous

Three fields (template, overlap_group and full_name) were missing in the detail_layout of lino_welfare.modlib.immersion.models.ContractTypes.

Getting Lino to pass on Travis CI

The current error message is Exception: Oops, cannot use /home/travis/build/lsaffre/lino/polly for lino.projects.polly.settings.Site because it is used for lino.projects.polly.settings.demo.Site.

So I changed the script instruction in Lino’s .travis.yml file so that it now deletes the LINO_CACHE_ROOT directory for each build:

export LINO_CACHE_ROOT=$TRAVIS_BUILD_DIR/lino_cache
rm -R $LINO_CACHE_ROOT
mkdir $LINO_CACHE_ROOT
fab initdb test

Which didn’t help.