[zopeorg-checkins] CVS: Products/ZWiki/Extensions - convert.py:1.6
Ken Manheimer
klm at zope.com
Sat Dec 15 19:42:52 EST 2001
Update of /cvs-zopeorg/Products/ZWiki/Extensions
In directory cvs.zope.org:/tmp/cvs-serv32519
Modified Files:
convert.py
Log Message:
Dang - subscription mechanism is slightly whacky, going to remove the
links until i fix it. For that purpose:
remove_subscribe_links(): Remove the subscriptions link line.
=== Products/ZWiki/Extensions/convert.py 1.5 => 1.6 ===
% (did, already_done, missed, len(bads), string.join(bads, "\n")))
+
+def remove_subscribe_links(self):
+ """Edit standard_wiki_footers to remove the "Subscribe" link.
+
+ We look recursively through all folders below the one containing the
+ method."""
+ did = missed = undone = 0
+ for f in hierarchy_folders(folder=self):
+ if hasattr(f, 'standard_wiki_footer'):
+ footer = f.standard_wiki_footer
+ raw = footer.raw
+ if string.find(raw, addline + "\n") != -1:
+ new = string.replace(raw, addline + "\n", "")
+ if new != raw:
+ did = did + 1
+ footer.raw = new
+ if not did % 100:
+ get_transaction().commit()
+ else:
+ missed = missed + 1
+ else:
+ undone = undone + 1
+ return ("Did %s footers, skipped %s not necessary, "
+ "missed %s, hit %s bad folders\n%s"
+ % (did, undone, missed, len(bads), string.join(bads, "\n")))
+
histline = ' / <a href="&dtml-wiki_page_url;/pagehistory">History</a>'
addline = (' / <a href="&dtml-wiki_page_url;/subscribeform">'
'Subscriptions</a>')
More information about the zopeorg-checkins
mailing list