예제 #1
0
def mini_js(app_name=None):
    """
    {{ MINI_JS }} Context Processor
    
    Gives a full URL to the minified, cached JS
    """
    return {"MINI_JS": minify_js(app_name)}
예제 #2
0
 def handle(self, *args, **options):
     """
     Cache Static Files
     """
     possible_js_cache = os.path.join(generate_cache_dir(get_main_js_dir()), "mediabrute_usefile")
     
     if os.path.isfile(possible_js_cache):
         os.unlink(possible_js_cache)
     
     js_urls = handlers.minify_js()
     js_file = open(possible_js_cache, "w")
     for url in js_urls:
         js_file.writelines(js_urls)
     js_file.close()
     
     
     possible_css_cache = os.path.join(generate_cache_dir(get_main_css_dir()), "mediabrute_usefile")
     
     if os.path.isfile(possible_css_cache):
         os.unlink(possible_css_cache)
     
     css_urls = handlers.minify_css()
     css_file = open(possible_css_cache, "w")
     for url in css_urls:
         css_file.writelines(css_urls)            
     css_file.close()
     
예제 #3
0
def mini_js(app_name=None):
    """
    {{ MINI_JS }} Context Processor
    
    Gives a full URL to the minified, cached JS
    """
    return {"MINI_JS": minify_js(app_name)}