def __getitem__(self, i): s = text_type(self) if isinstance(i, slice): start = i.indices(len(self))[0] position = calculate_position(s, start, self.position) return StringWithLocation(s[i], position[0], position[1]) return s[i]
def render(template, debug=False, translatable=False, **args): compiled = FileLoader(debug=debug, translatable=translatable).load_string(template) return text_type(compiled.render(args))
def render(template, **args): compiled = Loader(syntax='chameleon').load_string(template) return text_type(compiled.render(args))
def render(template, debug=False, **args): compile_js_template(template, 'scratch.js') return text_type(execute_nodejs_runner('scratch.js', args))