def _rebuild_assets(self, options, bundles): for bundle in bundles: if options.get('verbosity') >= 1: print "Building asset: %s" % bundle.output try: process(bundle, force=True, allow_debug=False) except ValueError, e: # TODO: It would be cool if we could only capture those # exceptions actually related to merging. print self.style.ERROR("Failed, error was: %s" % e)
def _render_assets(self, filter, output, files, caller=None): # resolve bundle names registry.autoload() files = [registry.get(f) or f for f in files] result = u"" urls = process(Bundle(*files, **{'output': output, 'filters': filter})) for f in urls: result += caller(f) return result
def render(self, context): bundle = self.resolve(context) result = u"" for url in process(bundle): context.update({'ASSET_URL': url}) try: result += self.childnodes.render(context) finally: context.pop() return result