jp: added constant to handle ANSI code for header and subheaders

This commit is contained in:
Goffi 2017-04-27 00:57:04 +02:00
commit 6e70992c6c

View file

@ -67,7 +67,6 @@ URL_REDIRECT_PREFIX = 'url_redirect_'
INOTIFY_INSTALL = '"pip install inotify"'
SECURE_UNLINK_MAX = 10 * 2 # we double value as there are 2 files per draft (content and metadata)
SECURE_UNLINK_DIR = ".backup"
HEADER_ANSI = A.BOLD + A.FG_YELLOW
MB_KEYS = (u"id",
u"atom_id",
u"updated",
@ -223,7 +222,7 @@ class Get(base.CommandBase, BlogCommon):
if OUTPUT_OPT_NO_HEADER in self.args.output_opts:
header = u''
else:
header = HEADER_ANSI + k + u': ' + A.RESET
header = C.A_HEADER + k + u': ' + A.RESET
lines.append(header + data[k])
return u'\n'.join(lines)
@ -279,7 +278,7 @@ class Get(base.CommandBase, BlogCommon):
header = ''
else:
header = u"{k_fmt}{key}:{k_fmt_e} {sep}".format(
k_fmt = HEADER_ANSI,
k_fmt = C.A_HEADER,
key = k,
k_fmt_e = A.RESET,
sep = u'\n' if 'content' in k else u'')