make files behaviour optional and default false in index
This commit is contained in:
parent
09cd972065
commit
26f3d4af24
@ -100,6 +100,8 @@ def main (args):
|
|||||||
p.add_argument("--linkbase", default=None, help="base url to use for links, default: try to use the feedurl")
|
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")
|
p.add_argument("--output", default=None, help="output, default: stdout")
|
||||||
|
|
||||||
|
p.add_argument("--files", default=False, action="store_true", help="include files (experimental)")
|
||||||
|
|
||||||
pg = p.add_argument_group('template variables')
|
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")
|
pg.add_argument("--feedurl", default="feed.xml", help="rss: to use as feeds own (self) link, default: feed.xml")
|
||||||
pg.add_argument("--siteurl", default=None, help="rss: to use as channel's site link, default: the etherpad url")
|
pg.add_argument("--siteurl", default=None, help="rss: to use as channel's site link, default: the etherpad url")
|
||||||
@ -185,13 +187,23 @@ def main (args):
|
|||||||
pads = map(fixdates, pads)
|
pads = map(fixdates, pads)
|
||||||
args.pads = list(pads)
|
args.pads = list(pads)
|
||||||
|
|
||||||
inputs = args.input
|
def could_have_base (x, y):
|
||||||
inputs.sort()
|
return x == y or (x.startswith(y) and x[len(y):].startswith("."))
|
||||||
removelist = []
|
|
||||||
|
def get_best_pad (x):
|
||||||
|
for pb in padbases:
|
||||||
|
p = pads_by_base[pb]
|
||||||
|
if could_have_base(x, pb):
|
||||||
|
return p
|
||||||
|
|
||||||
def has_version (padinfo, path):
|
def has_version (padinfo, path):
|
||||||
return [x for x in padinfo['versions'] if 'path' in x and x['path'] == "./"+path]
|
return [x for x in padinfo['versions'] if 'path' in x and x['path'] == "./"+path]
|
||||||
|
|
||||||
|
if args.files:
|
||||||
|
inputs = args.input
|
||||||
|
inputs.sort()
|
||||||
|
removelist = []
|
||||||
|
|
||||||
pads_by_base = {}
|
pads_by_base = {}
|
||||||
for p in args.pads:
|
for p in args.pads:
|
||||||
# print ("Trying padid", p['padid'], file=sys.stderr)
|
# print ("Trying padid", p['padid'], file=sys.stderr)
|
||||||
@ -203,16 +215,6 @@ def main (args):
|
|||||||
# print ("PADBASES", file=sys.stderr)
|
# print ("PADBASES", file=sys.stderr)
|
||||||
# for pb in padbases:
|
# for pb in padbases:
|
||||||
# print (" ", pb, file=sys.stderr)
|
# print (" ", pb, file=sys.stderr)
|
||||||
|
|
||||||
def could_have_base (x, y):
|
|
||||||
return x == y or (x.startswith(y) and x[len(y):].startswith("."))
|
|
||||||
|
|
||||||
def get_best_pad (x):
|
|
||||||
for pb in padbases:
|
|
||||||
p = pads_by_base[pb]
|
|
||||||
if could_have_base(x, pb):
|
|
||||||
return p
|
|
||||||
|
|
||||||
print ("pairing input files with pads", file=sys.stderr)
|
print ("pairing input files with pads", file=sys.stderr)
|
||||||
for x in inputs:
|
for x in inputs:
|
||||||
# pair input with a pad if possible
|
# pair input with a pad if possible
|
||||||
|
Loading…
Reference in New Issue
Block a user