Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/plugins/about.py
blob: 9e6d5fa6c3780948e53a200c7e7f2726975916d9 (plain)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105

# about.py - plugin to list some information about used plugins
#
# Copyright (C) 1998, 1999 Albert Hopkins (marduk)
# Copyright (C) 2002 Mike W. Meyer
# Copyright (C) 2005 Arthur de Jong
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
#
# The files produced as output from the software do not automatically fall
# under the copyright of the software, unless explicitly stated otherwise.

"""Present an overview of the plugins that are used."""

__title__ = 'about webcheck'
__author__ = 'Arthur de Jong'
#__description__ = 'This is a more detailed view of the used plugins.'

import config
import plugins
import time

def generate(fp,site):
    """Output a list of modules, it's authors and it's version to the file descriptor."""
    # TODO: xxx links weere fetched, xxx pages were examined and a total of xxx notes and problems were found
    # TODO: include some runtime information (e.g. supported schemes, user configuration, etc)
    # output some general information about the report
    fp.write(
      '   <p>\n' \
      '    This is a website report generated by <tt>webcheck</tt> %(version)s.\n'
      '    <tt>webcheck</tt> is a website checking tool for webmasters. It\n'
      '    crawls a given website and does a number of tests to see if links\n'
      '    and pages are valid.\n' \
      '    More information about <tt>webcheck</tt> can be found at the\n' \
      '    <tt>webcheck</tt> homepage which is located at\n' \
      '    <a href="%(homepage)s">%(homepage)s</a>.\n' \
      '   </p>\n' \
      '   <p>\n' \
      '    This report was generated on %(time)s, a total of %(numurls)d links were found.\n'
      '   </p>\n\n' \
      % { 'version':  plugins.escape(config.VERSION),
          'time':     plugins.escape(time.ctime(time.time())),
          'numurls':  len(site.linkMap),
          'homepage': config.HOMEPAGE } )
    # output copyright information
    fp.write(
      '   <h3>Copyright</h3>\n' \
      '   <p>\n' \
      '    <tt>webcheck</tt> was originally named <tt>linbot</tt> which was developed\n' \
      '    by Albert Hopkins (marduk).\n' \
      '    Versions up till 1.0 were maintained by Mike W. Meyer who changed the name\n' \
      '    to <tt>webcheck</tt>.\n' \
      '    After that Arthur de Jong took up the work and did a complete rewrite.\n' \
      '   </p>\n' \
      '   <p>\n' \
      '    Copyright &copy; 1998, 1999 Albert Hopkins (marduk)<br />\n' \
      '    Copyright &copy; 2002 Mike W. Meyer<br />\n' \
      '    Copyright &copy; 2005 Arthur de Jong\n' \
      '   </p>\n' \
      '   <p>\n' \
      '    This program is <i>free software</i>; you can redistribute it and/or\n' \
      '    modify it under the terms of the GNU General Public License as published\n' \
      '    by the Free Software Foundation; either version 2, or (at your option) any\n' \
      '    later version.\n' \
      '   </p>\n' \
      '   <p>\n' \
      '    This program is distributed in the hope that it will be useful, but\n' \
      '    <i>without any warranty</i>; without even the implied warranty of\n' \
      '    <i>merchantability</i> or <i>fitness for a particular purpose</i>. See the\n' \
      '    GNU General Public License for more details.\n' \
      '   </p>\n' \
      '   <p>\n' \
      '    A copy of the GNU General Public License is available in the download\n' \
      '    and can be found on the World Wide Web at\n' \
      '    <a href="http://www.gnu.org/copyleft/gpl.html">http://www.gnu.org/copyleft/gpl.html</a>.\n' \
      '    You can also obtain it by writing to the Free Software Foundation, Inc.,\n' \
      '    51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA.\n' \
      '   </p>\n\n' )
    # output plugin information
    fp.write(
      '   <h3>Plugins</h3>\n' \
      '   <ul>\n')
    for plugin in config.PLUGINS:
        report = __import__('plugins.'+plugin,globals(),locals(),[plugin])
        fp.write(
          '    <li>\n' \
          '      <strong>%s</strong><br />\n' \
          % plugins.escape(report.__title__) )
        if hasattr(report,"__doc__"):
            fp.write('      %s<br />\n' % plugins.escape(report.__doc__))
        #if hasattr(report,"__author__"):
        #    fp.write('      author: %s<br />\n' % plugins.escape(report.__author__))
    fp.write('   </ul>\n')