diff options
author | Thomas Waldmann <tw AT waldmann-edv DOT de@localhost> | 2014-03-24 14:43:25 +0100 |
---|---|---|
committer | Thomas Waldmann <tw AT waldmann-edv DOT de@localhost> | 2014-03-24 14:43:25 +0100 |
commit | 2580d7a797cd5dce16a867eee64125efdb60f712 (patch) | |
tree | bc20fc0d514a4ecd4edf041f187face12abd1c58 | |
parent | 0a80656e600bb397df8799d970b13324d43860a8 (diff) | |
download | xstatic-git-2580d7a797cd5dce16a867eee64125efdb60f712.tar.gz |
usage docs: simplify/fix static file serving map setup code
-rw-r--r-- | docs/source/using.rst | 3 |
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 |