Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

# -*- coding: UTF-8 -*- 

# Copyright 2012-2015 Luc Saffre 

# License: BSD (see file COPYING for details) 

 

""".. management_command:: diag 

 

Writes a diagnostic status report about this Site. 

 

This is a command-line shortcut for calling 

:meth:`lino.core.site.Site.diagnostic_report_rst`. 

 

""" 

 

from __future__ import print_function 

 

from django.core.management.base import BaseCommand 

from django.conf import settings 

 

 

class Command(BaseCommand): 

    help = __doc__ 

 

    def handle(self, *args, **options): 

 

        encoding = self.stdout.encoding or 'utf-8' 

 

        def writeln(ln=''): 

            self.stdout.write(ln.encode(encoding, "xmlcharrefreplace") + "\n") 

 

        settings.SITE.startup() 

        writeln(settings.SITE.diagnostic_report_rst(*args))