[CLI] colour code 'no editor' error message

This commit is contained in:
MinchinWeb 2015-05-03 21:59:20 -06:00
parent db4a5a4665
commit cf7b5d95eb
2 changed files with 1 additions and 4 deletions

View file

@ -252,7 +252,7 @@ def run(manual_args=None):
elif args.edit: elif args.edit:
if not config['editor']: if not config['editor']:
util.prompt("[You need to specify an editor in {0} to use the --edit function.]".format(install.CONFIG_FILE_PATH)) util.prompt("[{1}ERROR{2}: You need to specify an editor in {0} to use the --edit function.]".format(install.CONFIG_FILE_PATH, "\033[31m", "\033[0m"))
sys.exit(1) sys.exit(1)
other_entries = [e for e in old_entries if e not in journal.entries] other_entries = [e for e in old_entries if e not in journal.entries]
# Edit # Edit

View file

@ -5,7 +5,6 @@ from __future__ import absolute_import, unicode_literals, print_function
from .text_exporter import TextExporter from .text_exporter import TextExporter
import re import re
import sys import sys
import yaml
class YAMLExporter(TextExporter): class YAMLExporter(TextExporter):
@ -59,8 +58,6 @@ class YAMLExporter(TextExporter):
if warn_on_heading_level is True: if warn_on_heading_level is True:
print("{}WARNING{}: Headings increased past H6 on export - {} {}".format("\033[33m", "\033[0m", date_str, entry.title), file=sys.stderr) print("{}WARNING{}: Headings increased past H6 on export - {} {}".format("\033[33m", "\033[0m", date_str, entry.title), file=sys.stderr)
# top = yaml.dump(entry)
return "title: {title}\ndate: {date}\nstared: {stared}\ntags: {tags}\n{body} {space}".format( return "title: {title}\ndate: {date}\nstared: {stared}\ntags: {tags}\n{body} {space}".format(
date=date_str, date=date_str,
title=entry.title, title=entry.title,