My plan is:
- Gather some information (as strings) from an existing page
(information contained both in templates and in text of the page)
Generally: use Page.templatesWithParams(): this gives you a list of tuples (u'template', [u'param1', u'param2' (...)]).; those params can also be of the form 'paramname=param'. For the text in the page itself, you will probably still need a regexp.
- Create a sentence out of those strings.
stringa + stringb + stringc + (...) ;)
- Replace the first sentence of the page with the sentence just created
and save the page
Defining the first template of the page as the part until the first . (which may or may not be accurate):
new = [newsentence] new.extend(page.get().split('.')[1:]) page.put('.'.join(new))
or something like that.
--valhallasw