added NOPUBLISH
This commit is contained in:
parent
980d64b4ae
commit
56e28a5cd7
@ -41,6 +41,9 @@ def main (args):
|
||||
p.add_argument("--folder", default=False, action="store_true", help="dump files in a folder named PADID (meta, text, html, dhtml), default: False")
|
||||
p.add_argument("--output", default=False, action="store_true", help="output changed padids on stdout")
|
||||
p.add_argument("--force", default=False, action="store_true", help="reload, even if revisions count matches previous")
|
||||
|
||||
p.add_argument("--nopublish", default="__NOPUBLISH__", help="no publish magic word, default: __NOPUBLISH__")
|
||||
|
||||
args = p.parse_args(args)
|
||||
|
||||
info = loadpadinfo(args.padinfo)
|
||||
@ -90,8 +93,6 @@ storing enough information to reconstruct (or understand an error occurred)
|
||||
skip=True
|
||||
break
|
||||
|
||||
## TODO: OUTPUT TO DIRECTORIES with DATA EMBEDDED IN DOCUMENTS
|
||||
## (or else in surrounding meta data!!)
|
||||
meta['padid'] = padid.encode("utf-8")
|
||||
versions = meta["versions"] = []
|
||||
versions.append({
|
||||
@ -142,6 +143,11 @@ storing enough information to reconstruct (or understand an error occurred)
|
||||
|
||||
if args.all or args.text:
|
||||
text = getjson(info['apiurl']+'getText?'+urlencode(data))
|
||||
|
||||
##ENFORCE NOPUBLISH MAGIC WORD
|
||||
if args.nopublish and args.nopublish in text:
|
||||
continue
|
||||
|
||||
ver = {"type": "text"}
|
||||
versions.append(ver)
|
||||
ver["code"] = text["_code"]
|
||||
|
Loading…
Reference in New Issue
Block a user