def check_format(self): parser = ScriptParser() try: parser.eval(self.script_text) except Exception as e: raise ScriptCheckError("", str(e)) if self.ui.rename_files.isChecked(): if not self.script_text.strip(): raise ScriptCheckError("", _("The file naming format must not be empty."))
def check_format(self): """Parse the file naming script and check for errors. """ config = get_config() parser = ScriptParser() script_text = self.get_script() try: parser.eval(script_text) except Exception as e: raise ScriptCheckError("", str(e)) if config.setting["rename_files"]: if not self.get_script(): raise ScriptCheckError( "", _("The file naming format must not be empty."))