More textile optional. 0.4.3
authorRadek Czajka <rczajka@rczajka.pl>
Wed, 2 Oct 2019 09:56:14 +0000 (11:56 +0200)
committerRadek Czajka <rczajka@rczajka.pl>
Wed, 2 Oct 2019 09:56:14 +0000 (11:56 +0200)
CHANGELOG.md
fnpdjango/utils/text/textilepl.py
setup.py

index 7164adc..8802439 100644 (file)
@@ -3,7 +3,7 @@
 This document records all notable changes to fnpdjango.
 
 
-## 0.4.2 (2019-10-02)
+## 0.4.3 (2019-10-02)
 
 - Make textile import optional when loading template tags.
 
index 434816b..bbad72a 100644 (file)
@@ -1,20 +1,23 @@
-from textile import Textile
+try:
+    from textile import Textile
+except ImportError:
+    pass
+else:
 
+    class TextilePL(Textile):
+        """Polish version of Textile.
 
-class TextilePL(Textile):
-    """Polish version of Textile.
+         Changes opening quote to Polish lower-double.
+        """
+        glyph_definitions = dict(Textile.glyph_definitions,
+            quote_double_open = '&#8222;'
+        )
 
-    Changes opening quote to Polish lower-double.
-    """
-    glyph_definitions = dict(Textile.glyph_definitions,
-        quote_double_open = '&#8222;'
-    )
 
+    def textile_pl(text):
+        return TextilePL().parse(text)
 
-def textile_pl(text):
-    return TextilePL().parse(text)
 
-
-def textile_restricted_pl(text):
-    return TextilePL(restricted=True, lite=True, noimage=True).parse(
-        text, rel='nofollow')
+    def textile_restricted_pl(text):
+        return TextilePL(restricted=True, lite=True, noimage=True).parse(
+            text, rel='nofollow')
index c5113fe..d2d3389 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -23,7 +23,7 @@ def whole_trees(package_dir, paths):
 
 setup(
     name='fnpdjango',
-    version='0.4.2',
+    version='0.4.3',
     author='Radek Czajka',
     author_email='radekczajka@nowoczesnapolska.org.pl',
     url='',