Commit faed9ac6 authored by murtaugh's avatar murtaugh

added --feedlimit

parent 43653310
......@@ -154,8 +154,10 @@ class SitePage (object):
ts = self.get_item_date(item)
# print ("published:", ts.strftime("%Y/%m/%d %H:%M:%S"), file=sys.stderr)
# print ("title:", item.title, file=sys.stderr)
print ("Description src:\n{0}\n".format(item.description), file=sys.stderr)
print ("Summary of data from feed", file=sys.stderr)
print ("Date: {0}".format(ts.strftime(DATETIME_STRF)), file=sys.stderr)
print ("Title:", item.title, file=sys.stderr)
print ("Description:\n{0}\n".format(item.description), file=sys.stderr)
# print (item.keys())
# print ("author:",, file=sys.stderr)
......@@ -329,6 +331,7 @@ if __name__ == "__main__":
ap.add_argument("--limit", type=int, default=None)
ap.add_argument("--force", default=False, action="store_true")
ap.add_argument("--pretend", default=False, action="store_true")
ap.add_argument("--feedlimit", type=int, default=None)
ap.add_argument("--cachedir", default="cache", help="directory where files are temporarily downloaded")
ap.add_argument("--phpimportimages", default=None, help="optional: path to mw/maintenance/importImages.php. Default is to upload via the API")
......@@ -365,3 +368,5 @@ if __name__ == "__main__":
if not args.pretend:
f.process_feed(args.cachedir, limit=args.limit, phpuploader=args.phpimportimages, user=args.user, force=args.force, pretend=args.pretend)
print (file=sys.stderr)
if args.feedlimit and i+1>=args.feedlimit:
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment