interfaces.py

sysdirs.interfaces

Copyright (C) 2018 Mathias Stelzer

sysdirs is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

sysdirs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

sysdirs.interfaces.clean_choice_answer(choices, answer)[source]
class sysdirs.interfaces.BaseInterface(installer)[source]

Bases: object

ask_choices(prompt, choices, default=None, timeout_default=None, format_callback=None)[source]
ask_text(prompt, default=None, timeout_default=None, clean_callback=None)[source]
ask_yesno(prompt, default=None, timeout_default=None)[source]
class sysdirs.interfaces.TerminalInterface(installer)[source]

Bases: sysdirs.interfaces.BaseInterface

ask_choices(prompt, choices, default=None, timeout_default=None, format_callback=None)[source]

Show selection, wait for user input and return it.

Blocks until valid answer given.

Returns None if the timeout is reached.

_format_default(default, space=True)[source]
ask_text(prompt, default=None, timeout_default=None, clean_callback=None)[source]
ask_yesno(prompt, default=None, timeout_default=None)[source]
select(prompt='', default=None, timeout_default=None, clean_callback=None)[source]