From 1e972a3af486d1e7fb93eacc2c810fe1a30a0c75 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sun, 24 Jul 2005 08:55:02 +0000 Subject: rename whatsold and whatsnew plugins to old and new git-svn-id: http://arthurdejong.org/svn/webcheck/webcheck@85 86f53f14-5ff3-0310-afe5-9b438ce3f40c --- config.py | 4 ++-- plugins/new.py | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/old.py | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/whatsnew.py | 56 --------------------------------------------------- plugins/whatsold.py | 58 ----------------------------------------------------- 5 files changed, 116 insertions(+), 116 deletions(-) create mode 100644 plugins/new.py create mode 100644 plugins/old.py delete mode 100644 plugins/whatsnew.py delete mode 100644 plugins/whatsold.py diff --git a/config.py b/config.py index a0e4b74..4364c8e 100644 --- a/config.py +++ b/config.py @@ -65,8 +65,8 @@ PLUGINS = ["sitemap", "external", "notchkd", "badlinks", - "whatsold", - "whatsnew", + "old", + "new", "slow", "notitles", "problems", diff --git a/plugins/new.py b/plugins/new.py new file mode 100644 index 0000000..c4b25cf --- /dev/null +++ b/plugins/new.py @@ -0,0 +1,56 @@ + +# new.py - plugin to list recently modified pages +# +# 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 + +"""Present a list of recently modified pages.""" + +__title__ = "what's new" +__author__ = 'Arthur de Jong' +__version__ = '1.1' +__description__ = 'These pages habe been recently modified.' + +import config +import plugins +import time + +SECS_PER_DAY=60*60*24 + +def generate(fp,site): + """Output the list of recently modified pages to the specified file descriptor.""" + fp.write('
    \n') + links=site.linkMap.values() + links.sort(lambda a, b: cmp(b.mtime, a.mtime)) + for link in links: + if not link.ispage: + continue + if link.mtime is None: + continue + if not link.isinternal: + continue + age = (time.time()-link.mtime)/SECS_PER_DAY + if (age is not None) and (age <= config.REPORT_WHATSNEW_URL_AGE): + fp.write( + '
  • \n' \ + ' %(link)s\n' \ + '
    age: %(age)d days
    \n' \ + '
  • \n' \ + % { 'link': plugins.make_link(link), + 'age': age }) + fp.write('
\n') diff --git a/plugins/old.py b/plugins/old.py new file mode 100644 index 0000000..376aca0 --- /dev/null +++ b/plugins/old.py @@ -0,0 +1,58 @@ + +# old.py - plugin to list old pages +# +# 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 + +"""Present a list of potentially outdated pages.""" + +__title__ = "what's old" +__author__ = 'Arthur de Jong' +__version__ = '1.1' +__description__ = 'These pages habe been modified a long time ago and may be outdated.' + +import config +import plugins +import time + +SECS_PER_DAY=60*60*24 + +def generate(fp,site): + """Output the list of outdated pages to the specified file descriptor.""" + fp.write('
    \n') + links=site.linkMap.values() + links.sort(lambda a, b: cmp(a.mtime, b.mtime)) + for link in links: + if not link.ispage: + continue + if link.mtime is None: + continue + if not link.isinternal: + continue + age = (time.time()-link.mtime)/SECS_PER_DAY + if age and (age >= config.REPORT_WHATSOLD_URL_AGE): + fp.write( + '
  • \n' \ + ' %(link)s\n' \ + '
    age: %(age)d days
    \n' \ + '
  • \n' \ + % { 'link': plugins.make_link(link), + 'age': age }) + # add link to problem database + plugins.add_problem('Old Link: %d days old' % age ,link) + fp.write('
\n') diff --git a/plugins/whatsnew.py b/plugins/whatsnew.py deleted file mode 100644 index 8392d8c..0000000 --- a/plugins/whatsnew.py +++ /dev/null @@ -1,56 +0,0 @@ - -# whatsnew.py - plugin to list recently modified pages -# -# 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 - -"""Present a list of recently modified pages.""" - -__title__ = "what's new" -__author__ = 'Arthur de Jong' -__version__ = '1.1' -__description__ = 'These pages habe been recently modified.' - -import config -import plugins -import time - -SECS_PER_DAY=60*60*24 - -def generate(fp,site): - """Output the list of recently modified pages to the specified file descriptor.""" - fp.write('
    \n') - links=site.linkMap.values() - links.sort(lambda a, b: cmp(b.mtime, a.mtime)) - for link in links: - if not link.ispage: - continue - if link.mtime is None: - continue - if not link.isinternal: - continue - age = (time.time()-link.mtime)/SECS_PER_DAY - if (age is not None) and (age <= config.REPORT_WHATSNEW_URL_AGE): - fp.write( - '
  • \n' \ - ' %(link)s\n' \ - '
    age: %(age)d days
    \n' \ - '
  • \n' \ - % { 'link': plugins.make_link(link), - 'age': age }) - fp.write('
\n') diff --git a/plugins/whatsold.py b/plugins/whatsold.py deleted file mode 100644 index dfe5557..0000000 --- a/plugins/whatsold.py +++ /dev/null @@ -1,58 +0,0 @@ - -# whatsold.py - plugin to list old pages -# -# 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 - -"""Present a list of potentially outdated pages.""" - -__title__ = "what's old" -__author__ = 'Arthur de Jong' -__version__ = '1.1' -__description__ = 'These pages habe been modified a long time ago and may be outdated.' - -import config -import plugins -import time - -SECS_PER_DAY=60*60*24 - -def generate(fp,site): - """Output the list of outdated pages to the specified file descriptor.""" - fp.write('
    \n') - links=site.linkMap.values() - links.sort(lambda a, b: cmp(a.mtime, b.mtime)) - for link in links: - if not link.ispage: - continue - if link.mtime is None: - continue - if not link.isinternal: - continue - age = (time.time()-link.mtime)/SECS_PER_DAY - if age and (age >= config.REPORT_WHATSOLD_URL_AGE): - fp.write( - '
  • \n' \ - ' %(link)s\n' \ - '
    age: %(age)d days
    \n' \ - '
  • \n' \ - % { 'link': plugins.make_link(link), - 'age': age }) - # add link to problem database - plugins.add_problem('Old Link: %d days old' % age ,link) - fp.write('
\n') -- cgit v1.2.3