Skip to content

Commit d28dae5

Browse files
committed
as per devloai: only reload in get_config
1 parent d7cec16 commit d28dae5

3 files changed

Lines changed: 4 additions & 9 deletions

File tree

extensions/pyRevitTools.extension/pyRevit.tab/Project.panel/ptools.stack/Links.pulldown/Create Workset For Linked Element.pushbutton/ws4links_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,5 @@ def name(self):
7676
)
7777
my_config.set_option("custom_prefix_dwg_value", custom_prefix_value)
7878

79-
script.save_config(reload=True)
79+
script.save_config()
8080
main()

extensions/pyRevitTools.extension/pyRevit.tab/Project.panel/ptools.stack/Links.pulldown/Create Workset For Linked Element.pushbutton/ws4links_script.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
def main():
1919
"""Main function to create worksets for linked elements."""
20-
my_config = script.get_config()
20+
my_config = script.get_config(reload=True)
2121

2222
set_type_ws = my_config.get_option("set_type_ws", False)
2323
set_all = my_config.get_option("set_all", False)

pyrevitlib/pyrevit/script.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def get_config(section=None, reload=False):
164164
Args:
165165
section (str, optional): config section name. If not provided,
166166
it will default to the command name plus the 'config' suffix.
167-
reload (bool, optional): forces a reload, in case changes where made.
167+
reload (bool, optional): forces a reload, in case changes were made.
168168
169169
Returns:
170170
(pyrevit.coreutils.configparser.PyRevitConfigSectionParser):
@@ -183,19 +183,14 @@ def get_config(section=None, reload=False):
183183
return user_config.add_section(section)
184184

185185

186-
def save_config(reload=False):
186+
def save_config():
187187
"""Save pyRevit config.
188188
189189
Scripts should call this to save any changes they have done to their
190190
config section object received from script.get_config() method.
191-
192-
Args:
193-
reload (bool, optional): forces a reload, in case a script uses newly set config.
194191
"""
195192
from pyrevit.userconfig import user_config
196193
user_config.save_changes()
197-
if reload:
198-
user_config.reload()
199194

200195

201196
def reset_config(section=None):

0 commit comments

Comments
 (0)