Sunday, August 7, 2016

An equivalent of startproject for Lino

Once more thanks to Grigorij who reported his problems with the A Local Exchange Trade System. His report made me see the next steps I can do for making the Developer's Guide better.

Two immediate changes to the current A Local Exchange Trade System:

  • Remove the last line from your file (the one which says from .ui import *) and rename to This is because we now have layout_name.
  • In your, change “self.modules” to “self.actors”. (See

Note, Grigorij, that these changes are not related to your problems. Your problems come probably because the tutorial uses somewhat hackerish and files.

But more importantly, I started to convert this tutorial into an independent project on GitGub so that it can serve as a template for new Lino applications: Lino Algus.

TODO: Write a tutorial about how to use Lino Algus. Adapt A Local Exchange Trade System.

I had the following error message when doing inv release:

error: Upload failed (403): You are not allowed to edit 'lino-algus' package information

This was simply because on the first release on PyPI you must say register instead of sdist upload.

ImportError: No module named appy_renderer

This one happened on a production server:

Traceback (most recent call last):

  File "env/repositories/xl/lino_xl/lib/lists/", line 41, in <module>
    from lino_xl.lib.appypod.mixins import PrintLabelsAction
  File "env/repositories/xl/lino_xl/lib/appypod/", line 34, in <module>
    from .appy_renderer import AppyRenderer
ImportError: No module named appy_renderer

The problem is here:

$ ls -al env/repositories/xl/lino_xl/lib/appypod
total 96
drwxrwxr-x  3 admin    www-data  4096 Aug  7 06:25 .
drwxrwxr-x 39 admin    www-data  4096 Aug  6 09:41 ..
-rw-rw----  1 admin    admin    24403 Aug  6 09:40
-rw-rw----  1 root     root     18439 Aug  7 06:25 appy_renderer.pyc
-rw-rw-r--  1 admin    www-data  3839 Aug  5 21:04
-rw-rw-r--  1 root     root      3903 Aug  7 06:25 choicelists.pyc
drwxrwxr-x  2 admin    www-data  4096 Aug  5 21:04 config
-rw-rw-r--  1 admin    www-data  1853 Aug  5 21:04
-rw-rw-r--  1 www-data www-data  1576 Aug  6 09:41 __init__.pyc
-rw-rw-r--  1 admin    www-data  4999 Aug  5 21:04
-rw-rw-r--  1 www-data www-data  5293 Aug  6 09:41 mixins.pyc
-rw-rw-r--  1 admin    www-data  1571 Aug  5 21:04
-rw-rw-r--  1 root     root      1147 Aug  7 06:25 models.pyc

The directory doesn’t have the SETGID sticky bit set. The cron job which does a daily snapshot (it runs every morning at 6:25) is running as root.

While working on this I updated File permissions (which becomes better but it still work in process).