# 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/output.py
# def render(output_file, **kwargs):
#     """Render the output file with the specified context variables."""
#     kwargs.setdefault('webcheck', webcheck)
#     kwargs.setdefault('output_file', output_file)
#     kwargs.setdefault('time', time.ctime(time.time()))
#     kwargs.setdefault('Link', Link)
#     kwargs.setdefault('config', config)
#     template = env.get_template(output_file)
#     fp = open_file(output_file)
#     fp.write(template.render(**kwargs))
#     fp.close()


from webcheck.db import Session, Link
from webcheck.output import render
# 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 a list of images that are on the site."""

__title__ = 'images'
__author__ = 'Arthur de Jong'
__outputfile__ = 'images.html'



def generate(crawler):
    """Generate a list of image URLs that were found."""
    session = Session()
    # get non-page links that have an image/* mimetype
    links = session.query(Link)
    links = links.filter((Link.is_page != True) | (Link.is_page == None))
    links = links.filter(Link.mimetype.startswith('image/'))

# 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/output.py
# def render(output_file, **kwargs):
#     """Render the output file with the specified context variables."""
#     kwargs.setdefault('webcheck', webcheck)
#     kwargs.setdefault('output_file', output_file)
#     kwargs.setdefault('time', time.ctime(time.time()))
#     kwargs.setdefault('Link', Link)
#     kwargs.setdefault('config', config)
#     template = env.get_template(output_file)
#     fp = open_file(output_file)
#     fp.write(template.render(**kwargs))
#     fp.close()


# Path: webcheck/plugins/images.py
from webcheck.db import Session, Link
from webcheck.output import render

# 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 a list of images that are on the site."""

__title__ = 'images'
__author__ = 'Arthur de Jong'
__outputfile__ = 'images.html'



def generate(crawler):
    """Generate a list of image URLs that were found."""
    session = Session()
    # get non-page links that have an image/* mimetype
    links = session.query(Link)
    links = links.filter((Link.is_page != True) | (Link.is_page == None))
    links = links.filter(Link.mimetype.startswith('image/'))

    links = links.order_by(Link.url)