Mercurial > p > roundup > code
comparison roundup/cgi/templating.py @ 7758:20a87d228240
chore(lint): sort imports
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Fri, 01 Mar 2024 16:22:15 -0500 |
| parents | ab679558bb28 |
| children | b8e63e65d9a8 |
comparison
equal
deleted
inserted
replaced
| 7757:ab679558bb28 | 7758:20a87d228240 |
|---|---|
| 23 import csv | 23 import csv |
| 24 import os.path | 24 import os.path |
| 25 import re | 25 import re |
| 26 import textwrap | 26 import textwrap |
| 27 | 27 |
| 28 from roundup import hyperdb, date, support | 28 from roundup import date, hyperdb, support |
| 29 from roundup.anypy import urllib_ | 29 from roundup.anypy import urllib_ |
| 30 from roundup.anypy.cgi_ import cgi | 30 from roundup.anypy.cgi_ import cgi |
| 31 from roundup.anypy.html import html_escape | 31 from roundup.anypy.html import html_escape |
| 32 from roundup.anypy.strings import is_us, us2s, s2u, u2s, StringIO | 32 from roundup.anypy.strings import StringIO, is_us, s2u, u2s, us2s |
| 33 from roundup.cgi import TranslationService, ZTUtils | 33 from roundup.cgi import TranslationService, ZTUtils |
| 34 from roundup.cgi.timestamp import pack_timestamp | 34 from roundup.cgi.timestamp import pack_timestamp |
| 35 from roundup.exceptions import RoundupException | 35 from roundup.exceptions import RoundupException |
| 36 | |
| 36 from .KeywordsExpr import render_keywords_expression_editor | 37 from .KeywordsExpr import render_keywords_expression_editor |
| 37 | 38 |
| 38 try: | 39 try: |
| 39 from StructuredText.StructuredText import HTML as StructuredText | 40 from StructuredText.StructuredText import HTML as StructuredText |
| 40 except ImportError: | 41 except ImportError: |
| 56 _disable_url_schemes = ['javascript', 'data'] | 57 _disable_url_schemes = ['javascript', 'data'] |
| 57 | 58 |
| 58 | 59 |
| 59 def _import_markdown2(): | 60 def _import_markdown2(): |
| 60 try: | 61 try: |
| 62 import re | |
| 63 | |
| 61 import markdown2 | 64 import markdown2 |
| 62 import re | |
| 63 | 65 |
| 64 # Note: version 2.4.9 does not work with Roundup as it breaks | 66 # Note: version 2.4.9 does not work with Roundup as it breaks |
| 65 # [issue1](issue1) formatted links. | 67 # [issue1](issue1) formatted links. |
| 66 | 68 |
| 67 # Versions 2.4.8 and 2.4.10 use different methods to filter | 69 # Versions 2.4.8 and 2.4.10 use different methods to filter |
| 184 | 186 |
| 185 | 187 |
| 186 def _import_mistune(): | 188 def _import_mistune(): |
| 187 try: | 189 try: |
| 188 import mistune | 190 import mistune |
| 189 from mistune import Renderer, escape_link, escape | 191 from mistune import Renderer, escape, escape_link |
| 190 | 192 |
| 191 mistune._scheme_blacklist = [s + ':' for s in _disable_url_schemes] | 193 mistune._scheme_blacklist = [s + ':' for s in _disable_url_schemes] |
| 192 | 194 |
| 193 class LinkRendererWithRel(Renderer): | 195 class LinkRendererWithRel(Renderer): |
| 194 ''' Rendering class that sets the rel="nofollow noreferer" | 196 ''' Rendering class that sets the rel="nofollow noreferer" |
