diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-04-16 20:28:31 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-04-19 01:40:28 +0900 |
commit | 5f071bb4748876f894cdecf28a2bc5c0efb80d60 (patch) | |
tree | 136348c90cd9798e0e36f08a05b7c144dbac9716 /sphinx/environment/adapters/asset.py | |
parent | 03093acb2c80eb1a6b5f46ae7f3b43ea07f493d4 (diff) | |
download | sphinx-git-5f071bb4748876f894cdecf28a2bc5c0efb80d60.tar.gz |
Show original image URI on copying images
Diffstat (limited to 'sphinx/environment/adapters/asset.py')
-rw-r--r-- | sphinx/environment/adapters/asset.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sphinx/environment/adapters/asset.py b/sphinx/environment/adapters/asset.py new file mode 100644 index 000000000..a373205d2 --- /dev/null +++ b/sphinx/environment/adapters/asset.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +""" + sphinx.environment.adapters.assets + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Assets adapter for sphinx.environment. + + :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +if False: + # For type annotation + from sphinx.environment import BuildEnvironment # NOQA + + +class ImageAdapter(object): + def __init__(self, env): + # type: (BuildEnvironment) -> None + self.env = env + + def get_original_image_uri(self, name): + # type: (unicode) -> unicode + """Get the original image URI.""" + while name in self.env.original_image_uri: + name = self.env.original_image_uri[name] + + return name |