ws.interactive module¶
Collection of functions extending ws.client.api.API with various
interactive tasks.
- ws.interactive.require_login(api)¶
Check if the current
apisession is authenticated, otherwise ask for credentials.- Parameters
api – an
ws.client.api.APIinstance
- ws.interactive.edit_interactive(api, title, pageid, text_old, text_new, basetimestamp, summary, **kwargs)¶
A routine for interactive editing. Presents differences between the two revisions highlighted using
ws.diff.diff_highlighted()and an interactive prompt to let the user decide what to do next:yaccepts the edit and callsAPI.edit.ndiscards the edit.qwill raiseInteractiveQuitexception to let the calling program know that it should quit.ewill open the revisions in an external merge program (configurable by the$DIFFPROGenvironment variable, defaults tovimdiff).swill allow to change the edit summary using the program specified by the$EDITORenvironment variable, defaults tovim.?will print brief legend and repeat the highlighted diff and prompt.
- Parameters
Other parameters are the same as for
ws.client.api.API.edit().
- exception ws.interactive.InteractiveQuit¶
Bases:
ExceptionRaised when the user specified
quiton the interactive prompt.
- ws.interactive.ask_yesno(question)¶