20131018 (Friday, 18 October 2013)

Lino Faggio

Continued on yesterday’s “To-Do-Liste Sven” (2013-10-17).

  • The cal.Calendar model is back. I had replaced it by a system of subscriptions where each user could define application-specific filter criteria per Subscription. This resulted in a system where it was possible for an Event to appear in different Calendars. Which would have been nice, but the problem with that idea is that Ext.ensible.CalendarPanel isn’t designed for it, it wants a list of calendars and each Event pointing to exactly one of them.

    So I return back to almost the old system (and that “almost” is what Lino has learned): cal.Event has no direct FK to Calendar, but a get_calendar method. And Lino Welfare users see one Calendar per User while Renamed “Lino Faggio” to “Lino Voga” users see one Calendar per Room.

  • Updated the Lino Welfare test suite to several recent changes.

  • New item “Once” in Recurrences.

  • insert_layout for courses.Line

  • New field courses.Line every_unit (Recurrences)

Split up lino_xl.lib.cal into more digestable chunks: models_task models_guest models_event models_calendars

In a first checkin I had tried to turn lino_xl.lib.cal into a package containing the above files. But that would require me to add an explicit app_label (the feature that app_label “is no longer required for models that are defined in a models package within an app” is only available in the development version).

I also did the mistake of naming them task, guest, event and calendar in a first go. And didn’t notice that a module called calendar is part of the Python standard library. The funny thing was that this bomb didn’t explode in the Lino test suite, only in Lino Welfare:

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/luc/hgwork/atelier/atelier/doctest_utf8.py", line 52, in <module>
    sys.exit(_test())
  File "/home/luc/hgwork/atelier/atelier/doctest_utf8.py", line 38, in _test
    m = __import__(filename[:-3])
  File "lino/modlib/cal/utils.py", line 31, in <module>
    from north.utils import to_locale
  File "/home/luc/hgwork/north/north/__init__.py", line 16, in <module>
    from north.site import Site
  File "/home/luc/hgwork/north/north/site.py", line 10, in <module>
    from djangosite import Site, DJANGO_DEFAULT_LANGUAGE, assert_django_code
  File "/home/luc/hgwork/site/djangosite/__init__.py", line 36, in <module>
    from atelier.utils import AttrDict, ispure
  File "/home/luc/hgwork/atelier/atelier/utils.py", line 17, in <module>
    from dateutil import parser as dateparser
  File "/home/luc/pythonenvs/py27/local/lib/python2.7/site-packages/dateutil/parser.py", line 26, in <module>
    from . import relativedelta
  File "/home/luc/pythonenvs/py27/local/lib/python2.7/site-packages/dateutil/relativedelta.py", line 10, in <module>
    import calendar
  File "lino/modlib/cal/calendar.py", line 27, in <module>
    from django.db import models
  File "/home/luc/pythonenvs/py27/local/lib/python2.7/site-packages/django/db/__init__.py", line 11, in <module>
    if settings.DATABASES and DEFAULT_DB_ALIAS not in settings.DATABASES:
  File "/home/luc/pythonenvs/py27/local/lib/python2.7/site-packages/django/conf/__init__.py", line 53, in __getattr__
    self._setup(name)
  File "/home/luc/pythonenvs/py27/local/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in _setup
    self._wrapped = Settings(settings_module)
  File "/home/luc/pythonenvs/py27/local/lib/python2.7/site-packages/django/conf/__init__.py", line 132, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/home/luc/pythonenvs/py27/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "lino/__init__.py", line 79, in <module>
    from .site import Site
  File "lino/site.py", line 103, in <module>
    from lino.utils.xmlgen import html as xghtml
  File "lino/utils/__init__.py", line 60, in <module>
    from atelier.utils import AttrDict, iif, ispure, assert_pure, confirm
ImportError: cannot import name AttrDict

An interesting example of a subtle pitfall!

Citadel

Oops, it seems that citadel caused some trouble to my mailman configuration…

(demo)luc@vps:~$ sudo aptitude purge citadel-server

The following packages will be REMOVED:
  citadel-server{p}
0 packages upgraded, 0 newly installed, 1 to remove and 40 not upgraded.
Need to get 0 B of archives. After unpacking 2,470 kB will be freed.
Do you want to continue? [Y/n/?]
(Reading database ... 44499 files and directories currently installed.)
Removing citadel-server ...
.Purging configuration files for citadel-server ...
/var/lib/citadel/data not removed, as it may contain your personal data.
dpkg: warning: while removing citadel-server, directory '/var/spool/citadel/network' not empty so not removed.
dpkg: warning: while removing citadel-server, directory '/var/spool/citadel' not empty so not removed.
dpkg: warning: while removing citadel-server, directory '/var/lib/citadel/data' not empty so not removed.
dpkg: warning: while removing citadel-server, directory '/var/lib/citadel' not empty so not removed.
Processing triggers for man-db ...




(demo)luc@vps:~$ sudo rm -R /var/spool/citadel
(demo)luc@vps:~$ sudo rm -R /var/lib/citadel

(demo)luc@vps:~$ sudo aptitude purge libcitadel2


