/usr/share/doc/python3-cryptography/docs
NameSizeModeActions
development/-0755rm
hazmat/-0755rm
x509/-0755rm
_static/-0755rm
api-stability.rst23300644editdlrm
changelog.rst300644editdlrm
community.rst6020644editdlrm
conf.py62160644editdlrm
cryptography-docs.py16980644editdlrm
doing-a-release.rst36670644editdlrm
exceptions.rst8530644editdlrm
faq.rst82210644editdlrm
fernet.rst114030644editdlrm
glossary.rst48690644editdlrm
index.rst27160644editdlrm
installation.rst97510644editdlrm
limitations.rst12290644editdlrm
make.bat51080644editdlrm
Makefile55880644editdlrm
random-numbers.rst15840644editdlrm
security.rst36680644editdlrm
spelling_wordlist.txt11670644editdlrm
Edit: /usr/share/doc/python3-cryptography/docs/cryptography-docs.py (1698B)
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from docutils import nodes from docutils.parsers.rst import Directive DANGER_MESSAGE = """ This is a "Hazardous Materials" module. You should **ONLY** use it if you're 100% absolutely sure that you know what you're doing because this module is full of land mines, dragons, and dinosaurs with laser guns. """ DANGER_ALTERNATE = """ You may instead be interested in :doc:`{alternate}`. """ class HazmatDirective(Directive): has_content = True def run(self): message = DANGER_MESSAGE if self.content: message += DANGER_ALTERNATE.format(alternate=self.content[0]) content = nodes.paragraph("", message) admonition_node = Hazmat("\n".join(content)) self.state.nested_parse(content, self.content_offset, admonition_node) admonition_node.line = self.lineno return [admonition_node] class Hazmat(nodes.Admonition, nodes.Element): pass def html_visit_hazmat_node(self, node): return self.visit_admonition(node, "danger") def latex_visit_hazmat_node(self, node): return self.visit_admonition(node) def depart_hazmat_node(self, node): return self.depart_admonition(node) def setup(app): app.add_node( Hazmat, html=(html_visit_hazmat_node, depart_hazmat_node), latex=(latex_visit_hazmat_node, depart_hazmat_node), ) app.add_directive("hazmat", HazmatDirective) return { "parallel_read_safe": True, }