Skip to content
Permalink
Browse files

compatibility with doit v0.28.0

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Apr 11, 2015
1 parent 6c8b559 commit fb19e2d1aac411c0b1e67a4312970ba3994242d4
Showing with 15 additions and 9 deletions.
  1. +1 −0 CHANGES.txt
  2. +8 −6 nikola/__main__.py
  3. +5 −2 nikola/plugin_categories.py
  4. +1 −1 requirements.txt
@@ -4,6 +4,7 @@ New in master
Features
--------

* Compatibility with doit v0.28.0 (Issue #1655)
* Add reStructuredText transform support (Issue #1647)
* Produce Unicode output in ``nikola init`` (via Issue #1644)
* Add ``HIDDEN_TAGS`` and ``HIDDEN_CATEGORIES`` settings to hide some
@@ -172,8 +172,9 @@ def print_usage(cmds):

print("Nikola is a tool to create static websites and blogs. For full documentation and more information, please visit http://getnikola.com/\n\n")
print("Available commands:")
for cmd in sorted(cmds.values(), key=attrgetter('name')):
print(" nikola %-*s %s" % (20, cmd.name, cmd.doc_purpose))
for cmd_name in sorted(cmds.keys()):
cmd = cmds[cmd_name]
print(" nikola {:20s} {}".format(cmd_name, cmd.doc_purpose))
print("")
print(" nikola help show help / reference")
print(" nikola help <command> show command usage")
@@ -265,20 +266,21 @@ class DoitNikola(DoitMain):
TASK_LOADER = NikolaTaskLoader

def __init__(self, nikola, quiet=False):
super(DoitNikola, self).__init__()
self.nikola = nikola
nikola.doit = self
self.task_loader = self.TASK_LOADER(nikola, quiet)

def get_commands(self):
def get_cmds(self):
# core doit commands
cmds = DoitMain.get_commands(self)
cmds = DoitMain.get_cmds(self)
# load nikola commands
for name, cmd in self.nikola._commands.items():
cmds[name] = cmd
return cmds

def run(self, cmd_args):
sub_cmds = self.get_commands()
sub_cmds = self.get_cmds()
args = self.process_args(cmd_args)
args = [sys_decode(arg) for arg in args]

@@ -306,7 +308,7 @@ def run(self, cmd_args):
if args[0] not in sub_cmds.keys():
LOGGER.error("Unknown command {0}".format(args[0]))
return 3
if not isinstance(sub_cmds[args[0]], (Command, Help)): # Is a doit command
if sub_cmds[args[0]] is not Help and not isinstance(sub_cmds[args[0]], Command): # Is a doit command
if not self.nikola.configured:
LOGGER.error("This command needs to run inside an "
"existing Nikola site.")
@@ -80,7 +80,7 @@ class Command(BasePlugin, DoitCommand):
"""These plugins are exposed via the command line.
They implement the doit Command interface."""

name = "dummy_command"
name = _name = "dummy_command"

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Apr 11, 2015

Author Member

_name is unnecessary, I misunderstood how get_name() works — fixed in d2134eb


doc_purpose = "A short explanation."
doc_usage = ""
@@ -91,7 +91,10 @@ class Command(BasePlugin, DoitCommand):

def __init__(self, *args, **kwargs):
BasePlugin.__init__(self, *args, **kwargs)
DoitCommand.__init__(self)

def __call__(self, config=None, **kwargs):
DoitCommand.__init__(self, config, **kwargs)
return self

def execute(self, options=None, args=None):
"""Check if the command can run in the current environment,
@@ -1,4 +1,4 @@
doit==0.27.0
doit==0.28.0
Pygments>=1.6
Pillow>=2.4.0
python-dateutil==2.4.2

0 comments on commit fb19e2d

Please sign in to comment.
You can’t perform that action at this time.