@@ -0,0 +1,1052 @@
+import subprocess%0A%0Afrom functools import wraps%0Afrom os.path import splitext, join%0A%0Aextensions = %7B%7D%0A%0Adef extension(f):%0A    extensions%5Bf.__name__%5D = f%0A    # keep unwrapped function%0A    unwrapped = f%0A    @wraps(f)%0A    def wrapper(**kwargs):%0A        wrapper.settings = dict(kwargs)%0A        return unwrapped%0A    return wrapper%0A%0A@extension%0Adef coffee(filename, data):%0A    command = %5B'coffee', '-c', '-s'%5D%0A    bare = coffee.settings.get('bare')%0A    if bare:%0A        command.append('-b')%0A%0A    process = subprocess.Popen(command, stdin=subprocess.PIPE,%0A                               stdout=subprocess.PIPE, stderr=subprocess.PIPE)%0A    out, err = process.communicate(data)%0A%0A    if process.returncode:%0A        return None, err%0A    else:%0A        _,ext = splitext(filename)%0A        dest = filename.replace(ext, '.js')%0A        return dest, out%0A%0A@extension%0Adef dest(filename, data):%0A    destination = dest.settings.get('destination')%0A    if destination:%0A        filename = join(destination, filename)%0A%0A    fo = open(filename, 'w')%0A    fo.write(data)%0A    fo.close()%0A%0A

Add decorator to subscribe extensions