added padids for fine-grained syn
This commit is contained in:
parent
d21cc4b21e
commit
a040c3b3e5
@ -30,6 +30,7 @@ def load_padinfo(p):
|
|||||||
|
|
||||||
def main (args):
|
def main (args):
|
||||||
p = ArgumentParser("")
|
p = ArgumentParser("")
|
||||||
|
p.add_argument("padid", nargs="*", default=[])
|
||||||
p.add_argument("--padinfo", default="padinfo.json", help="padinfo, default: padinfo.json")
|
p.add_argument("--padinfo", default="padinfo.json", help="padinfo, default: padinfo.json")
|
||||||
p.add_argument("--zerorevs", default=False, action="store_true", help="include pads with zero revisions, default: False")
|
p.add_argument("--zerorevs", default=False, action="store_true", help="include pads with zero revisions, default: False")
|
||||||
p.add_argument("--pub", default="pub", help="pub path for output, default: pub")
|
p.add_argument("--pub", default="pub", help="pub path for output, default: pub")
|
||||||
@ -40,7 +41,11 @@ def main (args):
|
|||||||
info = load_padinfo(args.padinfo)
|
info = load_padinfo(args.padinfo)
|
||||||
data = {}
|
data = {}
|
||||||
data['apikey'] = info['apikey']
|
data['apikey'] = info['apikey']
|
||||||
padids = jsonload(info['api']+'listAllPads?'+urlencode(data))['data']['padIDs']
|
|
||||||
|
if args.padid:
|
||||||
|
padids = args.padid
|
||||||
|
else:
|
||||||
|
padids = jsonload(info['api']+'listAllPads?'+urlencode(data))['data']['padIDs']
|
||||||
padids.sort()
|
padids.sort()
|
||||||
numpads = len(padids)
|
numpads = len(padids)
|
||||||
maxmsglen = 0
|
maxmsglen = 0
|
||||||
@ -81,6 +86,8 @@ def main (args):
|
|||||||
|
|
||||||
count += 1
|
count += 1
|
||||||
# todo: load more metadata!
|
# todo: load more metadata!
|
||||||
|
meta['pad'], meta['group'] = splitpadname(padid)
|
||||||
|
meta['pathbase'] = p
|
||||||
meta['lastedited_raw'] = int(jsonload(info['api']+'getLastEdited?'+urlencode(data))['data']['lastEdited'])
|
meta['lastedited_raw'] = int(jsonload(info['api']+'getLastEdited?'+urlencode(data))['data']['lastEdited'])
|
||||||
meta['lastedited_iso'] = datetime.fromtimestamp(int(meta['lastedited_raw'])/1000).isoformat()
|
meta['lastedited_iso'] = datetime.fromtimestamp(int(meta['lastedited_raw'])/1000).isoformat()
|
||||||
meta['author_ids'] = jsonload(info['api'] +'listAuthorsOfPad?'+urlencode(data))['data']['authorIDs']
|
meta['author_ids'] = jsonload(info['api'] +'listAuthorsOfPad?'+urlencode(data))['data']['authorIDs']
|
||||||
|
Loading…
Reference in New Issue
Block a user