readme_renderer-24.0/0000755220050002575230000000000013365121720020057 5ustar dustiningramprimarygroup00000000000000readme_renderer-24.0/.coveragerc0000644220050002575230000000002413327731113022175 0ustar dustiningramprimarygroup00000000000000[run] branch = True readme_renderer-24.0/CHANGES.rst0000644220050002575230000000530513365121670021670 0ustar dustiningramprimarygroup00000000000000Changes ======= 24.0 (2018-10-27) ----------------- * Remove dependency on ``future``. (#134) 23.0 (2018-10-22) ----------------- * Breaking change: Move the cmarkgfm dependency into an extra (#130). Users that want to render Markdown will need to install readme_render[md] instead. 22.0 (2018-09-17) ----------------- * Unify handling of SVG and other images in RST. (#113) * Support width and alignment of images in RST (#114) 21.0 (2018-05-28) ----------------- * Allow . (#105) * Add specific tests for the raw directive. (#103) * Include docinfo when rendering rst. (#99) * Make Python 3 the default lexer for highlighting Python code in Markdown (#97) * Allow align attribute on

tags (#98) 20.0 (2018-04-13) ----------------- * Reformat docutils messages into more human-friendly output. (#92) * Fix incorrect escaping of html entities in pre tags when using markdown. (#89) * Allow width, height, alt, and align attributes on img tags. (#91) * Fix check to not report success when there is invalid RST. (#90) 19.0 (2018-04-10) ----------------- * Allow details and summary tags. (#77) * Add .pytest_cache to .gitignore. (#85) * Warn about Markdown content type when checking RST. (#83) * Update pep8 tox env to use py3.6. (#84) * Add Pygments-based syntax highlighting for Markdown. (#82) * Update docs about check to talk about Markdown. (#80) 18.1 (2018-04-01) ----------------- * Change Github-flavored Markdown identifier from ``gfm`` to ``GFM``. 18.0 (2018-03-30) ----------------- * Add support for GitHub-flavored Markdown. (#67) * Switch to cmarkgfm completely for rendering Markdown. (#68) * Warn about missing long description. (#69) * Make Github-Flavored Markdown the default variant (#73) 17.4 (2018-03-16) ----------------- * All renderers now accept arbitrary ``kwargs`` for future-proofing. 17.3 (2018-03-08) ----------------- * Gracefully handle new exceptions from bleach. 17.2 (2017-03-11) ----------------- * Fix an issue cleaning plaintext values. 17.1 (2017-03-09) ----------------- * Fix an issue attempting to clean data that had ```` tags without a href. 17.0 (2017-03-08) ----------------- * Fix issue with bleach >= 2.0. 16.0 (2016-12-09) ----------------- * Fix issue with docutils >= 0.13.1. 0.7.0 (2016-01-04) ------------------ * Renamed to ``readme_renderer``: https://github.com/pypa/readme_renderer to work around an name overlap with ``README`` files shipped in Python's default site-packages directory on certain case-insensitive file systems. * Added `PyPA Code of Conduct`_. * Allow and tags when cleaning rST HTML output. * Dropped support for Python 2.6. .. _PyPA Code of Conduct: https://www.pypa.io/en/latest/code-of-conduct/ readme_renderer-24.0/LICENSE0000644220050002575230000002273613327731113021077 0ustar dustiningramprimarygroup00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. readme_renderer-24.0/MANIFEST.in0000644220050002575230000000034413327731113021617 0ustar dustiningramprimarygroup00000000000000include LICENSE README.rst CHANGES.rst include tox.ini .coveragerc pytest.ini recursive-include tests *.html recursive-include tests *.py recursive-include tests *.rst recursive-include tests *.txt recursive-include tests *.md readme_renderer-24.0/PKG-INFO0000644220050002575230000000454313365121720021162 0ustar dustiningramprimarygroup00000000000000Metadata-Version: 2.1 Name: readme_renderer Version: 24.0 Summary: readme_renderer is a library for rendering "readme" descriptions for Warehouse Home-page: https://github.com/pypa/readme_renderer Author: The Python Packaging Authority Author-email: admin@mail.pypi.org License: Apache License, Version 2.0 Description: Readme Renderer =============== Readme Renderer is a library that will safely render arbitrary ``README`` files into HTML. It is designed to be used in Warehouse_ to render the ``long_description`` for packages. It can handle Markdown, reStructuredText (``.rst``), and plain text. .. _Warehouse: https://github.com/pypa/warehouse Check Description Locally ------------------------- To locally check whether your long descriptions will render on PyPI, first build your distributions, and then use the |twine check|_ command. Code of Conduct --------------- Everyone interacting in the readme_renderer project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the `PyPA Code of Conduct`_. .. |twine check| replace:: ``twine check`` .. _twine check: https://packaging.python.org/guides/making-a-pypi-friendly-readme#validating-restructuredtext-markup .. _PyPA Code of Conduct: https://www.pypa.io/en/latest/code-of-conduct/ Platform: UNKNOWN Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Apache Software License Classifier: Natural Language :: English Classifier: Operating System :: MacOS :: MacOS X Classifier: Operating System :: POSIX Classifier: Operating System :: POSIX :: BSD Classifier: Operating System :: POSIX :: Linux Classifier: Operating System :: Microsoft :: Windows Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Provides-Extra: md readme_renderer-24.0/README.rst0000644220050002575230000000170213352237021021544 0ustar dustiningramprimarygroup00000000000000Readme Renderer =============== Readme Renderer is a library that will safely render arbitrary ``README`` files into HTML. It is designed to be used in Warehouse_ to render the ``long_description`` for packages. It can handle Markdown, reStructuredText (``.rst``), and plain text. .. _Warehouse: https://github.com/pypa/warehouse Check Description Locally ------------------------- To locally check whether your long descriptions will render on PyPI, first build your distributions, and then use the |twine check|_ command. Code of Conduct --------------- Everyone interacting in the readme_renderer project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the `PyPA Code of Conduct`_. .. |twine check| replace:: ``twine check`` .. _twine check: https://packaging.python.org/guides/making-a-pypi-friendly-readme#validating-restructuredtext-markup .. _PyPA Code of Conduct: https://www.pypa.io/en/latest/code-of-conduct/ readme_renderer-24.0/pytest.ini0000644220050002575230000000014713327731113022113 0ustar dustiningramprimarygroup00000000000000[pytest] markers = filterwarnings: built-in maker to silence warnings, not recognized by --strict. readme_renderer-24.0/readme_renderer/0000755220050002575230000000000013365121720023202 5ustar dustiningramprimarygroup00000000000000readme_renderer-24.0/readme_renderer/__about__.py0000644220050002575230000000222113365121670025463 0ustar dustiningramprimarygroup00000000000000# Copyright 2014 Donald Stufft # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import absolute_import, division, print_function __all__ = [ "__title__", "__summary__", "__uri__", "__version__", "__author__", "__email__", "__license__", "__copyright__", ] __title__ = "readme_renderer" __summary__ = ('readme_renderer is a library for rendering "readme" ' 'descriptions for Warehouse') __uri__ = "https://github.com/pypa/readme_renderer" __version__ = "24.0" __author__ = "The Python Packaging Authority" __email__ = "admin@mail.pypi.org" __license__ = "Apache License, Version 2.0" __copyright__ = "Copyright 2014 %s" % __author__ readme_renderer-24.0/readme_renderer/__init__.py0000644220050002575230000000117613327731113025321 0ustar dustiningramprimarygroup00000000000000# Copyright 2014 Donald Stufft # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import absolute_import, division, print_function readme_renderer-24.0/readme_renderer/__main__.py0000644220050002575230000000125013362465636025310 0ustar dustiningramprimarygroup00000000000000from __future__ import absolute_import, print_function import argparse from readme_renderer.rst import render import sys if __name__ == '__main__': parser = argparse.ArgumentParser( description="Renders a .rst README to HTML", ) parser.add_argument('input', help="Input README file", type=argparse.FileType('r')) parser.add_argument('-o', '--output', help="Output file (default: stdout)", type=argparse.FileType('w'), default='-') args = parser.parse_args() rendered = render(args.input.read(), stream=sys.stderr) if rendered is None: sys.exit(1) print(rendered, file=args.output) readme_renderer-24.0/readme_renderer/clean.py0000644220050002575230000000475413351217304024647 0ustar dustiningramprimarygroup00000000000000# Copyright 2014 Donald Stufft # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import absolute_import, division, print_function import functools import bleach import bleach.callbacks import bleach.linkifier import bleach.sanitizer ALLOWED_TAGS = [ # Bleach Defaults "a", "abbr", "acronym", "b", "blockquote", "code", "em", "i", "li", "ol", "strong", "ul", # Custom Additions "br", "caption", "cite", "col", "colgroup", "dd", "del", "details", "div", "dl", "dt", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "img", "p", "pre", "span", "sub", "summary", "sup", "table", "tbody", "td", "th", "thead", "tr", "tt", "kbd", "var", ] ALLOWED_ATTRIBUTES = { # Bleach Defaults "a": ["href", "title"], "abbr": ["title"], "acronym": ["title"], # Custom Additions "*": ["id"], "hr": ["class"], "img": ["src", "width", "height", "alt", "align", "class"], "span": ["class"], "th": ["align"], "td": ["align"], "code": ["class"], "p": ["align"], } ALLOWED_STYLES = [ ] def clean(html, tags=None, attributes=None, styles=None): if tags is None: tags = ALLOWED_TAGS if attributes is None: attributes = ALLOWED_ATTRIBUTES if styles is None: styles = ALLOWED_STYLES # Clean the output using Bleach cleaner = bleach.sanitizer.Cleaner( tags=tags, attributes=attributes, styles=styles, filters=[ # Bleach Linkify makes it easy to modify links, however, we will # not be using it to create additional links. functools.partial( bleach.linkifier.LinkifyFilter, callbacks=[ lambda attrs, new: attrs if not new else None, bleach.callbacks.nofollow, ], skip_tags=["pre"], parse_email=False, ), ], ) try: cleaned = cleaner.clean(html) return cleaned except ValueError: return None readme_renderer-24.0/readme_renderer/integration/0000755220050002575230000000000013365121720025525 5ustar dustiningramprimarygroup00000000000000readme_renderer-24.0/readme_renderer/integration/__init__.py0000644220050002575230000000117613327731113027644 0ustar dustiningramprimarygroup00000000000000# Copyright 2015 Donald Stufft # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import absolute_import, division, print_function readme_renderer-24.0/readme_renderer/integration/distutils.py0000644220050002575230000000677613352237021030141 0ustar dustiningramprimarygroup00000000000000# Copyright 2015 Donald Stufft # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import absolute_import, division, print_function import cgi import io import re import distutils.log from distutils.command.check import check as _check from distutils.core import Command import six from ..rst import render # Regular expression used to capture and reformat doctuils warnings into # something that a human can understand. This is loosely borrowed from # Sphinx: https://github.com/sphinx-doc/sphinx/blob # /c35eb6fade7a3b4a6de4183d1dd4196f04a5edaf/sphinx/util/docutils.py#L199 _REPORT_RE = re.compile( r'^:(?P(?:\d+)?): ' r'\((?PDEBUG|INFO|WARNING|ERROR|SEVERE)/(\d+)?\) ' r'(?P.*)', re.DOTALL | re.MULTILINE) @six.python_2_unicode_compatible class _WarningStream(object): def __init__(self): self.output = io.StringIO() def write(self, text): matched = _REPORT_RE.search(text) if not matched: self.output.write(text) return self.output.write( u"line {line}: {level_text}: {message}\n".format( level_text=matched.group('level').capitalize(), line=matched.group('line'), message=matched.group('message').rstrip('\r\n'))) def __str__(self): return self.output.getvalue() class Check(_check): def check_restructuredtext(self): """ Checks if the long string fields are reST-compliant. """ # Warn that this command is deprecated # Don't use self.warn() because it will cause the check to fail. Command.warn( self, "This command has been deprecated. Use `twine check` instead: " "https://packaging.python.org/guides/making-a-pypi-friendly-readme" "#validating-restructuredtext-markup" ) data = self.distribution.get_long_description() content_type = getattr( self.distribution.metadata, 'long_description_content_type', None) if content_type: content_type, _ = cgi.parse_header(content_type) if content_type != 'text/x-rst': self.warn( "Not checking long description content type '%s', this " "command only checks 'text/x-rst'." % content_type) return # None or empty string should both trigger this branch. if not data or data == 'UNKNOWN': self.warn( "The project's long_description is either missing or empty.") return stream = _WarningStream() markup = render(data, stream=stream) if markup is None: self.warn( "The project's long_description has invalid markup which will " "not be rendered on PyPI. The following syntax errors were " "detected:\n%s" % stream) return self.announce( "The project's long description is valid RST.", level=distutils.log.INFO) readme_renderer-24.0/readme_renderer/markdown.py0000644220050002575230000000573713363422453025417 0ustar dustiningramprimarygroup00000000000000# Copyright 2014 Donald Stufft # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import absolute_import, division, print_function import re import warnings import pygments import pygments.lexers import pygments.formatters from six.moves import html_parser from .clean import clean _EXTRA_WARNING = ( "Markdown renderers are not available. " "Install 'readme_render[md]' to enable Markdown rendering." ) try: import cmarkgfm variants = { "GFM": cmarkgfm.github_flavored_markdown_to_html, "CommonMark": cmarkgfm.markdown_to_html, } except ImportError: warnings.warn(_EXTRA_WARNING) variants = {} # Make code fences with `python` as the language default to highlighting as # Python 3. _LANG_ALIASES = { 'python': 'python3', } def render(raw, variant="GFM", **kwargs): if not variants: warnings.warn(_EXTRA_WARNING) return None renderer = variants.get(variant) if not renderer: return None rendered = renderer(raw) if not rendered: return None highlighted = _highlight(rendered) cleaned = clean(highlighted) return cleaned def _highlight(html): """Syntax-highlights HTML-rendered Markdown. Plucks sections to highlight that conform the the GitHub fenced code info string as defined at https://github.github.com/gfm/#info-string. Args: html (str): The rendered HTML. Returns: str: The HTML with Pygments syntax highlighting applied to all code blocks. """ formatter = pygments.formatters.HtmlFormatter(nowrap=True) code_expr = re.compile( r'

(?P.+?)'
        r'
', re.DOTALL) def replacer(match): try: lang = match.group('lang') lang = _LANG_ALIASES.get(lang, lang) lexer = pygments.lexers.get_lexer_by_name(lang) except ValueError: lexer = pygments.lexers.TextLexer() code = match.group('code') # Decode html entities in the code. cmark tries to be helpful and # translate '"' to '"', but it confuses pygments. Pygments will # escape any html entities when re-writing the code, and we run # everything through bleach after. code = html_parser.HTMLParser().unescape(code) highlighted = pygments.highlight(code, lexer, formatter) return '
{}
'.format(highlighted) result = code_expr.sub(replacer, html) return result readme_renderer-24.0/readme_renderer/rst.py0000644220050002575230000000645213347322164024400 0ustar dustiningramprimarygroup00000000000000# Copyright 2014 Donald Stufft # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import absolute_import, division, print_function import io from docutils.core import publish_parts from docutils.writers.html4css1 import HTMLTranslator, Writer from docutils.utils import SystemMessage from .clean import clean class ReadMeHTMLTranslator(HTMLTranslator): # Overrides base class not to output `` tag for SVG images. object_image_types = {} SETTINGS = { # Cloaking email addresses provides a small amount of additional # privacy protection for email addresses inside of a chunk of ReST. "cloak_email_addresses": True, # Prevent a lone top level heading from being promoted to document # title, and thus second level headings from being promoted to top # level. "doctitle_xform": True, # Prevent a lone subsection heading from being promoted to section # title, and thus second level headings from being promoted to top # level. "sectsubtitle_xform": True, # Set our initial header level "initial_header_level": 2, # Prevent local files from being included into the rendered output. # This is a security concern because people can insert files # that are part of the system, such as /etc/passwd. "file_insertion_enabled": False, # Halt rendering and throw an exception if there was any errors or # warnings from docutils. "halt_level": 2, # Output math blocks as LaTeX that can be interpreted by MathJax for # a prettier display of Math formulas. "math_output": "MathJax", # Disable raw html as enabling it is a security risk, we do not want # people to be able to include any old HTML in the final output. "raw_enabled": False, # Disable all system messages from being reported. "report_level": 5, # Use typographic quotes, and transform --, ---, and ... into their # typographic counterparts. "smart_quotes": True, # Strip all comments from the rendered output. "strip_comments": True, # Use the short form of syntax highlighting so that the generated # Pygments CSS can be used to style the output. "syntax_highlight": "short", } def render(raw, stream=None, **kwargs): if stream is None: # Use a io.StringIO as the warning stream to prevent warnings from # being printed to sys.stderr. stream = io.StringIO() settings = SETTINGS.copy() settings["warning_stream"] = stream writer = Writer() writer.translator_class = ReadMeHTMLTranslator try: parts = publish_parts(raw, writer=writer, settings_overrides=settings) except SystemMessage: rendered = None else: rendered = parts.get("docinfo", "") + parts.get("fragment", "") if rendered: return clean(rendered) else: return None readme_renderer-24.0/readme_renderer/txt.py0000644220050002575230000000173613365117747024420 0ustar dustiningramprimarygroup00000000000000# Copyright 2015 Donald Stufft # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import absolute_import, division, print_function import sys from .clean import clean if sys.version_info >= (3,): from html import escape as html_escape else: from cgi import escape def html_escape(s): return escape(s, quote=True).replace("'", ''') def render(raw, **kwargs): rendered = html_escape(raw).replace("\n", "
") return clean(rendered, tags=["br"]) readme_renderer-24.0/readme_renderer.egg-info/0000755220050002575230000000000013365121720024674 5ustar dustiningramprimarygroup00000000000000readme_renderer-24.0/readme_renderer.egg-info/PKG-INFO0000644220050002575230000000454313365121720025777 0ustar dustiningramprimarygroup00000000000000Metadata-Version: 2.1 Name: readme-renderer Version: 24.0 Summary: readme_renderer is a library for rendering "readme" descriptions for Warehouse Home-page: https://github.com/pypa/readme_renderer Author: The Python Packaging Authority Author-email: admin@mail.pypi.org License: Apache License, Version 2.0 Description: Readme Renderer =============== Readme Renderer is a library that will safely render arbitrary ``README`` files into HTML. It is designed to be used in Warehouse_ to render the ``long_description`` for packages. It can handle Markdown, reStructuredText (``.rst``), and plain text. .. _Warehouse: https://github.com/pypa/warehouse Check Description Locally ------------------------- To locally check whether your long descriptions will render on PyPI, first build your distributions, and then use the |twine check|_ command. Code of Conduct --------------- Everyone interacting in the readme_renderer project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the `PyPA Code of Conduct`_. .. |twine check| replace:: ``twine check`` .. _twine check: https://packaging.python.org/guides/making-a-pypi-friendly-readme#validating-restructuredtext-markup .. _PyPA Code of Conduct: https://www.pypa.io/en/latest/code-of-conduct/ Platform: UNKNOWN Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Apache Software License Classifier: Natural Language :: English Classifier: Operating System :: MacOS :: MacOS X Classifier: Operating System :: POSIX Classifier: Operating System :: POSIX :: BSD Classifier: Operating System :: POSIX :: Linux Classifier: Operating System :: Microsoft :: Windows Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Provides-Extra: md readme_renderer-24.0/readme_renderer.egg-info/SOURCES.txt0000644220050002575230000001066213365121720026565 0ustar dustiningramprimarygroup00000000000000.coveragerc CHANGES.rst LICENSE MANIFEST.in README.rst pytest.ini setup.cfg setup.py tox.ini readme_renderer/__about__.py readme_renderer/__init__.py readme_renderer/__main__.py readme_renderer/clean.py readme_renderer/markdown.py readme_renderer/rst.py readme_renderer/txt.py readme_renderer.egg-info/PKG-INFO readme_renderer.egg-info/SOURCES.txt readme_renderer.egg-info/dependency_links.txt readme_renderer.egg-info/entry_points.txt readme_renderer.egg-info/requires.txt readme_renderer.egg-info/top_level.txt readme_renderer/integration/__init__.py readme_renderer/integration/distutils.py tests/__init__.py tests/test_clean.py tests/test_integration_distutils.py tests/test_markdown.py tests/test_noextra.py tests/test_rst.py tests/test_txt.py tests/fixtures/test_CommonMark_001.html tests/fixtures/test_CommonMark_001.md tests/fixtures/test_CommonMark_002.html tests/fixtures/test_CommonMark_002.md tests/fixtures/test_CommonMark_003.html tests/fixtures/test_CommonMark_003.md tests/fixtures/test_CommonMark_004.html tests/fixtures/test_CommonMark_004.md tests/fixtures/test_CommonMark_005.html tests/fixtures/test_CommonMark_005.md tests/fixtures/test_CommonMark_006.html tests/fixtures/test_CommonMark_006.md tests/fixtures/test_CommonMark_007.html tests/fixtures/test_CommonMark_007.md tests/fixtures/test_CommonMark_008.html tests/fixtures/test_CommonMark_008.md tests/fixtures/test_CommonMark_009.html tests/fixtures/test_CommonMark_009.md tests/fixtures/test_CommonMark_smart_strong.html tests/fixtures/test_CommonMark_smart_strong.md tests/fixtures/test_CommonMark_style.html tests/fixtures/test_CommonMark_style.md tests/fixtures/test_GFM_001.html tests/fixtures/test_GFM_001.md tests/fixtures/test_GFM_002.html tests/fixtures/test_GFM_002.md tests/fixtures/test_GFM_003.html tests/fixtures/test_GFM_003.md tests/fixtures/test_GFM_004.html tests/fixtures/test_GFM_004.md tests/fixtures/test_GFM_005.html tests/fixtures/test_GFM_005.md tests/fixtures/test_GFM_006.html tests/fixtures/test_GFM_006.md tests/fixtures/test_GFM_007.html tests/fixtures/test_GFM_007.md tests/fixtures/test_GFM_008.html tests/fixtures/test_GFM_008.md tests/fixtures/test_GFM_009.html tests/fixtures/test_GFM_009.md tests/fixtures/test_GFM_010.html tests/fixtures/test_GFM_010.md tests/fixtures/test_GFM_011.html tests/fixtures/test_GFM_011.md tests/fixtures/test_GFM_012.html tests/fixtures/test_GFM_012.md tests/fixtures/test_GFM_013.html tests/fixtures/test_GFM_013.md tests/fixtures/test_GFM_014.html tests/fixtures/test_GFM_014.md tests/fixtures/test_GFM_015.html tests/fixtures/test_GFM_015.md tests/fixtures/test_GFM_016.html tests/fixtures/test_GFM_016.md tests/fixtures/test_GFM_017.html tests/fixtures/test_GFM_017.md tests/fixtures/test_GFM_018.html tests/fixtures/test_GFM_018.md tests/fixtures/test_GFM_019.html tests/fixtures/test_GFM_019.md tests/fixtures/test_GFM_020.html tests/fixtures/test_GFM_020.md tests/fixtures/test_GFM_021.html tests/fixtures/test_GFM_021.md tests/fixtures/test_GFM_022.html tests/fixtures/test_GFM_022.md tests/fixtures/test_GFM_023.html tests/fixtures/test_GFM_023.md tests/fixtures/test_GFM_doublequotes.html tests/fixtures/test_GFM_doublequotes.md tests/fixtures/test_GFM_highlight.html tests/fixtures/test_GFM_highlight.md tests/fixtures/test_GFM_highlight_default_py.html tests/fixtures/test_GFM_highlight_default_py.md tests/fixtures/test_GFM_img.html tests/fixtures/test_GFM_img.md tests/fixtures/test_GFM_malicious_pre.html tests/fixtures/test_GFM_malicious_pre.md tests/fixtures/test_GFM_style.html tests/fixtures/test_GFM_style.md tests/fixtures/test_rst_003.html tests/fixtures/test_rst_003.rst tests/fixtures/test_rst_004.html tests/fixtures/test_rst_004.rst tests/fixtures/test_rst_005.html tests/fixtures/test_rst_005.rst tests/fixtures/test_rst_006.html tests/fixtures/test_rst_006.rst tests/fixtures/test_rst_007.html tests/fixtures/test_rst_007.rst tests/fixtures/test_rst_008.html tests/fixtures/test_rst_008.rst tests/fixtures/test_rst_caption.html tests/fixtures/test_rst_caption.rst tests/fixtures/test_rst_docinfo.html tests/fixtures/test_rst_docinfo.rst tests/fixtures/test_rst_linkify.html tests/fixtures/test_rst_linkify.rst tests/fixtures/test_rst_png.html tests/fixtures/test_rst_png.rst tests/fixtures/test_rst_png_attrs.html tests/fixtures/test_rst_png_attrs.rst tests/fixtures/test_rst_svg.html tests/fixtures/test_rst_svg.rst tests/fixtures/test_rst_svg_attrs.html tests/fixtures/test_rst_svg_attrs.rst tests/fixtures/test_txt_001.html tests/fixtures/test_txt_001.txtreadme_renderer-24.0/readme_renderer.egg-info/dependency_links.txt0000644220050002575230000000000113365121720030742 0ustar dustiningramprimarygroup00000000000000 readme_renderer-24.0/readme_renderer.egg-info/entry_points.txt0000644220050002575230000000011213365121720030164 0ustar dustiningramprimarygroup00000000000000[distutils.commands] check = readme_renderer.integration.distutils:Check readme_renderer-24.0/readme_renderer.egg-info/requires.txt0000644220050002575230000000010213365121720027265 0ustar dustiningramprimarygroup00000000000000bleach>=2.1.0 docutils>=0.13.1 Pygments six [md] cmarkgfm>=0.2.0 readme_renderer-24.0/readme_renderer.egg-info/top_level.txt0000644220050002575230000000002013365121720027416 0ustar dustiningramprimarygroup00000000000000readme_renderer readme_renderer-24.0/setup.cfg0000644220050002575230000000014613365121720021701 0ustar dustiningramprimarygroup00000000000000[bdist_wheel] universal = 1 [metadata] license_file = LICENSE [egg_info] tag_build = tag_date = 0 readme_renderer-24.0/setup.py0000644220050002575230000000463313365117747021615 0ustar dustiningramprimarygroup00000000000000# Copyright 2014 Donald Stufft # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import absolute_import, division, print_function import os import setuptools base_dir = os.path.dirname(__file__) with open(os.path.join(base_dir, "readme_renderer", "__about__.py")) as f: about = {} exec(f.read(), about) with open(os.path.join(base_dir, "README.rst")) as f: long_description = f.read() setuptools.setup( name=about["__title__"], version=about["__version__"], description=about["__summary__"], long_description=long_description, license=about["__license__"], url=about["__uri__"], author=about["__author__"], author_email=about["__email__"], classifiers=[ "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX", "Operating System :: POSIX :: BSD", "Operating System :: POSIX :: Linux", "Operating System :: Microsoft :: Windows", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ], install_requires=[ "bleach>=2.1.0", "docutils>=0.13.1", "Pygments", "six", ], entry_points={ "distutils.commands": [ "check = readme_renderer.integration.distutils:Check", ], }, extras_require={ "md": "cmarkgfm>=0.2.0", }, packages=setuptools.find_packages(exclude=["tests", "tests.*"]), ) readme_renderer-24.0/tests/0000755220050002575230000000000013365121720021221 5ustar dustiningramprimarygroup00000000000000readme_renderer-24.0/tests/__init__.py0000644220050002575230000000000013327731113023321 0ustar dustiningramprimarygroup00000000000000readme_renderer-24.0/tests/fixtures/0000755220050002575230000000000013365121720023072 5ustar dustiningramprimarygroup00000000000000readme_renderer-24.0/tests/fixtures/test_CommonMark_001.html0000644220050002575230000000001513327731113027437 0ustar dustiningramprimarygroup00000000000000

Hello

readme_renderer-24.0/tests/fixtures/test_CommonMark_001.md0000644220050002575230000000000613327731113027073 0ustar dustiningramprimarygroup00000000000000Hello readme_renderer-24.0/tests/fixtures/test_CommonMark_002.html0000644220050002575230000000004313327731113027441 0ustar dustiningramprimarygroup00000000000000

http://mymalicioussite.com/

readme_renderer-24.0/tests/fixtures/test_CommonMark_002.md0000644220050002575230000000003413327731113027075 0ustar dustiningramprimarygroup00000000000000http://mymalicioussite.com/ readme_renderer-24.0/tests/fixtures/test_CommonMark_003.html0000644220050002575230000000024213327731113027443 0ustar dustiningramprimarygroup00000000000000

Required packages

To run the PyPI software, you need Python 2.5+ and PostgreSQL

Quick development setup

Make sure you are sitting

readme_renderer-24.0/tests/fixtures/test_CommonMark_003.md0000644220050002575230000000021213327731113027074 0ustar dustiningramprimarygroup00000000000000## Required packages To run the PyPI software, you need Python 2.5+ and PostgreSQL ## Quick development setup Make sure you are sitting readme_renderer-24.0/tests/fixtures/test_CommonMark_004.html0000644220050002575230000000024213327731113027444 0ustar dustiningramprimarygroup00000000000000

Required packages

To run the PyPI software, you need Python 2.5+ and PostgreSQL

Quick development setup

Make sure you are sitting

readme_renderer-24.0/tests/fixtures/test_CommonMark_004.md0000644220050002575230000000024113327731113027077 0ustar dustiningramprimarygroup00000000000000

Required packages

To run the PyPI software, you need Python 2.5+ and PostgreSQL

Quick development setup

Make sure you are sitting

readme_renderer-24.0/tests/fixtures/test_CommonMark_005.html0000644220050002575230000000011313327731113027442 0ustar dustiningramprimarygroup00000000000000

Click here

readme_renderer-24.0/tests/fixtures/test_CommonMark_005.md0000644220050002575230000000006513327731113027104 0ustar dustiningramprimarygroup00000000000000Click here readme_renderer-24.0/tests/fixtures/test_CommonMark_006.html0000644220050002575230000000011213327731113027442 0ustar dustiningramprimarygroup00000000000000<iframe src="http://mymalicioussite.com/">Click here</iframe> readme_renderer-24.0/tests/fixtures/test_CommonMark_006.md0000644220050002575230000000007513327731113027106 0ustar dustiningramprimarygroup00000000000000readme_renderer-24.0/tests/fixtures/test_CommonMark_007.html0000644220050002575230000000013313327731113027446 0ustar dustiningramprimarygroup00000000000000

Something naughty this way comes

<script> alert("Hello"); </script> readme_renderer-24.0/tests/fixtures/test_CommonMark_007.md0000644220050002575230000000011013327731113027075 0ustar dustiningramprimarygroup00000000000000Something naughty this way comes readme_renderer-24.0/tests/fixtures/test_CommonMark_008.html0000644220050002575230000000271613327731113027460 0ustar dustiningramprimarygroup00000000000000

Here is some Python code for a Dog:

class Dog(Animal):
    def __init__(self, name):
        self.name = name

    def make_sound(self):
        print('Ruff!')

dog = Dog('Fido')

and then here is some bash:

if [ "$1" = "--help" ]; then
    echo "OK"
fi

or click SurveyMonkey

readme_renderer-24.0/tests/fixtures/test_CommonMark_008.md0000644220050002575230000000052213327731113027105 0ustar dustiningramprimarygroup00000000000000Here is some Python code for a `Dog`: ```python class Dog(Animal): def __init__(self, name): self.name = name def make_sound(self): print('Ruff!') dog = Dog('Fido') ``` and then here is some bash: ```bash if [ "$1" = "--help" ]; then echo "OK" fi ``` or click [SurveyMonkey](http://www.surveymonkey.com) readme_renderer-24.0/tests/fixtures/test_CommonMark_009.html0000644220050002575230000000017613327731113027457 0ustar dustiningramprimarygroup00000000000000

Normal text

Why am I getting an error during installation/when launching rtv?
readme_renderer-24.0/tests/fixtures/test_CommonMark_009.md0000644220050002575230000000017013327731113027105 0ustar dustiningramprimarygroup00000000000000Normal text
Why am I getting an error during installation/when launching rtv?
readme_renderer-24.0/tests/fixtures/test_CommonMark_smart_strong.html0000644220050002575230000000014513327731113031665 0ustar dustiningramprimarygroup00000000000000

Regular double underscore words.

Text with double__underscore__words.

readme_renderer-24.0/tests/fixtures/test_CommonMark_smart_strong.md0000644220050002575230000000011313327731113031314 0ustar dustiningramprimarygroup00000000000000Regular __double underscore__ words. Text with double__underscore__words. readme_renderer-24.0/tests/fixtures/test_CommonMark_style.html0000644220050002575230000000005213351217304030276 0ustar dustiningramprimarygroup00000000000000 readme_renderer-24.0/tests/fixtures/test_CommonMark_style.md0000644220050002575230000000005213351217304027732 0ustar dustiningramprimarygroup00000000000000 readme_renderer-24.0/tests/fixtures/test_GFM_001.html0000644220050002575230000000020713327731113026010 0ustar dustiningramprimarygroup00000000000000
foo bar
baz bim
readme_renderer-24.0/tests/fixtures/test_GFM_001.md0000644220050002575230000000005513327731113025445 0ustar dustiningramprimarygroup00000000000000| foo | bar | | --- | --- | | baz | bim | readme_renderer-24.0/tests/fixtures/test_GFM_002.html0000644220050002575230000000030413327731113026007 0ustar dustiningramprimarygroup00000000000000
abc defghi
bar baz
readme_renderer-24.0/tests/fixtures/test_GFM_002.md0000644220050002575230000000006113327731113025443 0ustar dustiningramprimarygroup00000000000000| abc | defghi | :-: | -----------: bar | baz readme_renderer-24.0/tests/fixtures/test_GFM_003.html0000644220050002575230000000025313327731113026013 0ustar dustiningramprimarygroup00000000000000
f|oo
b | az
b | im
readme_renderer-24.0/tests/fixtures/test_GFM_003.md0000644220050002575230000000007013327731113025444 0ustar dustiningramprimarygroup00000000000000| f\|oo | | ------ | | b `\|` az | | b **\|** im | readme_renderer-24.0/tests/fixtures/test_GFM_004.html0000644220050002575230000000026013327731113026012 0ustar dustiningramprimarygroup00000000000000
abc def
bar baz

bar

readme_renderer-24.0/tests/fixtures/test_GFM_004.md0000644220050002575230000000006413327731113025450 0ustar dustiningramprimarygroup00000000000000| abc | def | | --- | --- | | bar | baz | > bar readme_renderer-24.0/tests/fixtures/test_GFM_005.html0000644220050002575230000000027113327731113026015 0ustar dustiningramprimarygroup00000000000000
abc def
bar baz
bar

bar

readme_renderer-24.0/tests/fixtures/test_GFM_005.md0000644220050002575230000000007113327731113025447 0ustar dustiningramprimarygroup00000000000000| abc | def | | --- | --- | | bar | baz | bar bar readme_renderer-24.0/tests/fixtures/test_GFM_006.html0000644220050002575230000000005013327731113026011 0ustar dustiningramprimarygroup00000000000000

| abc | def | | --- | | bar |

readme_renderer-24.0/tests/fixtures/test_GFM_006.md0000644220050002575230000000004113327731113025445 0ustar dustiningramprimarygroup00000000000000| abc | def | | --- | | bar | readme_renderer-24.0/tests/fixtures/test_GFM_007.html0000644220050002575230000000025513327731113026021 0ustar dustiningramprimarygroup00000000000000
abc def
bar
bar baz
readme_renderer-24.0/tests/fixtures/test_GFM_007.md0000644220050002575230000000007413327731113025454 0ustar dustiningramprimarygroup00000000000000| abc | def | | --- | --- | | bar | | bar | baz | boo | readme_renderer-24.0/tests/fixtures/test_GFM_008.html0000644220050002575230000000011513327731113026015 0ustar dustiningramprimarygroup00000000000000
abc def
readme_renderer-24.0/tests/fixtures/test_GFM_008.md0000644220050002575230000000003613327731113025453 0ustar dustiningramprimarygroup00000000000000| abc | def | | --- | --- | readme_renderer-24.0/tests/fixtures/test_GFM_009.html0000644220050002575230000000004413327731113026017 0ustar dustiningramprimarygroup00000000000000

Hi Hello, world!

readme_renderer-24.0/tests/fixtures/test_GFM_009.md0000644220050002575230000000002413327731113025451 0ustar dustiningramprimarygroup00000000000000~Hi~ Hello, world! readme_renderer-24.0/tests/fixtures/test_GFM_010.html0000644220050002575230000000006413327731113026011 0ustar dustiningramprimarygroup00000000000000

This text is curious.

readme_renderer-24.0/tests/fixtures/test_GFM_010.md0000644220050002575230000000004113327731113025440 0ustar dustiningramprimarygroup00000000000000This ~text~~~~ is ~~~~curious~. readme_renderer-24.0/tests/fixtures/test_GFM_011.html0000644220050002575230000000005613327731113026013 0ustar dustiningramprimarygroup00000000000000

This ~~has a

new paragraph~~.

readme_renderer-24.0/tests/fixtures/test_GFM_011.md0000644220050002575230000000004213327731113025442 0ustar dustiningramprimarygroup00000000000000This ~~has a new paragraph~~. readme_renderer-24.0/tests/fixtures/test_GFM_012.html0000644220050002575230000000012213327731113026006 0ustar dustiningramprimarygroup00000000000000

www.commonmark.org

readme_renderer-24.0/tests/fixtures/test_GFM_012.md0000644220050002575230000000002413327731113025443 0ustar dustiningramprimarygroup00000000000000www.commonmark.org readme_renderer-24.0/tests/fixtures/test_GFM_013.html0000644220050002575230000000017013327731113026012 0ustar dustiningramprimarygroup00000000000000

Visit www.commonmark.org/help for more information.

readme_renderer-24.0/tests/fixtures/test_GFM_013.md0000644220050002575230000000006513327731113025451 0ustar dustiningramprimarygroup00000000000000Visit www.commonmark.org/help for more information. readme_renderer-24.0/tests/fixtures/test_GFM_014.html0000644220050002575230000000027213327731113026016 0ustar dustiningramprimarygroup00000000000000

Visit www.commonmark.org.

Visit www.commonmark.org/a.b.

readme_renderer-24.0/tests/fixtures/test_GFM_014.md0000644220050002575230000000007413327731113025452 0ustar dustiningramprimarygroup00000000000000Visit www.commonmark.org. Visit www.commonmark.org/a.b. readme_renderer-24.0/tests/fixtures/test_GFM_015.html0000644220050002575230000000040213327731113026012 0ustar dustiningramprimarygroup00000000000000

www.google.com/search?q=Markup+(business)

(www.google.com/search?q=Markup+(business))

readme_renderer-24.0/tests/fixtures/test_GFM_015.md0000644220050002575230000000013213327731113025446 0ustar dustiningramprimarygroup00000000000000www.google.com/search?q=Markup+(business) (www.google.com/search?q=Markup+(business)) readme_renderer-24.0/tests/fixtures/test_GFM_016.html0000644220050002575230000000017213327731113026017 0ustar dustiningramprimarygroup00000000000000

www.google.com/search?q=(business))+ok

readme_renderer-24.0/tests/fixtures/test_GFM_016.md0000644220050002575230000000005013327731113025446 0ustar dustiningramprimarygroup00000000000000www.google.com/search?q=(business))+ok readme_renderer-24.0/tests/fixtures/test_GFM_017.html0000644220050002575230000000040013327731113026012 0ustar dustiningramprimarygroup00000000000000

www.google.com/search?q=commonmark&hl=en

www.google.com/search?q=commonmark&hl;

readme_renderer-24.0/tests/fixtures/test_GFM_017.md0000644220050002575230000000012413327731113025451 0ustar dustiningramprimarygroup00000000000000www.google.com/search?q=commonmark&hl=en www.google.com/search?q=commonmark&hl; readme_renderer-24.0/tests/fixtures/test_GFM_018.html0000644220050002575230000000013613327731113026021 0ustar dustiningramprimarygroup00000000000000

www.commonmark.org/he<lp

readme_renderer-24.0/tests/fixtures/test_GFM_018.md0000644220050002575230000000003213327731113025450 0ustar dustiningramprimarygroup00000000000000www.commonmark.org/hehttp://commonmark.org

(Visit https://encrypted.google.com/search?q=Markup+(business))

Anonymous FTP is available at ftp://foo.bar.baz.

readme_renderer-24.0/tests/fixtures/test_GFM_019.md0000644220050002575230000000021613327731113025455 0ustar dustiningramprimarygroup00000000000000http://commonmark.org (Visit https://encrypted.google.com/search?q=Markup+(business)) Anonymous FTP is available at ftp://foo.bar.baz. readme_renderer-24.0/tests/fixtures/test_GFM_020.html0000644220050002575230000000006513327731113026013 0ustar dustiningramprimarygroup00000000000000

foo@bar.baz

readme_renderer-24.0/tests/fixtures/test_GFM_020.md0000644220050002575230000000001513327731113025442 0ustar dustiningramprimarygroup00000000000000foo@bar.baz readme_renderer-24.0/tests/fixtures/test_GFM_021.html0000644220050002575230000000016713327731113026017 0ustar dustiningramprimarygroup00000000000000

hello@mail+xyz.example isn't valid, but hello+xyz@mail.example is.

readme_renderer-24.0/tests/fixtures/test_GFM_021.md0000644220050002575230000000010413327731113025442 0ustar dustiningramprimarygroup00000000000000hello@mail+xyz.example isn't valid, but hello+xyz@mail.example is. readme_renderer-24.0/tests/fixtures/test_GFM_022.html0000644220050002575230000000022513327731113026013 0ustar dustiningramprimarygroup00000000000000

a.b-c_d@a.b

a.b-c_d@a.b.

a.b-c_d@a.b-

a.b-c_d@a.b_

readme_renderer-24.0/tests/fixtures/test_GFM_022.md0000644220050002575230000000007513327731113025452 0ustar dustiningramprimarygroup00000000000000a.b-c_d@a.b a.b-c_d@a.b. a.b-c_d@a.b- a.b-c_d@a.b_ readme_renderer-24.0/tests/fixtures/test_GFM_023.html0000644220050002575230000000026613327731113026021 0ustar dustiningramprimarygroup00000000000000

<title> <style>

<xmp> is disallowed. <XMP> is also disallowed.
readme_renderer-24.0/tests/fixtures/test_GFM_023.md0000644220050002575230000000016113327731113025447 0ustar dustiningramprimarygroup00000000000000 <style> <em> <blockquote> <xmp> is disallowed. <XMP> is also disallowed. </blockquote> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_GFM_doublequotes.html��������������������������������������0000644�2200500�0257523�00000000704�13327731113�030225� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>This is normal text.</p> <pre><code>This is code text. </code></pre> <pre><span class="k">def</span> <span class="nf">this_is_python</span><span class="p">():</span> <span class="sd">"""This is a docstring."""</span> <span class="k">pass</span> </pre> <pre><span class="kd">func</span> <span class="nx">ThisIsGo</span><span class="p">(){</span> <span class="k">return</span> <span class="p">}</span> </pre> ������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_GFM_doublequotes.md����������������������������������������0000644�2200500�0257523�00000000247�13327731113�027663� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This is normal text. ``` This is code text. ``` ```python def this_is_python(): """This is a docstring.""" pass ``` ```go func ThisIsGo(){ return } ``` ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_GFM_highlight.html�����������������������������������������0000644�2200500�0257523�00000000557�13327731113�027467� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>This is normal text.</p> <pre><code>This is code text. </code></pre> <pre><span class="k">def</span> <span class="nf">this_is_python</span><span class="p">():</span> <span class="k">pass</span> </pre> <pre><span class="kd">func</span> <span class="nx">ThisIsGo</span><span class="p">(){</span> <span class="k">return</span> <span class="p">}</span> </pre> �������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_GFM_highlight.md�������������������������������������������0000644�2200500�0257523�00000000210�13327731113�027105� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This is normal text. ``` This is code text. ``` ```python def this_is_python(): pass ``` ```go func ThisIsGo(){ return } ``` ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_GFM_highlight_default_py.html������������������������������0000644�2200500�0257523�00000000470�13327731113�031675� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<pre><span class="k">async</span> <span class="k">def</span> <span class="nf">this_is_python</span><span class="p">():</span> <span class="k">pass</span> <span class="nb">print</span><span class="p">(</span><span class="k">await</span> <span class="n">this_is_python</span><span class="p">())</span> </pre> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_GFM_highlight_default_py.md��������������������������������0000644�2200500�0257523�00000000122�13327731113�031323� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������```python async def this_is_python(): pass print(await this_is_python()) ``` ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_GFM_img.html�����������������������������������������������0000644�2200500�0257523�00000000344�13327731113�026266� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p><img alt="Image of Yaktocat" src="https://octodex.github.com/images/yaktocat.png"></p> <p align="center"> <img alt="Image of Yaktocat" height="100px" src="https://octodex.github.com/images/yaktocat.png" width="20%"> </p> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_GFM_img.md�������������������������������������������������0000644�2200500�0257523�00000000320�13327731113�025714� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������![Image of Yaktocat](https://octodex.github.com/images/yaktocat.png) <p align="center"> <img src="https://octodex.github.com/images/yaktocat.png" width="20%" height="100px" alt="Image of Yaktocat"> </p> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_GFM_malicious_pre.html�������������������������������������0000644�2200500�0257523�00000001202�13327731113�030337� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>This is normal text.</p> <pre><span class="k">def</span> <span class="nf">this_is_python</span><span class="p">():</span> <span class="sd">"""This is a docstring."""</span> <span class="k">pass</span> <span class="o"><</span><span class="n">script</span> <span class="nb">type</span><span class="o">=</span><span class="s2">"text/javascript"</span><span class="o">></span><span class="n">alert</span><span class="p">(</span><span class="s1">'I am evil.'</span><span class="p">);</span><span class="o"></</span><span class="n">script</span><span class="o">></span> </pre> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_GFM_malicious_pre.md���������������������������������������0000644�2200500�0257523�00000000237�13327731113�030002� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This is normal text. ```python def this_is_python(): """This is a docstring.""" pass <script type="text/javascript">alert('I am evil.');</script> ``` �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_GFM_style.html���������������������������������������������0000644�2200500�0257523�00000000052�13351217304�026644� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<img src="https://example.com/badge.png"> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_GFM_style.md�����������������������������������������������0000644�2200500�0257523�00000000052�13351217304�026300� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<img src="https://example.com/badge.png"> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_003.html�����������������������������������������������0000644�2200500�0257523�00000000360�13327731113�026211� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<div id="required-packages"> <h2>Required packages</h2> <p>To run the PyPI software, you need Python 2.5+ and PostgreSQL</p> </div> <div id="quick-development-setup"> <h2>Quick development setup</h2> <p>Make sure you are sitting</p> </div> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_003.rst������������������������������������������������0000644�2200500�0257523�00000000260�13327731113�026054� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Required packages ----------------- To run the PyPI software, you need Python 2.5+ and PostgreSQL Quick development setup ----------------------- Make sure you are sitting ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_004.html�����������������������������������������������0000644�2200500�0257523�00000000507�13327731113�026215� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p><div id=”required-packages”> <h2>Required packages</h2> <p>To run the PyPI software, you need Python 2.5+ and PostgreSQL</p> </div> <div id=”quick-development-setup”> <h2>Quick development setup</h2> <p>Make sure you are sitting</p> </div></p> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_004.rst������������������������������������������������0000644�2200500�0257523�00000000360�13327731113�026056� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<div id="required-packages"> <h2>Required packages</h2> <p>To run the PyPI software, you need Python 2.5+ and PostgreSQL</p> </div> <div id="quick-development-setup"> <h2>Quick development setup</h2> <p>Make sure you are sitting</p> </div> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_005.html�����������������������������������������������0000644�2200500�0257523�00000000205�13327731113�026211� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p><a href=”<a href="http://mymalicioussite.com/" rel="nofollow">http://mymalicioussite.com/</a>”>Click here</a></p> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_005.rst������������������������������������������������0000644�2200500�0257523�00000000064�13327731113�026060� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<a href="http://mymalicioussite.com/">Click here</a>����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_006.html�����������������������������������������������0000644�2200500�0257523�00000000216�13327731113�026214� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p><iframe src=”<a href="http://mymalicioussite.com/" rel="nofollow">http://mymalicioussite.com/</a>”>Click here</iframe></p> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_006.rst������������������������������������������������0000644�2200500�0257523�00000000075�13327731113�026063� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<iframe src="http://mymalicioussite.com/">Click here</iframe>�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_007.html�����������������������������������������������0000644�2200500�0257523�00000000124�13327731113�026213� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Something naughty this way comes <script> alert("Hello"); </script> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_007.rst������������������������������������������������0000644�2200500�0257523�00000000110�13327731113�026052� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Something naughty this way comes <script> alert("Hello"); </script> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_008.html�����������������������������������������������0000644�2200500�0257523�00000002671�13327731113�026225� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>Here is some Python code for a <tt>Dog</tt>:</p> <pre><span class="k">class</span> <span class="nc">Dog</span><span class="p">(</span><span class="n">Animal</span><span class="p">):</span> <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">):</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span> <span class="k">def</span> <span class="nf">make_sound</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> <span class="k">print</span><span class="p">(</span><span class="s1">'Ruff!'</span><span class="p">)</span> <span class="n">dog</span> <span class="o">=</span> <span class="n">Dog</span><span class="p">(</span><span class="s1">'Fido'</span><span class="p">)</span> </pre> <p>and then here is some bash:</p> <pre><span class="k">if</span> <span class="o">[</span> <span class="s2">"</span><span class="nv">$1</span><span class="s2">"</span> <span class="o">=</span> <span class="s2">"--help"</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span> <span class="nb">echo</span> <span class="s2">"OK"</span> <span class="k">fi</span> </pre> <p>or click <a href="http://www.surveymonkey.com" rel="nofollow">SurveyMonkey</a></p> �����������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_008.rst������������������������������������������������0000644�2200500�0257523�00000000616�13327731113�026066� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Here is some Python code for a ``Dog``: .. code-block:: python class Dog(Animal): def __init__(self, name): self.name = name def make_sound(self): print('Ruff!') dog = Dog('Fido') and then here is some bash: .. code-block:: bash if [ "$1" = "--help" ]; then echo "OK" fi or click `SurveyMonkey <http://www.surveymonkey.com>`_ ������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_caption.html�������������������������������������������0000644�2200500�0257523�00000001032�13327731113�027341� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<table> <caption>Multiplication</caption> <colgroup> <col> <col> <col> <col> <col> </colgroup> <thead> <tr><th>1</th> <th>2</th> <th>3</th> <th>4</th> <th>5</th> </tr> </thead> <tbody> <tr><td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> </tr> <tr><td>2</td> <td>4</td> <td>6</td> <td>8</td> <td>10</td> </tr> <tr><td>3</td> <td>6</td> <td>9</td> <td>12</td> <td>15</td> </tr> <tr><td>4</td> <td>8</td> <td>12</td> <td>16</td> <td>20</td> </tr> <tr><td>5</td> <td>10</td> <td>15</td> <td>20</td> <td>25</td> </tr> </tbody> </table> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_caption.rst��������������������������������������������0000644�2200500�0257523�00000000436�13327731113�027214� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.. The following test case is based on https://github.com/tiran/defusedxml/blob/f2c7c35b25f80c08923be49ac1f81e9cf95bd2ae/README.txt#L180 .. csv-table:: Multiplication :header: "1", "2", "3", "4", "5" 1,2,3,4,5 2,4,6,8,10 3,6,9,12,15 4,8,12,16,20 5,10,15,20,25 ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_docinfo.html�������������������������������������������0000644�2200500�0257523�00000001103�13327731113�027324� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<table> <colgroup><col> <col> </colgroup><tbody> <tr><th>Project:</th><td>pg_query – Pythonic wrapper around libpg_query</td> </tr> <tr><th>Created:</th><td>mer 02 ago 2017 14:49:24 CEST</td> </tr> <tr><th>Author:</th> <td>Lele Gaifax <<a href="mailto:lele%40metapensiero.it">lele<span>@</span>metapensiero<span>.</span>it</a>></td></tr> <tr><th>License:</th><td>GNU General Public License version 3 or later</td> </tr> <tr><th>Copyright:</th> <td>© 2017, 2018 Lele Gaifax</td></tr> </tbody> </table> <div id="pg-query"> <h2>pg_query</h2> </div> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_docinfo.rst��������������������������������������������0000644�2200500�0257523�00000000426�13327731113�027177� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������:Project: pg_query -- Pythonic wrapper around libpg_query :Created: mer 02 ago 2017 14:49:24 CEST :Author: Lele Gaifax <lele@metapensiero.it> :License: GNU General Public License version 3 or later :Copyright: © 2017, 2018 Lele Gaifax ========== pg_query ========== ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_linkify.html�������������������������������������������0000644�2200500�0257523�00000006673�13327731113�027371� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<a href="https://travis-ci.org/tulsawebdevs/django-multi-gtfs" rel="nofollow"><img alt="https://travis-ci.org/tulsawebdevs/django-multi-gtfs.svg?branch=master" src="https://travis-ci.org/tulsawebdevs/django-multi-gtfs.svg?branch=master"></a> <a href="https://coveralls.io/github/tulsawebdevs/django-multi-gtfs" rel="nofollow"><img alt="https://coveralls.io/repos/github/tulsawebdevs/django-multi-gtfs/badge.svg?branch=django19" src="https://coveralls.io/repos/github/tulsawebdevs/django-multi-gtfs/badge.svg?branch=django19"></a> <p><strong>multigtfs</strong> is an <a href="http://choosealicense.com/licenses/apache/" rel="nofollow">Apache 2.0</a>-licensed Django app that supports importing and exporting of GTFS feeds. All features of the <a href="https://developers.google.com/transit/gtfs/reference" rel="nofollow">June 20, 2012 reference</a> are supported, including <a href="https://developers.google.com/transit/gtfs/changes#RevisionHistory" rel="nofollow">all changes</a> up to February 17, 2014. It allows multiple feeds to be stored in the database at once.</p> <p>It requires a spatial databases compatible with <a href="https://docs.djangoproject.com/en/dev/ref/contrib/gis/" rel="nofollow">GeoDjango</a>. <a href="http://www.postgresql.org" rel="nofollow">PostgreSQL</a> 9.x and <a href="http://postgis.refractions.net" rel="nofollow">PostGIS</a> 2.x are recommended for development and production, since these support all the GeoDjango features.</p> <div id="status"> <h2>Status</h2> <p>multigtfs is ready for your GTFS project.</p> <p>Point releases (0.4.1 to 0.4.2) should be safe, only adding features or fixing bugs. Minor updates (0.3.3 to 0.4.0) may include significant changes that will break relying code. In the worst case scenario, you may need to export your GTFS feeds in the original version, update multigtfs and your code, and re-import.</p> <p>multigtfs works with Django 1.5 through 1.9. In the next version, support will be limited to Django’s supported releases, so if you are using an old version you will want to update to at least 1.8, the long-term support (LTS) release.</p> <p>All valid GTFS feeds are supported for import and export. This includes feeds with extra columns not yet included in the GTFS spec, and feeds that omit <tt>calendar.txt</tt> in favor of <tt>calendar_dates.txt</tt> (such as the TriMet archive feeds). If you find a feed that doesn’t work, <a href="https://github.com/tulsawebdevs/django-multi-gtfs/issues" rel="nofollow">file a bug</a>!</p> <p>See the <a href="https://github.com/tulsawebdevs/django-multi-gtfs/issues?state=open" rel="nofollow">issues list</a> for more details on bugs and feature requests.</p> </div> <div id="example-project"> <h2>Example project</h2> <p>Check out the <a href="examples/explore/README.md" rel="nofollow">example project</a>.</p> </div> <div id="development"> <h2>Development</h2> <table> <colgroup><col> <col> </colgroup><tbody> <tr><th>Code:</th><td><a href="https://github.com/tulsawebdevs/django-multi-gtfs" rel="nofollow">https://github.com/tulsawebdevs/django-multi-gtfs</a></td> </tr> <tr><th>Issues:</th><td><a href="https://github.com/tulsawebdevs/django-multi-gtfs/issues" rel="nofollow">https://github.com/tulsawebdevs/django-multi-gtfs/issues</a></td> </tr> <tr><th>Dev Docs:</th><td><a href="http://multigtfs.readthedocs.org/" rel="nofollow">http://multigtfs.readthedocs.org/</a></td> </tr> <tr><th>IRC:</th><td><a>irc://irc.freenode.net/tulsawebdevs</a></td> </tr> </tbody> </table> </div> ���������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_linkify.rst��������������������������������������������0000644�2200500�0257523�00000005343�13327731113�027226� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������multigtfs: GTFS as a Django app =============================== .. image:: https://travis-ci.org/tulsawebdevs/django-multi-gtfs.svg?branch=master :target: https://travis-ci.org/tulsawebdevs/django-multi-gtfs .. image:: https://coveralls.io/repos/github/tulsawebdevs/django-multi-gtfs/badge.svg?branch=django19 :target: https://coveralls.io/github/tulsawebdevs/django-multi-gtfs .. Omit badges from docs **multigtfs** is an `Apache 2.0`_-licensed Django app that supports importing and exporting of GTFS feeds. All features of the `June 20, 2012 reference`_ are supported, including `all changes`_ up to February 17, 2014. It allows multiple feeds to be stored in the database at once. It requires a spatial databases compatible with GeoDjango_. PostgreSQL_ 9.x and PostGIS_ 2.x are recommended for development and production, since these support all the GeoDjango features. Status ------ multigtfs is ready for your GTFS project. Point releases (0.4.1 to 0.4.2) should be safe, only adding features or fixing bugs. Minor updates (0.3.3 to 0.4.0) may include significant changes that will break relying code. In the worst case scenario, you may need to export your GTFS feeds in the original version, update multigtfs and your code, and re-import. multigtfs works with Django 1.5 through 1.9. In the next version, support will be limited to Django's supported releases, so if you are using an old version you will want to update to at least 1.8, the long-term support (LTS) release. All valid GTFS feeds are supported for import and export. This includes feeds with extra columns not yet included in the GTFS spec, and feeds that omit ``calendar.txt`` in favor of ``calendar_dates.txt`` (such as the TriMet archive feeds). If you find a feed that doesn't work, `file a bug`_! See the `issues list`_ for more details on bugs and feature requests. Example project --------------- Check out the `example project <examples/explore/README.md>`_. Development ----------- :Code: https://github.com/tulsawebdevs/django-multi-gtfs :Issues: https://github.com/tulsawebdevs/django-multi-gtfs/issues :Dev Docs: http://multigtfs.readthedocs.org/ :IRC: irc://irc.freenode.net/tulsawebdevs .. _`Apache 2.0`: http://choosealicense.com/licenses/apache/ .. _`June 20, 2012 reference`: https://developers.google.com/transit/gtfs/reference .. _`all changes`: https://developers.google.com/transit/gtfs/changes#RevisionHistory .. _PostgreSQL: http://www.postgresql.org .. _PostGIS: http://postgis.refractions.net .. _GeoDjango: https://docs.djangoproject.com/en/dev/ref/contrib/gis/ .. _`file a bug`: https://github.com/tulsawebdevs/django-multi-gtfs/issues .. _`issues list`: https://github.com/tulsawebdevs/django-multi-gtfs/issues?state=open ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_png.html�����������������������������������������������0000644�2200500�0257523�00000000116�13347322164�026476� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<img alt="https://example.com/badge.png" src="https://example.com/badge.png"> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_png.rst������������������������������������������������0000644�2200500�0257523�00000000051�13347322164�026340� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.. image:: https://example.com/badge.png ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_png_attrs.html�����������������������������������������0000644�2200500�0257523�00000000123�13351217304�027703� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<img alt="alternate text" class="align-right" src="https://example.com/badge.png"> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_png_attrs.rst������������������������������������������0000644�2200500�0257523�00000000165�13347322164�027563� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.. image:: https://example.com/badge.png :height: 100px :width: 25.0% :alt: alternate text :align: right �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_svg.html�����������������������������������������������0000644�2200500�0257523�00000000116�13347322164�026511� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<img alt="https://example.com/badge.svg" src="https://example.com/badge.svg"> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_svg.rst������������������������������������������������0000644�2200500�0257523�00000000051�13327731113�026347� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.. image:: https://example.com/badge.svg ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_svg_attrs.html�����������������������������������������0000644�2200500�0257523�00000000123�13351217304�027716� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<img alt="alternate text" class="align-right" src="https://example.com/badge.svg"> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_rst_svg_attrs.rst������������������������������������������0000644�2200500�0257523�00000000165�13347322164�027576� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.. image:: https://example.com/badge.svg :height: 100px :width: 25.0% :alt: alternate text :align: right �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_txt_001.html�����������������������������������������������0000644�2200500�0257523�00000017627�13327731113�026234� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Algen<br><br>Algen generates opionated ORM classes for sqlalchemy given a simple schema<br>either as a commandline string or as a yaml file.<br>It is designed to have minimal dependencies and is trivially extensible.<br>A command line tool is bundled along to help generate the models.<br>For DB specific types, only postgres is currently supported.<br>The tool currently assumes that sqlalchemy's declarative base object<br>is to be imported like ```from .alchemy_base import Base```<br><br><br>### CLI<br>```bash<br>$ algen --help<br>Usage: algen [OPTIONS]<br><br>Options:<br> -n, --name TEXT Name of model<br> -c, --columns TEXT Column definition. e.g. col_name:col_type Can be<br> used multiple times hence named columns. e.g. -c<br> foo:Int -c bar:Unicode(20)<br> -d, --destination PATH Destination directory. Default will assume 'Models'<br> directory inside the current working directory<br> -y, --yaml PATH Yaml file describing the Model. This supersedes the<br> column definition provided through --columns option.<br> --help Show this message and exit.<br>```<br><br>Given a file as follows:<br>```yaml<br>Person:<br> columns:<br> - name: id<br> type: BigInteger<br> primary_key: True<br> auto_increment: True<br> - name: name<br> type: Unicode(255)<br> - name: is_vip<br> type: Boolean<br> - name: created_at<br> type: DateTime(timezone=True)<br><br>Address:<br> columns:<br> - name: id<br> type: BigInteger<br> primary_key: True<br> auto_increment: True<br> - name: line1<br> type: Unicode()<br> - name: line2<br> type: Unicode()<br> - name: line3<br> type: Unicode()<br> - name: postcode<br> type: Unicode(10)<br> index: True<br>```<br><br>The cli tool will create two the following two files ```Person.py``` and ```Address.py```.<br><br>```python<br>from __future__ import unicode_literals, absolute_import, print_function<br><br>from collections import namedtuple<br><br>from sqlalchemy import Column, DateTime, Boolean, Unicode, BigInteger<br><br><br>from .alchemy_base import Base<br><br>__author__ = 'danishabdullah'<br><br><br>class Person(Base):<br> __tablename__ = 'persons'<br><br> id = Column(BigInteger, primary_key=True, auto_increment=True)<br> name = Column(Unicode(255), )<br> is_vip = Column(Boolean, )<br> created_at = Column(DateTime(timezone=True), )<br><br><br> def __init__(self, id=None, name=None, is_vip=None, created_at=None):<br> self.id = id<br> self.name = name<br> self.is_vip = is_vip<br> self.created_at = created_at<br><br> def add(self, session):<br> session.add(self)<br><br> def update(self, name=None, is_vip=None, created_at=None):<br> # This function only updates a value if it is not None.<br> # Falsy values go through in the normal way.<br> # To set things to None use the usual syntax:<br> # Person.column_name = None<br><br> if name is not None:<br> self.name = name<br><br> if is_vip is not None:<br> self.is_vip = is_vip<br><br> if created_at is not None:<br> self.created_at = created_at<br><br> def delete(self, session):<br> session.delete(self)<br><br> def to_dict(self):<br> return {x: y for x, y in self.__dict__.items() if not x.startswith("_sa")}<br><br> def get_proxy_cls(self):<br> # PersonProxy is useful when you want to persist data<br> # independent of the sqlalchemy session. It's just a namedtuple<br> # that has very low memory/cpu footprint compared the regular<br> # orm class instances.<br> keys = self.to_dict().keys()<br> name = "PersonProxy"<br> return namedtuple(name, keys)<br><br> def to_proxy(self):<br> # Proxy-ing is useful when you want to persist data<br> # independent of the sqlalchemy session. It's just a namedtuple<br> # that has very low memory/cpu footprint compared the regular<br> # orm class instances.<br> cls = self._get_proxy_cls()<br> return cls(**self.to_dict())<br><br> @classmethod<br> def from_proxy(cls, proxy):<br> return cls(**proxy._asdict())<br><br> def __hash__(self):<br> return hash(str(self.id))<br><br> def __eq__(self, other):<br> return (self.id == other.id)<br><br> def __neq__(self, other):<br> return not (self.id == other.id)<br><br> def __str__(self):<br> return "<Person: {id}>".format(id=self.id)<br><br> def __unicode__(self):<br> return "<Person: {id}>".format(id=self.id)<br><br> def __repr__(self):<br> return "<Person: {id}>".format(id=self.id)<br>```<br><br>```python<br>from __future__ import unicode_literals, absolute_import, print_function<br><br>from collections import namedtuple<br><br>from sqlalchemy import Column, Unicode, BigInteger<br><br><br>from .alchemy_base import Base<br><br>__author__ = 'danishabdullah'<br><br><br>class Address(Base):<br> __tablename__ = 'addresses'<br><br> id = Column(BigInteger, primary_key=True, auto_increment=True)<br> line1 = Column(Unicode(), )<br> line2 = Column(Unicode(), )<br> line3 = Column(Unicode(), )<br> postcode = Column(Unicode(10), index=True)<br><br><br> def __init__(self, id=None, line1=None, line2=None, line3=None, postcode=None):<br> self.id = id<br> self.line1 = line1<br> self.line2 = line2<br> self.line3 = line3<br> self.postcode = postcode<br><br> def add(self, session):<br> session.add(self)<br><br> def update(self, line1=None, line2=None, line3=None, postcode=None):<br> # This function only updates a value if it is not None.<br> # Falsy values go through in the normal way.<br> # To set things to None use the usual syntax:<br> # Address.column_name = None<br><br> if line1 is not None:<br> self.line1 = line1<br><br> if line2 is not None:<br> self.line2 = line2<br><br> if line3 is not None:<br> self.line3 = line3<br><br> if postcode is not None:<br> self.postcode = postcode<br><br> def delete(self, session):<br> session.delete(self)<br><br> def to_dict(self):<br> return {x: y for x, y in self.__dict__.items() if not x.startswith("_sa")}<br><br> def get_proxy_cls(self):<br> # AddressProxy is useful when you want to persist data<br> # independent of the sqlalchemy session. It's just a namedtuple<br> # that has very low memory/cpu footprint compared the regular<br> # orm class instances.<br> keys = self.to_dict().keys()<br> name = "AddressProxy"<br> return namedtuple(name, keys)<br><br> def to_proxy(self):<br> # Proxy-ing is useful when you want to persist data<br> # independent of the sqlalchemy session. It's just a namedtuple<br> # that has very low memory/cpu footprint compared the regular<br> # orm class instances.<br> cls = self._get_proxy_cls()<br> return cls(**self.to_dict())<br><br> @classmethod<br> def from_proxy(cls, proxy):<br> return cls(**proxy._asdict())<br><br> def __hash__(self):<br> return hash(str(self.id))<br><br> def __eq__(self, other):<br> return (self.id == other.id)<br><br> def __neq__(self, other):<br> return not (self.id == other.id)<br><br> def __str__(self):<br> return "<Address: {id}>".format(id=self.id)<br><br> def __unicode__(self):<br> return "<Address: {id}>".format(id=self.id)<br><br> def __repr__(self):<br> return "<Address: {id}>".format(id=self.id)<br><br>```<br>���������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/fixtures/test_txt_001.txt������������������������������������������������0000644�2200500�0257523�00000015723�13327731113�026102� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Algen Algen generates opionated ORM classes for sqlalchemy given a simple schema either as a commandline string or as a yaml file. It is designed to have minimal dependencies and is trivially extensible. A command line tool is bundled along to help generate the models. For DB specific types, only postgres is currently supported. The tool currently assumes that sqlalchemy's declarative base object is to be imported like ```from .alchemy_base import Base``` ### CLI ```bash $ algen --help Usage: algen [OPTIONS] Options: -n, --name TEXT Name of model -c, --columns TEXT Column definition. e.g. col_name:col_type Can be used multiple times hence named columns. e.g. -c foo:Int -c bar:Unicode(20) -d, --destination PATH Destination directory. Default will assume 'Models' directory inside the current working directory -y, --yaml PATH Yaml file describing the Model. This supersedes the column definition provided through --columns option. --help Show this message and exit. ``` Given a file as follows: ```yaml Person: columns: - name: id type: BigInteger primary_key: True auto_increment: True - name: name type: Unicode(255) - name: is_vip type: Boolean - name: created_at type: DateTime(timezone=True) Address: columns: - name: id type: BigInteger primary_key: True auto_increment: True - name: line1 type: Unicode() - name: line2 type: Unicode() - name: line3 type: Unicode() - name: postcode type: Unicode(10) index: True ``` The cli tool will create two the following two files ```Person.py``` and ```Address.py```. ```python from __future__ import unicode_literals, absolute_import, print_function from collections import namedtuple from sqlalchemy import Column, DateTime, Boolean, Unicode, BigInteger from .alchemy_base import Base __author__ = 'danishabdullah' class Person(Base): __tablename__ = 'persons' id = Column(BigInteger, primary_key=True, auto_increment=True) name = Column(Unicode(255), ) is_vip = Column(Boolean, ) created_at = Column(DateTime(timezone=True), ) def __init__(self, id=None, name=None, is_vip=None, created_at=None): self.id = id self.name = name self.is_vip = is_vip self.created_at = created_at def add(self, session): session.add(self) def update(self, name=None, is_vip=None, created_at=None): # This function only updates a value if it is not None. # Falsy values go through in the normal way. # To set things to None use the usual syntax: # Person.column_name = None if name is not None: self.name = name if is_vip is not None: self.is_vip = is_vip if created_at is not None: self.created_at = created_at def delete(self, session): session.delete(self) def to_dict(self): return {x: y for x, y in self.__dict__.items() if not x.startswith("_sa")} def get_proxy_cls(self): # PersonProxy is useful when you want to persist data # independent of the sqlalchemy session. It's just a namedtuple # that has very low memory/cpu footprint compared the regular # orm class instances. keys = self.to_dict().keys() name = "PersonProxy" return namedtuple(name, keys) def to_proxy(self): # Proxy-ing is useful when you want to persist data # independent of the sqlalchemy session. It's just a namedtuple # that has very low memory/cpu footprint compared the regular # orm class instances. cls = self._get_proxy_cls() return cls(**self.to_dict()) @classmethod def from_proxy(cls, proxy): return cls(**proxy._asdict()) def __hash__(self): return hash(str(self.id)) def __eq__(self, other): return (self.id == other.id) def __neq__(self, other): return not (self.id == other.id) def __str__(self): return "<Person: {id}>".format(id=self.id) def __unicode__(self): return "<Person: {id}>".format(id=self.id) def __repr__(self): return "<Person: {id}>".format(id=self.id) ``` ```python from __future__ import unicode_literals, absolute_import, print_function from collections import namedtuple from sqlalchemy import Column, Unicode, BigInteger from .alchemy_base import Base __author__ = 'danishabdullah' class Address(Base): __tablename__ = 'addresses' id = Column(BigInteger, primary_key=True, auto_increment=True) line1 = Column(Unicode(), ) line2 = Column(Unicode(), ) line3 = Column(Unicode(), ) postcode = Column(Unicode(10), index=True) def __init__(self, id=None, line1=None, line2=None, line3=None, postcode=None): self.id = id self.line1 = line1 self.line2 = line2 self.line3 = line3 self.postcode = postcode def add(self, session): session.add(self) def update(self, line1=None, line2=None, line3=None, postcode=None): # This function only updates a value if it is not None. # Falsy values go through in the normal way. # To set things to None use the usual syntax: # Address.column_name = None if line1 is not None: self.line1 = line1 if line2 is not None: self.line2 = line2 if line3 is not None: self.line3 = line3 if postcode is not None: self.postcode = postcode def delete(self, session): session.delete(self) def to_dict(self): return {x: y for x, y in self.__dict__.items() if not x.startswith("_sa")} def get_proxy_cls(self): # AddressProxy is useful when you want to persist data # independent of the sqlalchemy session. It's just a namedtuple # that has very low memory/cpu footprint compared the regular # orm class instances. keys = self.to_dict().keys() name = "AddressProxy" return namedtuple(name, keys) def to_proxy(self): # Proxy-ing is useful when you want to persist data # independent of the sqlalchemy session. It's just a namedtuple # that has very low memory/cpu footprint compared the regular # orm class instances. cls = self._get_proxy_cls() return cls(**self.to_dict()) @classmethod def from_proxy(cls, proxy): return cls(**proxy._asdict()) def __hash__(self): return hash(str(self.id)) def __eq__(self, other): return (self.id == other.id) def __neq__(self, other): return not (self.id == other.id) def __str__(self): return "<Address: {id}>".format(id=self.id) def __unicode__(self): return "<Address: {id}>".format(id=self.id) def __repr__(self): return "<Address: {id}>".format(id=self.id) ``` ���������������������������������������������readme_renderer-24.0/tests/test_clean.py������������������������������������������������������������0000644�2200500�0257523�00000000216�13350000176�023706� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������from readme_renderer.clean import clean def test_invalid_link(): assert clean('<a href="http://exam](ple.com">foo</a>') == "<a>foo</a>" ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/test_integration_distutils.py��������������������������������������������0000644�2200500�0257523�00000005650�13327731113�027270� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������import distutils.dist import mock import pytest import setuptools.dist import readme_renderer.integration.distutils def test_valid_rst(): dist = distutils.dist.Distribution(attrs=dict( long_description="Hello, I am some text.")) checker = readme_renderer.integration.distutils.Check(dist) checker.warn = mock.Mock() checker.check_restructuredtext() checker.warn.assert_not_called() def test_invalid_rst(): dist = distutils.dist.Distribution(attrs=dict( long_description="Hello, I am some `totally borked< text.")) checker = readme_renderer.integration.distutils.Check(dist) checker.warn = mock.Mock() checker.announce = mock.Mock() checker.check_restructuredtext() # Should warn once for the syntax error, and finally to warn that the # overall syntax is invalid checker.warn.assert_called_once_with(mock.ANY) message = checker.warn.call_args[0][0] assert 'invalid markup' in message assert 'line 1: Warning:' in message assert 'start-string without end-string' in message # Should not have announced that it was valid. checker.announce.assert_not_called() def test_malicious_rst(): description = """ .. raw:: html <script>I am evil</script> """ dist = distutils.dist.Distribution(attrs=dict( long_description=description)) checker = readme_renderer.integration.distutils.Check(dist) checker.warn = mock.Mock() checker.announce = mock.Mock() checker.check_restructuredtext() # Should warn once for the syntax error, and finally to warn that the # overall syntax is invalid checker.warn.assert_called_once_with(mock.ANY) message = checker.warn.call_args[0][0] assert 'directive disabled' in message # Should not have announced that it was valid. checker.announce.assert_not_called() @pytest.mark.filterwarnings('ignore:::distutils.dist') def test_markdown(): dist = setuptools.dist.Distribution(attrs=dict( long_description="Hello, I am some text.", long_description_content_type="text/markdown")) checker = readme_renderer.integration.distutils.Check(dist) checker.warn = mock.Mock() checker.check_restructuredtext() checker.warn.assert_called() assert 'content type' in checker.warn.call_args[0][0] def test_invalid_missing(): dist = distutils.dist.Distribution(attrs=dict()) checker = readme_renderer.integration.distutils.Check(dist) checker.warn = mock.Mock() checker.check_restructuredtext() checker.warn.assert_called_once_with(mock.ANY) assert 'missing' in checker.warn.call_args[0][0] def test_invalid_empty(): dist = distutils.dist.Distribution(attrs=dict( long_description="")) checker = readme_renderer.integration.distutils.Check(dist) checker.warn = mock.Mock() checker.check_restructuredtext() checker.warn.assert_called_once_with(mock.ANY) assert 'missing' in checker.warn.call_args[0][0] ����������������������������������������������������������������������������������������readme_renderer-24.0/tests/test_markdown.py���������������������������������������������������������0000755�2200500�0257523�00000001566�13362473057�024501� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������import io import glob import os import pytest from readme_renderer.markdown import render, variants MD_FIXTURES = [ (fn, os.path.splitext(fn)[0] + ".html", variant) for variant in variants for fn in glob.iglob( os.path.join( os.path.dirname(__file__), "fixtures", "test_" + variant + "*.md" ) ) ] @pytest.mark.parametrize( ("md_filename", "html_filename", "variant"), MD_FIXTURES, ) def test_md_fixtures(md_filename, html_filename, variant): # Get our Markup with io.open(md_filename, encoding='utf-8') as f: md_markup = f.read() # Get our expected with io.open(html_filename, encoding="utf-8") as f: expected = f.read() assert render(md_markup, variant=variant) == expected def test_missing_variant(): assert render('Hello', variant="InvalidVariant") is None ������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/test_noextra.py����������������������������������������������������������0000755�2200500�0257523�00000001006�13363422453�024317� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������import pytest from readme_renderer.markdown import render, variants @pytest.mark.skipif(variants, reason="Extra is installed") @pytest.mark.parametrize("variant", ('GFM', 'CommonMark')) def test_no_extra(variant): with pytest.warns(UserWarning) as warnings: assert render('Hello', variant=variant) is None assert len(warnings) == 1 assert warnings[0].message.args[0] == ( "Markdown renderers are not available. " "Install 'readme_render[md]' to enable Markdown rendering." ) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/test_rst.py��������������������������������������������������������������0000755�2200500�0257523�00000002301�13327731113�023442� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������import io import glob import os.path import pytest import six from readme_renderer.rst import render @pytest.mark.parametrize( ("rst_filename", "html_filename"), [ (fn, os.path.splitext(fn)[0] + ".html") for fn in glob.glob( os.path.join(os.path.dirname(__file__), "fixtures", "test_*.rst") ) ], ) def test_rst_fixtures(rst_filename, html_filename): # Get our Markup with io.open(rst_filename, encoding='utf-8') as f: rst_markup = f.read() # Get our expected with io.open(html_filename, encoding="utf-8") as f: expected = f.read() out = render(rst_markup) if "<" in expected: assert out == expected else: assert out is None def test_rst_001(): assert render('Hello') == '<p>Hello</p>\n' def test_rst_002(): assert render('http://mymalicioussite.com/') == ( '<p><a href="http://mymalicioussite.com/" rel="nofollow">' 'http://mymalicioussite.com/</a></p>\n' ) def test_rst_raw(): warnings = six.StringIO() assert render(""" .. raw:: html <script>I am evil</script> """, stream=warnings) is None assert '"raw" directive disabled' in warnings.getvalue() �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tests/test_txt.py��������������������������������������������������������������0000644�2200500�0257523�00000001247�13327731113�023456� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������import io import glob import os.path import pytest from readme_renderer.txt import render @pytest.mark.parametrize( ("txt_filename", "html_filename"), [ (fn, os.path.splitext(fn)[0] + ".html") for fn in glob.glob( os.path.join(os.path.dirname(__file__), "fixtures", "test_*.txt") ) ], ) def test_txt_fixtures(txt_filename, html_filename): # Get our Markup with io.open(txt_filename, encoding='utf-8') as f: txt_markup = f.read() # Get our expected with io.open(html_filename, encoding="utf-8") as f: expected = f.read() out = render(txt_markup) assert out.strip() == expected.strip() ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme_renderer-24.0/tox.ini������������������������������������������������������������������������0000644�2200500�0257523�00000001015�13363422453�021374� 0����������������������������������������������������������������������������������������������������ustar �dustiningram��������������������primarygroup��������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[tox] envlist = py27,pypy,py34,py35,py36,pep8,py2pep8,packaging,noextra [testenv] deps = pytest mock commands = py.test --strict {posargs} extras = md [testenv:pep8] basepython = python3.6 deps = flake8 pep8-naming commands = flake8 . [testenv:py2pep8] basepython = python2.7 deps = flake8 pep8-naming commands = flake8 . [testenv:packaging] deps = check-manifest commands = check-manifest [testenv:noextra] basepython = python3.6 extras = [flake8] exclude = .tox,*.egg select = E,W,F,N ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������