[Python-modules-commits] [python-mkdocs] 09/11: Use themes from /usr/share/mkdocs/themes

Brian May bam at moszumanska.debian.org
Mon May 2 06:22:47 UTC 2016


This is an automated email from the git hooks/post-receive script.

bam pushed a commit to branch master
in repository python-mkdocs.

commit 99c1ff8819d7ff180fb0f053a148fd857ab1ce9f
Author: Brian May <bam at debian.org>
Date:   Mon May 2 15:53:46 2016 +1000

    Use themes from /usr/share/mkdocs/themes
    
    See https://lists.debian.org/debian-python/2016/04/msg00042.html
---
 mkdocs/utils/__init__.py | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/mkdocs/utils/__init__.py b/mkdocs/utils/__init__.py
index 9b85fc0..7859bca 100644
--- a/mkdocs/utils/__init__.py
+++ b/mkdocs/utils/__init__.py
@@ -363,15 +363,20 @@ def get_themes():
                 "with the same name".format(theme.name, theme.dist.key))
 
         elif theme.name in themes:
-            multiple_packages = [themes[theme.name].dist.key, theme.dist.key]
+            multiple_packages = [themes[theme.name], theme.dist.key]
             log.warning("The theme %s is provided by the Python packages "
                         "'%s'. The one in %s will be used.",
                         theme.name, ','.join(multiple_packages), theme.dist.key)
 
-        themes[theme.name] = theme
+        if theme.name in builtins:
+            themes[theme.name] = os.path.dirname(
+                os.path.abspath(theme.load().__file__))
+        else:
+            themes[theme.name] = os.path.join(
+                "/usr/share/mkdocs/themes",
+                theme.dist.key, theme.name)
 
-    themes = dict((name, os.path.dirname(os.path.abspath(theme.load().__file__)))
-                  for name, theme in themes.items())
+    themes = dict((name, theme_path) for name, theme_path in themes.items())
 
     return themes
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-mkdocs.git



More information about the Python-modules-commits mailing list