From: Christopher Allan Webber Date: Wed, 22 May 2013 19:07:41 +0000 (-0500) Subject: Various fixes to plugin assetlinking command. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=df69695d9e7753ba9030be9bee4208b0c2322f54;p=mediagoblin.git Various fixes to plugin assetlinking command. Actually trying to run the command helps figure out what needs to be fixed :) This commit sponsored by Justin Nichol. Thank you! --- diff --git a/mediagoblin/gmg_commands/theme.py b/mediagoblin/gmg_commands/theme.py index 3b77fe88..adf50d5a 100644 --- a/mediagoblin/gmg_commands/theme.py +++ b/mediagoblin/gmg_commands/theme.py @@ -97,7 +97,7 @@ def link_plugin_assets(plugin_static, plugins_link_dir, printer=simple_printer): # link_dir is the final directory we'll link to, a combination of # the plugin assetlink directory and plugin_static.name link_dir = os.path.sep.join( - plugins_link_dir.rstrip(os.path.sep), plugin_static.name) + [plugins_link_dir.rstrip(os.path.sep), plugin_static.name]) # make the link directory parent dirs if necessary if not os.path.lexists(plugins_link_dir): @@ -107,19 +107,19 @@ def link_plugin_assets(plugin_static, plugins_link_dir, printer=simple_printer): if os.path.lexists(link_dir): # if this isn't a symlink, there's something wrong... error out. if not os.path.islink(link_dir): - printer(_('Could not link "%s": %s exists and is not a symlink') % ( - link_dir)) + printer(_('Could not link "%s": %s exists and is not a symlink\n') % ( + plugin_static.name, link_dir)) return # if this is a symlink and the path already exists, skip it. if os.path.realpath(link_dir) == plugin_static.file_path: # Is this comment helpful or not? - printer(_('Skipping "%s"; already set up.') % ( + printer(_('Skipping "%s"; already set up.\n') % ( plugin_static.name)) return # Otherwise, it's a link that went to something else... unlink it - printer(_('Old link found for "%s"; removing.') % ( + printer(_('Old link found for "%s"; removing.\n') % ( plugin_static.name)) os.unlink(link_dir) diff --git a/mediagoblin/init/__init__.py b/mediagoblin/init/__init__.py index 6eed8ff8..444c624f 100644 --- a/mediagoblin/init/__init__.py +++ b/mediagoblin/init/__init__.py @@ -119,9 +119,9 @@ def get_staticdirector(app_config): # Let plugins load additional paths for plugin_static in hook_runall("static_setup"): - direct_domains[plugin_static['name']] = "%s/%s" % ( + direct_domains[plugin_static.name] = "%s/%s" % ( app_config['plugin_web_path'].rstrip('/'), - plugin_static['name']) + plugin_static.name) return staticdirect.StaticDirect( direct_domains)