diff options
author | Waylan Limberg <waylan@gmail.com> | 2008-08-11 20:12:28 -0400 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2008-08-11 20:12:28 -0400 |
commit | f9bc5d2b86a94fb98e791966bb26e1abd5ef0ed2 (patch) | |
tree | 217d79e69b8972c0c4fb830a36b6b7524e615000 /markdown.py | |
parent | 2783134621439aaa1130a1b73da36b335c6b0361 (diff) | |
download | markdown-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-x | markdown.py | 14 |
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={}) |