Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command Autocomplete #13

Open
richarthurs opened this issue May 22, 2018 · 1 comment
Open

Command Autocomplete #13

richarthurs opened this issue May 22, 2018 · 1 comment
Assignees

Comments

@richarthurs
Copy link
Contributor

https://pythonexample.com/code/kivy%20suggestion%20text%20example/

Having autocomplete on the command entry would be really useful. To make it easier, we can split the command entry into separate input boxes per command component: command, subcommand, arguments. Autocomplete for one would depend on the entry in the previous box, so we can narrow down the subcommands from the main command.

@richarthurs
Copy link
Contributor Author

The main files for this are SCHEDTab.py and houston.kv.

The text boxes that set the command, epoch, etc. are around line 145 of houston.kv. Each text input has an id, such as cmd_entry which is passed up and is accessed in SCHEDTab.py as a member of the schedtab class, such as self.cmd_entry.text.

What we require is either a dropdown menu for the user to select commands (there is likely already a kivy component for this), or autocompletion of the text entered in the text input. I think that dropdown menus would probably be easier to use, at least for the main command.

Our commands consist of the following fields:

  1. "main command"
  2. subcommand
  3. command arguments

Note: it is possible for the subcommand to be empty, I think.

As a first step, try to change the text input to a dropdown, and add the following commands as dropdown options to test:

  • ack
  • get tasks

Once that works, add another dropdown for subcomand, and a text input for arguments. You'll need to mess with the layout in the houston.kv file.

  • different commands have different applicable subcommands, so we will need a nice way to make the subcommand dropdown options be contextual based on the chosen command. The arguments can be a free text input box, and perhaps autocompletion can be added later.
  • Figure out a nice way to structure the command option data, perhaps create a new object and in a new module, make a list of them. The objects will contain the main command, subcommand, etc. Or use some dicts. It's up to you! It should be broken into a new module though, and easy for us to add the data for new commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants