def _find_in_dirs_or_error(name): file_path = find_file_in_dirs(name, options.templatedirs) if file_path is None: raise ToolsException("No file '%s' in any template dir" % name) if file_path in includes: LOG.info(" include '%s' (%s) already listed", name, file_path) return LOG.info(" resolved '%s' to path '%s'", name, file_path) includes.append(file_path)
def _find_in_dirs_or_error(name): file_path = find_file_in_dirs(name, options.templatedirs) if file_path is None: raise ToolsException("No file '%s' in any template dir" % name) if file_path in includes: LOG.info(" include '%s' (%s) already listed" % (name, file_path)) return LOG.info(" resolved '%s' to path '%s'" % (name, file_path)) includes.append(file_path)
def _find_include_or_error(name): try: f = find_file_in_dirs(name, options.templatedirs) except Exception, ex: raise ToolsException(str(ex))
# Collect html dependencies (if there are html files available) if 1 == len(input_html): try: deps = find_dependencies(input_html[0], options.templatedirs, env, [ 'default' ]) except Exception, e: raise ToolsException("dependency error: %s" % str(e)) else: deps = [] # Collect js dependencies if necessary if options.mode in [ 'plugin-debug', 'canvas-debug' ]: deps += [ find_file_in_dirs(js, options.templatedirs) for js in input_js ] # Write dependency info output_dependency_info(outfile_name, options.output, deps) return 0 def html_generate(env, options, input_js, input_html): """ Generate html based on the templates and build mode. """ # - dev, canvas_dev: # render top-level js files into a temporary file # collect the .js files that need to be included
# Collect html dependencies (if there are html files available) if 1 == len(input_html): try: deps = find_dependencies(input_html[0], options.templatedirs, env, ['default']) except Exception, e: raise ToolsException("dependency error: %s" % str(e)) else: deps = [] # Collect js dependencies if necessary if options.mode in ['plugin-debug', 'canvas-debug']: deps += [ find_file_in_dirs(js, options.templatedirs) for js in input_js ] # Write dependency info output_dependency_info(outfile_name, options.output, deps) return 0 def html_generate(env, options, input_js, input_html): """ Generate html based on the templates and build mode. """ # - dev, canvas_dev: