mirror of
https://github.com/fergalmoran/picard.git
synced 2025-12-22 09:18:18 +00:00
Move iter_active_tagging_scripts() generator near over iter_*() methods
This commit is contained in:
@@ -91,6 +91,17 @@ def save_tagging_scripts_to_config(scripts, config=None):
|
||||
config.setting['list_of_scripts'] = [(s.pos, s.name, s.enabled, s.content) for s in scripts]
|
||||
|
||||
|
||||
def iter_active_tagging_scripts(config=None):
|
||||
"""Returns an iterator over the enabled and not empty tagging scripts."""
|
||||
if config is None:
|
||||
config = get_config()
|
||||
if not config.setting['enable_tagger_scripts']:
|
||||
return
|
||||
for script in iter_tagging_scripts_from_config(config=config):
|
||||
if script.enabled and script.content:
|
||||
yield script
|
||||
|
||||
|
||||
class ScriptFunctionDocError(Exception):
|
||||
pass
|
||||
|
||||
@@ -136,17 +147,6 @@ def script_function_documentation_all(fmt='markdown', pre='',
|
||||
return "\n".join(doc_elements)
|
||||
|
||||
|
||||
def iter_active_tagging_scripts(config=None):
|
||||
"""Returns an iterator over the enabled and not empty tagging scripts."""
|
||||
if config is None:
|
||||
config = get_config()
|
||||
if not config.setting['enable_tagger_scripts']:
|
||||
return
|
||||
for script in iter_tagging_scripts_from_config(config=config):
|
||||
if script.enabled and script.content:
|
||||
yield script
|
||||
|
||||
|
||||
def get_file_naming_script(settings):
|
||||
"""Retrieve the file naming script.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user