Skip to content

Commit 5e832c2

Browse files
committedMay 9, 2015
Coil compatibility
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
1 parent e0af05b commit 5e832c2

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed
 

Diff for: ‎nikola/plugins/command/orphans.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ class CommandOrphans(Command):
4141
Output contains filenames only (it is passable to `xargs rm` or the like)."""
4242

4343
def _execute(self, options, args):
44-
orphans = real_scan_files(self.site)[0]
44+
l = self._doitargs['cmds'].get_plugin('list')(config=self.config, **self._doitargs)
45+
orphans = real_scan_files(l, self.site)[0]
4546
print('\n'.join([p for p in orphans if not os.path.isdir(p)]))

Diff for: ‎nikola/utils.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,11 @@ def __init__(self, main, config, doitargs):
13111311
self._main = main
13121312
self._config = config
13131313
self._doitargs = doitargs
1314-
for k, v in self._doitargs['cmds'].to_dict().items():
1314+
try:
1315+
cmdict = self._doitargs['cmds'].to_dict()
1316+
except AttributeError: # not a doit PluginDict
1317+
cmdict = self._doitargs['cmds']
1318+
for k, v in cmdict.items():
13151319
# cleanup: run is doit-only, init is useless in an existing site
13161320
if k in ['run', 'init']:
13171321
continue
@@ -1342,7 +1346,10 @@ def _run(self, cmd_args):
13421346
def _run_with_kw(self, cmd, *a, **kw):
13431347
# cyclic import hack
13441348
from nikola.plugin_categories import Command
1345-
cmd = self._doitargs['cmds'].get_plugin(cmd)
1349+
try:
1350+
cmd = self._doitargs['cmds'].get_plugin(cmd)
1351+
except AttributeError: # not a doit PluginDict
1352+
cmd = self._doitargs['cmds'][cmd]
13461353
try:
13471354
opt = cmd.get_options()
13481355
except TypeError:

0 commit comments

Comments
 (0)
Please sign in to comment.