Permalink
Browse files

Switch the licence to BSD and rewrite module docstrings/headers

  • Loading branch information...
1 parent d7843b2 commit dcacf9eed03d2e695263989fc21b37fbe2937129 @SimonSapin SimonSapin committed Mar 21, 2012
Showing with 469 additions and 1,487 deletions.
  1. +15 −5 AUTHORS
  2. +6 −0 CHANGES
  3. +0 −661 COPYING
  4. +33 −0 LICENSE
  5. +6 −1 README
  6. +18 −12 setup.py
  7. +8 −21 weasyprint/__init__.py
  8. +6 −19 weasyprint/__main__.py
  9. +6 −18 weasyprint/compat.py
  10. +36 −37 weasyprint/css/__init__.py
  11. +11 −20 weasyprint/css/colors.py
  12. +7 −18 weasyprint/css/computed_values.py
  13. +7 −18 weasyprint/css/properties.py
  14. +9 −22 weasyprint/css/validation.py
  15. +7 −18 weasyprint/css/values.py
  16. +6 −20 weasyprint/document.py
  17. +6 −19 weasyprint/draw.py
  18. +8 −18 weasyprint/formatting_structure/__init__.py
  19. +41 −51 weasyprint/formatting_structure/boxes.py
  20. +9 −21 weasyprint/formatting_structure/build.py
  21. +8 −22 weasyprint/formatting_structure/counters.py
  22. +10 −20 weasyprint/html.py
  23. +7 −18 weasyprint/images.py
  24. +14 −18 weasyprint/layout/__init__.py
  25. +6 −18 weasyprint/layout/blocks.py
  26. +6 −19 weasyprint/layout/inlines.py
  27. +6 −19 weasyprint/layout/markers.py
  28. +6 −19 weasyprint/layout/pages.py
  29. +6 −19 weasyprint/layout/percentages.py
  30. +6 −19 weasyprint/layout/preferred.py
  31. +6 −18 weasyprint/layout/tables.py
  32. +8 −20 weasyprint/layout/variable_margin_dimension.py
  33. +6 −19 weasyprint/logger.py
  34. +6 −19 weasyprint/tests/__init__.py
  35. +6 −19 weasyprint/tests/test_api.py
  36. +6 −18 weasyprint/tests/test_boxes.py
  37. +6 −18 weasyprint/tests/test_css.py
  38. +8 −18 weasyprint/tests/test_css_properties.py
  39. +6 −19 weasyprint/tests/test_draw.py
  40. +7 −19 weasyprint/tests/test_layout.py
  41. +6 −18 weasyprint/tests/test_text.py
  42. +12 −0 weasyprint/tests/test_web/__init__.py
  43. +12 −0 weasyprint/tests/test_web/run.py
  44. +6 −18 weasyprint/tests/testing_utils.py
  45. +14 −0 weasyprint/tests/w3_test_suite/__init__.py
  46. +11 −16 weasyprint/tests/w3_test_suite/run.py
  47. +8 −20 weasyprint/tests/w3_test_suite/web.py
  48. +6 −19 weasyprint/text.py
  49. +9 −19 weasyprint/utils.py
View
20 AUTHORS
@@ -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
View
@@ -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
===================================
View
661 COPYING
Oops, something went wrong.
View
33 LICENSE
@@ -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.
View
7 README
@@ -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/
View
@@ -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.
"""
@@ -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',
@@ -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',
View
@@ -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.
"""
View
@@ -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.
"""
View
@@ -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.
"""
View
@@ -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.
"""
View
@@ -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:
@@ -34,9 +28,6 @@
"""
-from __future__ import division, unicode_literals
-
-
CSS3_COLORS = {
'transparent': (0, 0, 0, 0.0),
Oops, something went wrong.

0 comments on commit dcacf9e

Please sign in to comment.