|
|
@ -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("--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.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") |
|
|
@ -185,13 +187,23 @@ def main (args): |
|
|
|
pads = map(fixdates, pads) |
|
|
|
args.pads = list(pads) |
|
|
|
|
|
|
|
inputs = args.input |
|
|
|
inputs.sort() |
|
|
|
removelist = [] |
|
|
|
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 |
|
|
|
|
|
|
|
def has_version (padinfo, 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 = {} |
|
|
|
for p in args.pads: |
|
|
|
# print ("Trying padid", p['padid'], file=sys.stderr) |
|
|
@ -203,16 +215,6 @@ def main (args): |
|
|
|
# print ("PADBASES", file=sys.stderr) |
|
|
|
# for pb in padbases: |
|
|
|
# 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) |
|
|
|
for x in inputs: |
|
|
|
# pair input with a pad if possible |
|
|
|