# Path: webcheck/db.py
# class Link(Base):
# class LinkProblem(Base):
# class PageProblem(Base):
# class Anchor(Base):
# class RequestedAnchor(Base):
#     def clean_url(url):
#     def get_or_create(session, url):
#     def _get_child(self, url):
#     def _mk_unicode(self, message):
#     def set_encoding(self, encoding):
#     def add_redirect(self, url):
#     def add_linkproblem(self, message):
#     def add_pageproblem(self, message):
#     def add_child(self, url):
#     def add_embed(self, url):
#     def add_anchor(self, anchor):
#     def add_reqanchor(self, parent, anchor):
#     def follow_link(self, visited=None):
#     def count_parents(self):
#     def parents(self):
#     def __unicode__(self):
#     def __unicode__(self):
#     def __unicode__(self):
#     def __unicode__(self):
# def setup_db(filename):
# def truncate_db():


from webcheck.db import Session, Link, Anchor
# 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.

"""Find references to undefined anchors.

This plugin does not output any files, it just finds problems."""

__title__ = 'missing anchors'
__author__ = 'Arthur de Jong'



def postprocess(crawler):
    """Add all missing anchors as page problems to the referring page."""
    session = Session()
    # find all fetched links with requested anchors

# Path: webcheck/db.py
# class Link(Base):
# class LinkProblem(Base):
# class PageProblem(Base):
# class Anchor(Base):
# class RequestedAnchor(Base):
#     def clean_url(url):
#     def get_or_create(session, url):
#     def _get_child(self, url):
#     def _mk_unicode(self, message):
#     def set_encoding(self, encoding):
#     def add_redirect(self, url):
#     def add_linkproblem(self, message):
#     def add_pageproblem(self, message):
#     def add_child(self, url):
#     def add_embed(self, url):
#     def add_anchor(self, anchor):
#     def add_reqanchor(self, parent, anchor):
#     def follow_link(self, visited=None):
#     def count_parents(self):
#     def parents(self):
#     def __unicode__(self):
#     def __unicode__(self):
#     def __unicode__(self):
#     def __unicode__(self):
# def setup_db(filename):
# def truncate_db():


# Path: webcheck/plugins/anchors.py
from webcheck.db import Session, Link, Anchor

# 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.

"""Find references to undefined anchors.

This plugin does not output any files, it just finds problems."""

__title__ = 'missing anchors'
__author__ = 'Arthur de Jong'



def postprocess(crawler):
    """Add all missing anchors as page problems to the referring page."""
    session = Session()
    # find all fetched links with requested anchors

    links = session.query(Link).filter(Link.reqanchors.any())