filter the journal according to search also for html display

This commit is contained in:
Stephan Gabler 2012-08-10 21:34:15 +02:00
parent ee57119f0e
commit 7e762e1d63
2 changed files with 8 additions and 10 deletions

View file

@ -47,7 +47,6 @@ def to_html(journal, open_in_browser=False):
and can open it in the default browser"""
bla = to_md(journal)
html_body = markdown.markdown(bla.decode('utf8'))
print html_body
tmp_file = os.path.join(tempfile.gettempdir(), "pretty.html")
url = 'file://' + tmp_file
output_file = codecs.open(tmp_file, "w", encoding="utf8")

View file

@ -185,12 +185,15 @@ def cli():
journal.write()
# Reading mode
elif not mode_export:
elif not mode_export or args.html:
journal.filter(tags=args.text,
start_date=args.start_date, end_date=args.end_date,
strict=args.strict,
short=args.short)
journal.limit(args.limit)
if args.html:
exporters.to_html(journal, True)
else:
print(journal)
# Various export modes
@ -203,10 +206,6 @@ def cli():
elif args.markdown: # export to json
print(exporters.to_md(journal))
elif args.html: #export to html and open in browser
print 'test'
exporters.to_html(journal, True)
elif (args.encrypt is not False or args.decrypt is not False) and not PYCRYPTO:
print("PyCrypto not found. To encrypt or decrypt your journal, install the PyCrypto package from http://www.pycrypto.org.")