Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Internet > HTTP (WWW)

    FilterCoffee 0.2

    Download button

    No screenshots available
    Downloads: 106  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Christian Lyder Jacobsen | More programs
    BSD License / FREE
    January 28th, 2012, 06:50 GMT [view history]
    ROOT / Internet / HTTP (WWW)

     Read user reviews (0)  Refer to a friend  Subscribe

    FilterCoffee description

    A simple WSGI Middleware for compiling CoffeeScript to JavaScript on the fly

    FilterCoffee is a simple WSGI middleware for compiling CoffeeScript to JavaScript on the fly. It is intended for use in the development of WSGI applicatons, but for deployed applications you should use some other strategy for delivering your compiled CoffeeScript (e.g., write a script to compile all your CoffeeScripts to JavaScript).

    FilterCoffee caches the compiled CoffeeScripts in memory but will recompile scripts when they are modified. A CoffeeScript compilation error results in the request returning a 500 error containing the CoffeeScript error message in the body. Error messages are also output to the wsgi.error stream so that they will show up in your console or in your servers error log.

    Installation

    FilterCoffee depends on CoffeeScript and in turn node.js. CoffeeScript expects the coffee command to be available on the current PATH. See the installation instructions for CoffeeScript for more information: http://coffeescript.org/#installation

    There are a number of different ways to install CoffeeFilter:

    Using PIP

    This is the preferred method. Run:

    pip install filtercoffee

    For an Individual Applicaiton

    Copy filtercoffee.py into an appropriate place in your WSGI applications code.

    System Wide from Downloaded Source

    Run:

    python setup.py install

    Basic Usage

    You can wrap your WSGI application in the FilterCoffee middleware like so (assuming that the variable app contains your WSGI application and the variable debug is only set when the application is in development mode:

    if debug:
     import filtercoffee
     app = filtercoffee.FilterCoffee(
     app,
     static_dir='/path/to/static/files')


    FilterCoffee will now intercept any request that ends in .js and check if a corresponding .coffee file exists. If a .coffee file exists it will be compiled and the comiled output will be returned in the response (the compiled output is also cached such that recompilation only occurs if the .coffee file changes). If no .coffee file exists, the original application is called to handle the request.

    Advanced Usage

    FilterCoffee has flexible support for deciding what it should consider a Coffee- or JavaScript. Check the arguments to FilterCoffee's __init__ method.


    Product's homepage

    Requirements:

    · Python

    What's New in This Release: [ read full changelog ]

    · Documentation Updates
    · PyPI

      


    TAGS:

    WSGI middleware | CoffeeScript compiler | WSGI | middleware | CoffeeScript

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM