Browse Source

added output option to index

add-quote-import
Michael Murtaugh 9 years ago
parent
commit
823de61ea8
  1. 7
      etherdump/commands/index.py

7
etherdump/commands/index.py

@ -69,6 +69,7 @@ def main (args):
p.add_argument("--content", default=False, action="store_true", help="rss: include (full) content tag, default: False")
p.add_argument("--link", default="diffhtml,html,text", help="link variable will be to this version, can be comma-delim list, use first avail, default: diffhtml,html,text")
p.add_argument("--linkbase", default=None, help="base url to use for links, default: try to use the feedurl")
p.add_argument("--output", default=None, help="output, default: stdout")
pg = p.add_argument_group('template variables')
pg.add_argument("--feedurl", default="feed.xml", help="rss: to use as feeds own (self) link, default: feed.xml")
@ -169,4 +170,8 @@ def main (args):
except KeyError as e:
pass
print (template.render(vars(args)).encode("utf-8"))
if args.output:
with open(args.output, "w") as f:
print (template.render(vars(args)).encode("utf-8"), file=f)
else:
print (template.render(vars(args)).encode("utf-8"))

Loading…
Cancel
Save