Import Export Application Settings as json file » History » Revision 3
Revision 2 (Anchi Cheng, 12/08/2017 04:56 PM) → Revision 3/6 (Anchi Cheng, 12/08/2017 05:06 PM)
h1. Import Export Application Settings as json file We have a pair python scripts used for exporting and importing application settings in your_myami/dbschema/tools. You need to run this on your leginon linux station where leginon is installed so it can find the python library. h2. Export to json file Once you have a session that successfully use the settings that you would like to distribute <pre> cd /your_myami/dbschema python ./export_leginon_settings.py <sessionname> <optional partial application name> <optional node name prefix> </pre> The options means that you could export the settings specific to the application, or node. h2. Import into database The settings needed for the application can be imported into Leginon <pre> cd /your_myami/dbschema python ./import_leginon_settings.py <your_application name> </pre> It will prompt you for location of the settings json file if it can not find it automatically. The default location of the file is /your_myami/leginon/applications/your_application.json h2. Edit json file for a different node name If you copy an application with application editor and changed the node alias to match your local naming convention, the settings get default back to the class default. You can modify the json file exported from the old application and modify it to match the new naming convention. For example, the json section for "Presets Manager" is <pre> { "PresetsManagerSettingsData":{ "stage always":true, "name":"Presets Manager", "xy only":true, "pause time":1.0, "apply offset":false, "smallsize":1024, "mag only":false, "blank":false, "optimize cycle":true, "isdefault":true, "cycle":true } }, </pre> You can change the name field to corresponds to the new node name. When it is imported as shown above, it shoud import into the new node and application.