aboutsummaryrefslogtreecommitdiffstats
path: root/markdown.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2008-08-11 20:12:28 -0400
committerWaylan Limberg <waylan@gmail.com>2008-08-11 20:12:28 -0400
commitf9bc5d2b86a94fb98e791966bb26e1abd5ef0ed2 (patch)
tree217d79e69b8972c0c4fb830a36b6b7524e615000 /markdown.py
parent2783134621439aaa1130a1b73da36b335c6b0361 (diff)
downloadmarkdown-f9bc5d2b86a94fb98e791966bb26e1abd5ef0ed2.tar.gz
markdown-f9bc5d2b86a94fb98e791966bb26e1abd5ef0ed2.tar.bz2
markdown-f9bc5d2b86a94fb98e791966bb26e1abd5ef0ed2.zip
renamed extension module and set import to extension module first, then mdx_filename
Diffstat (limited to 'markdown.py')
-rwxr-xr-xmarkdown.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/markdown.py b/markdown.py
index 38923ac..af611c8 100755
--- a/markdown.py
+++ b/markdown.py
@@ -2129,18 +2129,20 @@ def load_extension(ext_name, configs = []):
pairs = [x.split("=") for x in ext_args.split(",")]
configs.update([(x.strip(), y.strip()) for (x, y) in pairs])
- extension_module_name = "mdx_" + ext_name
+ ext_module = 'markdown_extensions'
+ module_name = '.'.join([ext_module, ext_name])
+ extension_module_name = '_'.join(['mdx', ext_name])
try:
- module = __import__(extension_module_name)
-
+ module = __import__(module_name, {}, {}, [ext_module])
except ImportError:
try:
- module = __import__('.'.join(['mdx', extension_module_name]), {}, {}, ['mdx'])
+ module = __import__(extension_module_name)
except:
message(WARN,
- "Couldn't load extension '%s' from \"%s\" - continuing without."
- % (ext_name, extension_module_name) )
+ "Failed loading extension '%s' from '%s' or '%s' "
+ "- continuing without."
+ % (ext_name, module_name, extension_module_name) )
# Return a dummy (do nothing) Extension as silent failure
return Extension(configs={})