User Input
- class korus.app.app_util.ui.InputLogger[source]
Bases:
object
Class for logging input values
Stores data in a JSON file named ‘last_submit.json’ in the user’s home directory under $HOME/.ktam/
Implements the methods
write()
andread()
for writing and reading to the file.
- class korus.app.app_util.ui.Option(key, message, fcn)[source]
Bases:
object
Class for handling specific, configurable input options
- Args:
- key: str,list,tuple
Input key(s) used to select the option
- message: str
Message describing actions triggered by the option
- fcn: callable
Function carrying out the action
- class korus.app.app_util.ui.UserInput(name, message, transform_fcn=<function UserInput.<lambda>>, group=None, json_fcn=<function UserInput.<lambda>>, allowed_values=None, unknown=False)[source]
Bases:
object
Interactive session for requesting user input via console.
- Args:
- name: str
Parameter name
- message: str
Request message presented to the user
- transform_fcn: callable
Function applied to input provided by the user via the console.
- group: str
Group that the parameter belongs to. Optional. Parameter names must be unique within groups.
- json_fcn: callable
Function applied to input when storing in JSON logging file.
- allowed_values:
Allowed input value(s).
- class korus.app.app_util.ui.UserInputSound(name, message, conn, taxonomy_id, group=None, default=None)[source]
Bases:
UserInput
Interactive session specifically for inputting sound-source and sound-type information.
- Args:
- name: str
Parameter name
- message: str
Request message presented to the user
- conn: sqlite3.Connection
Database connection
- taxonomy_id: int
Index of the reference taxonomy for interpreting the tags provided by the user.
- group: str
Group that the parameter belongs to. Optional. Parameter names must be unique within groups.
- class korus.app.app_util.ui.UserInputYesNo(name, message, group=None)[source]
Bases:
UserInput
Interactive session specifically for inputting yes/no answers.
- Args:
- name: str
Parameter name
- message: str
Request message presented to the user
- group: str
Group that the parameter belongs to. Optional. Parameter names must be unique within groups.