(demo)luc@vps:~$ sudo tail -f /var/log/mail.log
(demo)luc@vps:~$ sudo /etc/init.d/postfix restart


Oct 18 14:15:28 vps postfix/local[18004]: EB4F42A2502: to=<www-data@lino-framework.org>, orig_to=<www-data>, relay=local, delay=1319126, delays=1319126/0/0/0.01, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")
Oct 18 14:15:28 vps postfix/qmgr[15874]: EB4F42A2502: removed
Oct 18 14:15:29 vps postfix/pickup[15873]: F07572A24F9: uid=33 from=<www-data>
Oct 18 14:15:29 vps postfix/cleanup[18044]: F07572A24F9: message-id=<20131018101528.F07572A24F9@lino-framework.org>
Oct 18 14:15:29 vps postfix/qmgr[15874]: F07572A24F9: from=<www-data@lino-framework.org>, size=985, nrcpt=1 (queue active)
Oct 18 14:15:29 vps postfix/local[18046]: EFBF02A24D2: to=<www-data@lino-framework.org>, orig_to=<www-data>, relay=local, delay=23727, delays=23727/0.01/0/0.01, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")
Oct 18 14:15:29 vps postfix/qmgr[15874]: EFBF02A24D2: removed
Oct 18 14:15:29 vps postfix/local[18089]: F07572A24F9: to=<www-data@lino-framework.org>, orig_to=<www-data>, relay=local, delay=755726, delays=755726/0/0/0, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")
Oct 18 14:15:29 vps postfix/qmgr[15874]: F07572A24F9: removed
Oct 18 14:15:35 vps postfix/local[16188]: 2DBCD2A3BB9: to=<www-data@lino-framework.org>, orig_to=<www-data>, relay=local, delay=649533, delays=649499/0.65/0/33, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")
Oct 18 14:15:35 vps postfix/qmgr[15874]: 2DBCD2A3BB9: removed


(demo)luc@vps:~$ sudo /etc/init.d/mailman restart


(demo)luc@vps:~$ sudo less /var/log/mailman/vette

Oct 17 15:43:31 2013 (5058) kakoor: Discarded posting:
        From: dtuulik@gmail.com
        Subject: Re: Kontsertreis Saksamaale 23.-30. sept. 2013
        Reason: Palun l<FC>henda adressaatide nimekirja: see on liiga pikk.
Oct 17 15:44:18 2013 (5061) kakoor: Discarded posting:
        From: reet.lend@ksg.edu.ee
        Subject: =?iso-8859-15?Q?Proov_8.10_ja_laulmine_L=F5ikust=E4nup=FChal_13.10?=
        Reason: Kiri oli liiga suur; palun l<FC>hendage seda nii, et see oleks v<E4>iksem kui 40 KB.
/var/log/mailman/vette (END)

Sent a test mail to kakoor:

/var/log/mailman/error shows:

Oct 18 14:23:09 2013 (18198) send_digests() failed: [Errno 13] Permission denied
: '/var/lib/mailman/archives/private/kakoor/attachments'
Oct 18 14:23:10 2013 (18195) Archive file access failure:
        /var/lib/mailman/archives/private/kakoor.mbox/kakoor.mbox [Errno 13] Permission denied: '/var/lib/mailman/archives/private/kakoor.mbox/kakoor.mbox'
Oct 18 14:23:10 2013 (18195) Uncaught runner exception: [Errno 13] Permission denied: '/var/lib/mailman/archives/private/kakoor.mbox/kakoor.mbox'
Oct 18 14:23:10 2013 (18195) Traceback (most recent call last):
  File "/var/lib/mailman/Mailman/Queue/Runner.py", line 120, in _oneloop
    self._onefile(msg, msgdata)
  File "/var/lib/mailman/Mailman/Queue/Runner.py", line 191, in _onefile
    keepqueued = self._dispose(mlist, msg, msgdata)
  File "/var/lib/mailman/Mailman/Queue/ArchRunner.py", line 73, in _dispose
    mlist.ArchiveMail(msg)
  File "/var/lib/mailman/Mailman/Archiver/Archiver.py", line 198, in ArchiveMail
    self.__archive_to_mbox(msg)
  File "/var/lib/mailman/Mailman/Archiver/Archiver.py", line 167, in __archive_to_mbox
    mbox = self.__archive_file(afn)
  File "/var/lib/mailman/Mailman/Archiver/Archiver.py", line 155, in __archive_file
    return Mailbox.Mailbox(open(afn, 'a+'))
IOError: [Errno 13] Permission denied: '/var/lib/mailman/archives/private/kakoor:


root@vps:/var/log/mailman# ls -al /var/lib/mailman/archives/private/kakoor
total 12
drwxrwsr-x 2 root www-data 4096 Jul 30 15:14 .
drwxrws--- 8 list www-data 4096 Aug 26 15:53 ..
-rw-rw-r-- 1 root www-data  503 Jul 30 15:14 index.html



$ sudo new_list pppk
$ sudo nano /etc/aliases (add aliases as instructed and run)
$ sudo newaliases

$ sudo nano /etc/postfix/valias.txt
$ sudo postmap /etc/postfix/valias.txt