Is it possible to have classes the respond to the run_command spread across multiple files?
For example, if I had a directory structure like this:
plugin_dir/
- commands_dir/
- __init__.py
- bootstrap.py # import all files into this file so plugin.py only has one import statement
- command_1.py
- command_2.py
- etc...
- plugin.py
- menus & settings...
Could I, somehow, still call view.run_command(‘command_1’)? I’m still new to Sublime plugins and Python in general so if I’m missing something obvious, please let me know.
An alternative that I thought of was to have the commands in the command_dir just be standard classes and then (again, somehow) call a command in the plugin.py file that would use that class based on the input from the menu item. Is that a better route?
The reason I want to structure the plugin this way is because the plugin could, potentially, have a hundred commands and I don’t want the plugin.py littered with command classes.