You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If get_config has already been called, and then the pyRevit_config.ini file is edited, get_config does not return the latest value from the file. This is true until the engine is reloaded (such as Ctrl + Shift + Alt.
⌨ Error/Debug Message
No error message. The old value is still returned from `get_config`.
♻️ To Reproduce
You can run this in pyRevit or RevitPythonShell.
frompyrevitimportscriptconfig=script.get_config('Demo Section')
config.first_var=42print('original value:', config.first_var)
script.save_config()
# edit pyRevit_config.ini ## Demo Section# change first_var to something elseimportconfigparsercp=configparser.ConfigParser()
importosconfig_file=os.path.join(os.getenv('APPDATA'), 'pyRevit', 'pyRevit_config.ini')
cp.read(config_file)
cp['Demo Section']['first_var'] ='12'withopen(config_file, 'w') asfile:
cp.write(file)
# this does not workconfig=script.get_config('Demo Section')
print('still old value:', config.first_var) # prints 42importsys#del script.user_configdelsys.modules['pyrevit.userconfig']
config=script.get_config('Demo Section')
print('edited value:', config.first_var) # prints new value
⏲️ Expected behavior
The latest data from pyRevit_config.ini will be read and returned.
🖥️ Hardware and Software Setup (please complete the following information)
✈ Pre-Flight checks
🐞 Describe the bug
If
get_config
has already been called, and then thepyRevit_config.ini
file is edited,get_config
does not return the latest value from the file. This is true until the engine is reloaded (such as Ctrl + Shift + Alt.⌨ Error/Debug Message
No error message. The old value is still returned from `get_config`.
♻️ To Reproduce
You can run this in pyRevit or RevitPythonShell.
⏲️ Expected behavior
The latest data from
pyRevit_config.ini
will be read and returned.🖥️ Hardware and Software Setup (please complete the following information)
Additional context
A workaround is presented in the To Reproduce section. I posted about it here: Reload required on script update?
The text was updated successfully, but these errors were encountered: