summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Waldmann <tw AT waldmann-edv DOT de>2014-03-24 14:43:25 +0100
committerThomas Waldmann <tw AT waldmann-edv DOT de>2014-03-24 14:43:25 +0100
commit93c8aa11eb6764faa7f65ffb5896e4f36b7cc737 (patch)
treebc20fc0d514a4ecd4edf041f187face12abd1c58
parent71de4fa7c526e5b7e2dd42157ff35315c8dc5c64 (diff)
downloadxstatic-93c8aa11eb6764faa7f65ffb5896e4f36b7cc737.tar.gz
usage docs: simplify/fix static file serving map setup code
-rw-r--r--docs/source/using.rst3
1 files changed, 2 insertions, 1 deletions
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