From 93c8aa11eb6764faa7f65ffb5896e4f36b7cc737 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Mon, 24 Mar 2014 14:43:25 +0100 Subject: usage docs: simplify/fix static file serving map setup code --- docs/source/using.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/using.rst b/docs/source/using.rst index d464734..e7e400c 100644 --- a/docs/source/using.rst +++ b/docs/source/using.rst @@ -31,10 +31,11 @@ Example code to setup local file serving 'jquery', 'bootstrap', 'font_awesome', ] pkg = __import__('xstatic.pkg', fromlist=mod_names) + serve_files = {} for mod_name in mod_names: mod = getattr(pkg, mod_name) xs = XStatic(mod, root_url='/static', provider='local', protocol='http') - serve_files.update([(xs.name, xs.base_dir)]) + serve_files[xs.name] = xs.base_dir # now, serve_files has the mapping name -> base_dir for all the xstatic # packages you want to use. you can use it in your python code to set -- cgit v1.2.1