def main(): print "Don't forget to add new images to the file list in image_list.py\n\n" print "You can find the generated sprite in ../images/lm_sprites.png" print "the css file is located in ../css/lm_sprites.css\n" bundles = sorted(bundler.get_bundles().itervalues(), key=key) bundles[0].make_bundle(None) print "sprite generation successful"
def handle_noargs(self, **options): # We do the image bundles first because they generate CSS that may get # bundled by a CssBundle. def key(bundle): return -int(isinstance(bundle, bundler.PngSpriteBundle)) bundles = sorted(bundler.get_bundles().itervalues(), key=key) for bundle in bundles: bundle.make_bundle()
def render(self, context): bundle_name = self.bundle_name_var.resolve(context) bundle = bundler.get_bundles()[bundle_name] type_handler = self.bundle_type_handlers[bundle.type] def process_file(file_name): return type_handler(self.bundle_name_var, file_name).render(context) tags = [process_file(file_name) for file_name in bundle.files] return "\n".join(tags)
def render(self, context): bundle_name = self.bundle_name_var.resolve(context) bundle = bundler.get_bundles()[bundle_name] type_handler = self.bundle_type_handlers[bundle.type] def process_file(file_name): node = type_handler(self.bundle_name_var, file_name) node.TAG = "%s" return node.render(context) tags = [process_file(file_name) for file_name in bundle.files] return dumps(tags)
def render(self, context): bundle = bundler.get_bundles()[self.bundle_name] if self.file_name not in bundle.files: msg = "File %r is not in bundle %r." % (self.file_name, self.bundle_name) raise template.TemplateSyntaxError(msg) url_set = context_set_default(context, self.CONTEXT_VAR, set()) if bundler_settings.USE_BUNDLES: url = bundle.get_bundle_url() else: url = bundle.url + self.file_name if url in url_set: return "" # Don't add a bundle or css url twice. else: url_set.add(url) return self.really_render(context, url)
def handle_noargs(self, **options): version_file = bundler_settings.BUNDLE_VERSION_FILE if version_file: vers_str = bundler_settings.BUNDLE_VERSIONER versioner = versioning.VERSIONERS[vers_str]() else: versioner = None # We do the image bundles first because they generate CSS that may get # bundled by a CssBundle. def key(bundle): return -int(isinstance(bundle, bundler.PngSpriteBundle)) bundles = sorted(bundler.get_bundles().itervalues(), key=key) for bundle in bundles: bundle.make_bundle(versioner) if versioner: versioning.write_versions(versioner.versions)