Skip to content

Commit

Permalink
Switch the licence to BSD and rewrite module docstrings/headers
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Mar 21, 2012
1 parent d7843b2 commit dcacf9e
Show file tree
Hide file tree
Showing 49 changed files with 469 additions and 1,487 deletions.
20 changes: 15 additions & 5 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
Aymeric Bois
Guillaume Ayoub
Priit Laes
Salem Harrache
Simon Sapin
WeasyPrint is written and maintained by Simon Sapin and
various contributors:

Development Lead
----------------

- Simon Sapin <simon.sapin@kozea.fr>

Other contributors
------------------

- Aymeric Bois
- Guillaume Ayoub
- Priit Laes
- Salem Harrache
6 changes: 6 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 0.7.1, released on 2012-03-21
=====================================

Change the license from AGPL to BSD.


Version 0.7, released on 2012-03-21
===================================

Expand Down
661 changes: 0 additions & 661 deletions COPYING

This file was deleted.

33 changes: 33 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Copyright (c) 2011-2012 by Simon Sapin and contributors.
See AUTHORS for more details.

Some rights reserved.

Redistribution and use in source and binary forms of the software as well
as documentation, with or without modification, are permitted provided
that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.

* The names of the contributors may not be used to endorse or
promote products derived from this software without specific
prior written permission.

THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
7 changes: 6 additions & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
WeasyPrint is a visual rendering engine for HTML and CSS that can export
to PDF. It aims to support web standards for printing. WeasyPrint is free
software released under the BSD license.

WeasyPrint converts web documents (HTML, CSS, ...) to PDF.
It is based on various libraries for parsing, text and drawing but **not**
on full a rendering engines like WebKit on Gecko. The CSS visual rendering
is written in Python and meant to be easy to hack on.

See the website and documentation at http://weasyprint.org/
30 changes: 18 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# coding: utf8
"""
WeasyPrint
----------
WeasyPrint
==========
WeasyPrint converts web documents (HTML, CSS, SVG, ...) to PDF.
WeasyPrint converts web documents to PDF.
See the documentation at http://weasyprint.org/
:copyright: Copyright 2011-2012 Simon Sapin and contributors, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

Expand All @@ -16,8 +18,11 @@
with open(path.join(path.dirname(__file__), 'weasyprint', '__init__.py')) as fd:
VERSION = re.search("VERSION = '([^']+)'", fd.read().strip()).group(1)

with open(path.join(path.dirname(__file__), 'README')) as fd:
LONG_DESCRIPTION = fd.read()

REQUIRES = [

REQUIREMENTS = [
# Keep this in sync with the "install" documentation
'lxml',
'pystacia',
Expand All @@ -30,37 +35,38 @@
]
if sys.version_info < (2, 7) or (3,) <= sys.version_info < (3, 2):
# In the stdlib from 2.7:
REQUIRES.append('argparse')
REQUIREMENTS.append('argparse')

setup(
name='WeasyPrint',
version=VERSION,
url='http://weasyprint.org/',
license='GNU Affero General Public License v3',
license='BSD',
description='WeasyPrint converts web documents to PDF.',
long_description=__doc__,
long_description=LONG_DESCRIPTION,
author='Simon Sapin',
author_email='simon.sapin@kozea.fr',
classifiers=[
'Development Status :: 4 - Beta',
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Affero General Public License v3',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Text Processing :: Markup :: HTML',
'Topic :: Multimedia :: Graphics :: Graphics Conversion',
'Topic :: Printing',
],
packages=find_packages(),
package_data={
'weasyprint.tests': ['resources/*'],
'weasyprint.css': ['*.css']},
zip_safe=False,
install_requires=REQUIRES,
test_suite='weasy.tests',
install_requires=REQUIREMENTS,
test_suite='weasyprint.tests',
entry_points={
'console_scripts': [
'weasyprint = weasyprint.__main__:main',
Expand Down
29 changes: 8 additions & 21 deletions weasyprint/__init__.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,15 @@
# coding: utf8
"""
WeasyPrint
==========
# WeasyPrint converts web documents (HTML, CSS, ...) to PDF.
# Copyright (C) 2011-2012 Simon Sapin and contributors.
# See AUTHORS for more details.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

