summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrigitta Sipocz <bsipocz@gmail.com>2014-08-19 18:56:47 +0100
committerBrigitta Sipocz <bsipocz@gmail.com>2014-08-19 18:56:47 +0100
commitc32d9328f63a89f6c850350d88ea35d9fc90f8ca (patch)
treed37165469de8533cbe0a1401b7620f1255dfd1cb
parentd5e3e00005742bbb791ac7ba8c492c891d9320de (diff)
downloadsphinx-c32d9328f63a89f6c850350d88ea35d9fc90f8ca.tar.gz
#1537: Adding the option of multiple inv for the same name & uri
-rw-r--r--sphinx/ext/intersphinx.py31
1 files changed, 18 insertions, 13 deletions
diff --git a/sphinx/ext/intersphinx.py b/sphinx/ext/intersphinx.py
index 6dcd3ea1..76866a56 100644
--- a/sphinx/ext/intersphinx.py
+++ b/sphinx/ext/intersphinx.py
@@ -179,19 +179,24 @@ def load_mappings(app):
# we can safely assume that the uri<->inv mapping is not changed
# during partial rebuilds since a changed intersphinx_mapping
# setting will cause a full environment reread
- if not inv:
- inv = posixpath.join(uri, INVENTORY_FILENAME)
- # decide whether the inventory must be read: always read local
- # files; remote ones only if the cache time is expired
- if '://' not in inv or uri not in cache \
- or cache[uri][1] < cache_time:
- app.info('loading intersphinx inventory from %s...' % inv)
- invdata = fetch_inventory(app, uri, inv)
- if invdata:
- cache[uri] = (name, now, invdata)
- else:
- cache.pop(uri, None)
- update = True
+ if not isinstance(inv, tuple):
+ invs = (inv, )
+ else:
+ invs = inv
+
+ for inv in invs:
+ if not inv:
+ inv = posixpath.join(uri, INVENTORY_FILENAME)
+ # decide whether the inventory must be read: always read local
+ # files; remote ones only if the cache time is expired
+ if '://' not in inv or uri not in cache \
+ or cache[uri][1] < cache_time:
+ app.info('loading intersphinx inventory from %s...' % inv)
+ invdata = fetch_inventory(app, uri, inv)
+ if invdata:
+ cache[uri] = (name, now, invdata)
+ update = True
+
if update:
env.intersphinx_inventory = {}
env.intersphinx_named_inventory = {}