Navigation Menu

Skip to content

Commit

Permalink
Coil compatibility
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 9, 2015
1 parent e0af05b commit 5e832c2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion nikola/plugins/command/orphans.py
Expand Up @@ -41,5 +41,6 @@ class CommandOrphans(Command):
Output contains filenames only (it is passable to `xargs rm` or the like)."""

def _execute(self, options, args):
orphans = real_scan_files(self.site)[0]
l = self._doitargs['cmds'].get_plugin('list')(config=self.config, **self._doitargs)
orphans = real_scan_files(l, self.site)[0]
print('\n'.join([p for p in orphans if not os.path.isdir(p)]))
11 changes: 9 additions & 2 deletions nikola/utils.py
Expand Up @@ -1311,7 +1311,11 @@ def __init__(self, main, config, doitargs):
self._main = main
self._config = config
self._doitargs = doitargs
for k, v in self._doitargs['cmds'].to_dict().items():
try:
cmdict = self._doitargs['cmds'].to_dict()
except AttributeError: # not a doit PluginDict
cmdict = self._doitargs['cmds']
for k, v in cmdict.items():
# cleanup: run is doit-only, init is useless in an existing site
if k in ['run', 'init']:
continue
Expand Down Expand Up @@ -1342,7 +1346,10 @@ def _run(self, cmd_args):
def _run_with_kw(self, cmd, *a, **kw):
# cyclic import hack
from nikola.plugin_categories import Command
cmd = self._doitargs['cmds'].get_plugin(cmd)
try:
cmd = self._doitargs['cmds'].get_plugin(cmd)
except AttributeError: # not a doit PluginDict
cmd = self._doitargs['cmds'][cmd]
try:
opt = cmd.get_options()
except TypeError:
Expand Down

0 comments on commit 5e832c2

Please sign in to comment.