WeasyPrint converts web documents to PDF.
"""
WeasyPrint
==========
The public API is what is accessible from this "root" packages
without importing sub-modules.
WeasyPrint converts web documents, mainly HTML documents with CSS, to PDF.
:copyright: Copyright 2011-2012 Simon Sapin and contributors, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

Expand Down
25 changes: 6 additions & 19 deletions weasyprint/__main__.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
# coding: utf8
"""
weasyprint.__main__
-------------------
# WeasyPrint converts web documents (HTML, CSS, ...) to PDF.
# Copyright (C) 2011-2012 Simon Sapin and contributors.
# See AUTHORS for more details.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

Command-line interface to WeasyPrint.
"""
Command-line interface to WeasyPrint.
:copyright: Copyright 2011-2012 Simon Sapin and contributors, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

Expand Down
24 changes: 6 additions & 18 deletions weasyprint/compat.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
# coding: utf8
"""
weasyprint.compat
-----------------
# WeasyPrint converts web documents (HTML, CSS, ...) to PDF.
# Copyright (C) 2011-2012 Simon Sapin and contributors.
# See AUTHORS for more details.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
Workarounds for compatibility with Python 2 and 3 in the same code base.
"""
Python 2/3 compatibility.
:copyright: Copyright 2011-2012 Simon Sapin and contributors, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

Expand Down
73 changes: 36 additions & 37 deletions weasyprint/css/__init__.py
Original file line number Diff line number Diff line change
@@ -1,43 +1,42 @@
# coding: utf8
"""
weasyprint.css
--------------
# WeasyPrint converts web documents (HTML, CSS, ...) to PDF.
# Copyright (C) 2011-2012 Simon Sapin and contributors.
# See AUTHORS for more details.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
This module takes care of steps 3 and 4 of “CSS 2.1 processing model”:
Retrieve stylesheets associated with a document and annotate every element
with a value for every CSS property.
"""
Module managing CSS.
This module takes care of steps 3 and 4 of “CSS 2.1 processing model”:
Retrieve stylesheets associated with a document and annotate every element
with a value for every CSS property.
http://www.w3.org/TR/CSS21/intro.html#processing-model
This module does this in more than two steps. The
:func:`get_all_computed_styles` function does everything, but there is also a
function for each step:
- ``find_stylesheets``: Find and parse all author stylesheets in a document
- ``effective_rules``: Resolve @media and @import rules
- ``match_selectors``: Find elements in a document that match a selector list
- ``find_style_attributes``: Find and parse all `style` HTML attributes
- ``effective_declarations``: Remove ignored properties and expand shorthands
- ``add_property``: Take applicable properties and only keep those with
highest weight.
- ``set_computed_styles``: Handle initial values, inheritance and computed
values for one element.
http://www.w3.org/TR/CSS21/intro.html#processing-model
This module does this in more than two steps. The
:func:`get_all_computed_styles` function does everything, but it itsef
calls a function for each step:
``find_stylesheets``
Find and parse all author stylesheets in a document.
``effective_rules``
Resolve @media and @import rules.
``match_selectors``
Find elements in a document that match a selector list.
``find_style_attributes``
Find and parse all `style` HTML attributes.
``effective_declarations``
Remove ignored properties and expand shorthands.
``add_property``
Take applicable properties and only keep those with highest weight.
``set_computed_styles``
Handle initial values, inheritance and computed values for one element.
:copyright: Copyright 2011-2012 Simon Sapin and contributors, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

Expand Down
31 changes: 11 additions & 20 deletions weasyprint/css/colors.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
# coding: utf8
"""
weasyprint.css.colors
---------------------
# WeasyPrint converts web documents (HTML, CSS, ...) to PDF.
# Copyright (C) 2011-2012 Simon Sapin and contributors.
# See AUTHORS for more details.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
Basic and extended color keywords from CSS3.
:copyright: Copyright 2011-2012 Simon Sapin and contributors, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

from __future__ import division, unicode_literals


"""
Basic and extended color keywords from CSS3.
Built from something like this:
Expand All @@ -34,9 +28,6 @@
"""

from __future__ import division, unicode_literals



CSS3_COLORS = {
'transparent': (0, 0, 0, 0.0),
Expand Down
Loading

0 comments on commit dcacf9e

Please sign in to comment.