ws.interactive module¶
Collection of functions extending ws.client.api.API
with various
interactive tasks.
- ws.interactive.require_login(api)¶
Check if the current
api
session is authenticated, otherwise ask for credentials.- Parameters
api – an
ws.client.api.API
instance
- 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:y
accepts the edit and callsAPI.edit
.n
discards the edit.q
will raiseInteractiveQuit
exception to let the calling program know that it should quit.e
will open the revisions in an external merge program (configurable by the$DIFFPROG
environment variable, defaults tovimdiff
).s
will allow to change the edit summary using the program specified by the$EDITOR
environment 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:
Exception
Raised when the user specified
quit
on the interactive prompt.
- ws.interactive.ask_yesno(question)¶