aboutsummaryrefslogtreecommitdiffstats
path: root/nikola/__main__.py
diff options
context:
space:
mode:
authorLibravatarAgustin Henze <tin@sluc.org.ar>2014-03-09 03:14:40 +0100
committerLibravatarAgustin Henze <tin@sluc.org.ar>2014-03-09 03:14:40 +0100
commitfa50632a9d87c3989566fed3e49c160a132e0d14 (patch)
tree81f58cc0dcfbb34710856b59c034bc47c53d91dc /nikola/__main__.py
parent2828399ba5cbb14502b023d4de1ba02f13dd5055 (diff)
Imported Upstream version 6.4.0upstream/6.4.0
Diffstat (limited to 'nikola/__main__.py')
-rw-r--r--nikola/__main__.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/nikola/__main__.py b/nikola/__main__.py
index 6b549b4..715f5b3 100644
--- a/nikola/__main__.py
+++ b/nikola/__main__.py
@@ -60,6 +60,16 @@ def main(args):
quiet = True
global config
+ colorful = False
+ if sys.stderr.isatty():
+ colorful = True
+ try:
+ import colorama
+ colorama.init()
+ except ImportError:
+ if os.name == 'nt':
+ colorful = False
+
root = get_root_dir()
if root:
os.chdir(root)
@@ -76,6 +86,8 @@ def main(args):
sys.exit(1)
config = {}
+ config.update({'__colorful__': colorful})
+
site = Nikola(**config)
return DoitNikola(site, quiet).run(args)
@@ -86,7 +98,7 @@ class Help(DoitHelp):
@staticmethod
def print_usage(cmds):
"""print nikola "usage" (basic help) instructions"""
- 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("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))