I have been tasked with reworking some of the code that loads custom scripts and other tools into a user’s Maya session. Basically, the user triggers the code which creates a series of menus in the main window with various tools as menu items. The old code was considered burdensome because Maya took a long time to launch. Plus, a lot of the custom tools are no longer in use and should be retired.
I decided to start with a clean slate. I thought I could just create a directory tree, and the code would use the various paths in the tree to determine menu names and which script goes into which menu. Unfortunately, I found out a lot of files should just be ignored (like init.py). Plus, I had situations where code was placed in odd locations. For example, a modeling tool would appear under the the Model menu. However, the script is located in the Utility folder. We have a Utility menu as well. I am reluctant to move that file because it is a module that other tools import.
The previous team was able to do this because information about the tools was stored in a database. The code would call the database and use the data to set up the menus. However, this is probably one of the reasons why the code was slow. It made multiple database calls.
I am now trying to decide between several options. I could go the database route again but just make one call (or as few calls as I can). Another option is to store the data in a file next to the code. I could use a CSV file. This has an added advantage of being easy to update. I could use SQLite as well. I am not sure if one is better than the other. Is reading a CSV file slower than querying a SQLite database file?
Any insight would be highly appreciated!