Commit c2a03d26 by murtaugh

feedr

parent ca6800d7
Showing with 4 additions and 2 deletions
......@@ -216,6 +216,7 @@ class SiteWebPage (object):
result = wiki.get("cargoquery",
tables="Site_web",
fields="_pageName=pagename,Feed_url=feed_url,Site_url=site_url,Last_updated=last_updated",
where="feed_url<>''",
order_by="pagename")
# print (json.dumps(result, indent=2))
return [cls(wiki=wiki, pagename=r['title']['pagename'], feed_url=r['title']['feed_url'], site_url=r['title']['site_url'], last_updated=cls.parse_dt(r['title']['last_updated'])) for r in result['cargoquery']]
......@@ -261,7 +262,7 @@ class SiteWebPage (object):
def save (self):
page = self.wiki.pages[self.pagename]
page_text = page.text()
temppat = re.compile(r"\{\{Flux.+?\}\}", flags=re.DOTALL)
temppat = re.compile(r"\{\{Site web.+?\}\}", flags=re.DOTALL)
m = temppat.search(page_text)
if m:
print ("Replacing template", file=sys.stderr)
......@@ -352,5 +353,6 @@ if __name__ == "__main__":
print ("last_updated: {0}".format(f.last_updated), file=sys.stderr)
else:
print ("last_updated: ---", file=sys.stderr)
f.process_feed(args.cachedir, limit=args.limit, phpuploader=args.phpimportimages, user=args.user, force=args.force, pretend=args.pretend)
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)
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 sign in to comment