# Path: packages/app.py
# def load_user(username):
#     def handle_500(e):
# def handle_404(e):
# def version():
# def hook_publish():
# def inject():
# 
# Path: packages/config.py



from packages.app import app
from packages.config import _cfg, _cfgi
from shutil import rmtree, copyfile
import os
import scss
import coffeescript
                            javascript += coffee # straight up copy
                        else:
                            javascript += coffeescript.compile(coffee, bare=bare)
                output = '.'.join(f.rsplit('.')[:-1]) + '.js'

                # TODO: Bug the slimit guys to support python 3
                #if not app.debug:
                #    javascript = minify(javascript)

                with open(os.path.join(app.static_folder, output), "w") as w:
                    w.write(javascript)
                    w.flush()
    except:
        pass

    try:
        d = os.walk('images')
        for f in list(d)[0][2]:
            outputpath = os.path.join(app.static_folder, os.path.basename(f))
            inputpath = os.path.join('images', f)
            copyfile(inputpath, outputpath)
    except:
        pass

@app.before_first_request
def compile_first():
    prepare()

@app.before_request
def compile_if_debug():

# Path: packages/app.py
# def load_user(username):
#     def handle_500(e):
# def handle_404(e):
# def version():
# def hook_publish():
# def inject():
# 
# Path: packages/config.py



# Path: app.py
from packages.app import app
from packages.config import _cfg, _cfgi
from shutil import rmtree, copyfile
import os
import scss
import coffeescript

                            javascript += coffee # straight up copy
                        else:
                            javascript += coffeescript.compile(coffee, bare=bare)
                output = '.'.join(f.rsplit('.')[:-1]) + '.js'

                # TODO: Bug the slimit guys to support python 3
                #if not app.debug:
                #    javascript = minify(javascript)

                with open(os.path.join(app.static_folder, output), "w") as w:
                    w.write(javascript)
                    w.flush()
    except:
        pass

    try:
        d = os.walk('images')
        for f in list(d)[0][2]:
            outputpath = os.path.join(app.static_folder, os.path.basename(f))
            inputpath = os.path.join('images', f)
            copyfile(inputpath, outputpath)
    except:
        pass

@app.before_first_request
def compile_first():
    prepare()

@app.before_request
def compile_if_debug():

    if app.debug and _cfg("debug-static-recompile").lower() in ['true','yes']: