Patchwork [5/6] gnu: Add python-flask-babel.

login
register
mail settings
Submitter Danny Milosavljevic
Date Nov. 3, 2016, 10:56 a.m.
Message ID <20161103105604.2937-6-dannym@scratchpost.org>
Download mbox | patch
Permalink /patch/17158/
State New
Headers show

Comments

Danny Milosavljevic - Nov. 3, 2016, 10:56 a.m.
* gnu/packages/python.scm (python-flask-babel, python2-flask-babel): New variables.
---
 gnu/packages/python.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
Hartmut Goebel - Nov. 3, 2016, 10:05 p.m.
Am 03.11.2016 um 11:56 schrieb Danny Milosavljevic:
> +    (synopsis "Adds i18n/l10n support to Flask applications")

"i18n and l10n"

> +    (description "This package enables i18n/l10n support for Flask applications.")

Again i suggest being a bit more verbose like the text on the homepage:

    Implements i18n and l10n support for Flask. This is based on the
    Python babel module as well as pytz both of which are installed
    automatically for you if you install this library.

But I would write "internationalization" and "localization" in the
description since the abreviations are already used in the synopsis.

Patch

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index b765a74..21adce7 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -3925,6 +3925,37 @@  simple and Pythonic domain language.")
        `(("python2-setuptools" ,python2-setuptools)
          ,@(package-native-inputs base))))))
 
+(define-public python-flask-babel
+  (package
+    (name "python-flask-babel")
+    (version "0.11.1")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "Flask-Babel" version))
+        (sha256
+          (base32
+            "16b80cipdba9xj3jlaiaq6wgrgpjb70w3j01jjy9hbp4k71kd6yj"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-flask" ,python-flask)
+       ("python-babel" ,python-babel)
+       ("python-jinja2" ,python-jinja2)
+       ("python-pytz" ,python-pytz)))
+    (home-page "http://github.com/python-babel/flask-babel")
+    (synopsis "Adds i18n/l10n support to Flask applications")
+    (description "This package enables i18n/l10n support for Flask applications.")
+    (license license:bsd-3)
+    (properties `((python2-variant . ,(delay python2-flask-babel))))))
+
+(define-public python2-flask-babel
+  (let ((base (package-with-python2 (strip-python2-variant
+                                     python-flask-babel))))
+    (package (inherit base)
+      (native-inputs
+       `(("python2-setuptools" ,python2-setuptools)
+         ,@(package-native-inputs base))))))
+
 (define-public python-sqlalchemy-utils
   (package
     (name "python-sqlalchemy-utils")