If neither `jsmin`_ nor `rjsmin`_ is installed, `code` is returned unchanged. .. _`jsmin`: https://bitbucket.org/dcs/jsmin/ .. _`rjsmin`: http://opensource.perlig.de/rjsmin/ """ jsmin = None result = code try : from rjsmin import jsmin except ImportError : try : ### https://packages.debian.org/sid/python/python-jsmin from jsmin import jsmin except ImportError : logging.warning ("Couldn't import either rjsmin nor jsmin") if jsmin is not None : try : result = jsmin (code) except Exception as exc : logging.error ("Exception during minified_js\n %s" % (exc, )) return pyk.encoded \ ( _clean_minified_js (pyk.decoded (result, "utf-8", "latin-1")) , "utf-8" ) # end def minified_js if __name__ != "__main__": CHJ._Export ("*") ### __END__ CHJ.Media
# Glasauergasse 32, A--1130 Wien, Austria. [email protected] # **************************************************************************** # This package is part of the package CHJ. # # This module is licensed under the terms of the BSD 3-Clause License # <http://www.c-tanzer.at/license/bsd_3c.html>. # **************************************************************************** # #++ # Name # CHJ.CSS.__init__ # # Purpose # Model cascading style sheets # # Revision Dates # 29-Dec-2010 (CT) Creation # 11-Oct-2016 (CT) Move from `GTW` to `CHJ` # ««revision-date»»··· #-- from _TFL.Package_Namespace import Package_Namespace from _CHJ import CHJ CSS = Package_Namespace () CHJ._Export ("CSS") del Package_Namespace ### __END__ CHJ.CSS.__init__
.. _`jsmin`: https://bitbucket.org/dcs/jsmin/ .. _`rjsmin`: http://opensource.perlig.de/rjsmin/ """ jsmin = None result = code try: from rjsmin import jsmin except ImportError: try: ### https://packages.debian.org/sid/python/python-jsmin from jsmin import jsmin except ImportError: logging.warning("Couldn't import either rjsmin nor jsmin") if jsmin is not None: try: result = jsmin(code) except Exception as exc: logging.error("Exception during minified_js\n %s" % (exc, )) return pyk.encoded \ ( _clean_minified_js (pyk.decoded (result, "utf-8", "latin-1")) , "utf-8" ) # end def minified_js if __name__ != "__main__": CHJ._Export("*") ### __END__ CHJ.Media
# Glasauergasse 32, A--1130 Wien, Austria. [email protected] # **************************************************************************** # This package is part of the package CHJ. # # This module is licensed under the terms of the BSD 3-Clause License # <http://www.c-tanzer.at/license/bsd_3c.html>. # **************************************************************************** # #++ # Name # CHJ.CSS.__init__ # # Purpose # Model cascading style sheets # # Revision Dates # 29-Dec-2010 (CT) Creation # 11-Oct-2016 (CT) Move from `GTW` to `CHJ` # ««revision-date»»··· #-- from _TFL.Package_Namespace import Package_Namespace from _CHJ import CHJ CSS = Package_Namespace() CHJ._Export("CSS") del Package_Namespace ### __END__ CHJ.CSS.__init__