def check_format(self): parser = ScriptParser() try: parser.eval(self.ui.file_naming_format.toPlainText()) except Exception as e: raise OptionsCheckError("", string_(e)) if self.ui.rename_files.isChecked(): if not self.ui.file_naming_format.toPlainText().strip(): raise OptionsCheckError("", _("The file naming format must not be empty."))
def check(self): self.check_format() if self.ui.move_files.isChecked() and not unicode( self.ui.move_files_to.text()).strip(): raise OptionsCheckError( _("Error"), _("The location to move files to must not be empty."))
def check(self): if not self._extractor_valid: raise OptionsCheckError(_("Invalid extractor executable"), _("Please select a valid extractor executable."))
def check(self): if not self._fpcalc_valid: raise OptionsCheckError( _("Invalid fpcalc executable"), _("Please select a valid fpcalc executable."))
def check(self): parser = ScriptParser() try: parser.eval(self.ui.tagger_script.toPlainText()) except Exception as e: raise OptionsCheckError(_("Script Error"), string_(e))
def _show_page_error(self, page, error): if not isinstance(error, OptionsCheckError): error = OptionsCheckError(_('Unexpected error'), str(error)) self.ui.pages_tree.setCurrentItem(self.page_to_item[page.NAME]) page.display_error(error)
def check_va_format(self): parser = ScriptParser() try: parser.eval(unicode(self.ui.va_file_naming_format.toPlainText())) except Exception, e: raise OptionsCheckError("", str(e))
self.ui.va_file_naming_format.setPlainText( self.config.setting["va_file_naming_format"]) def check(self): self.check_format() self.check_va_format() def check_format(self): parser = ScriptParser() try: parser.eval(unicode(self.ui.file_naming_format.toPlainText())) except Exception, e: raise OptionsCheckError("", str(e)) if self.ui.rename_files.isChecked(): if not unicode(self.ui.file_naming_format.toPlainText()).strip(): raise OptionsCheckError( "", _("The file naming format must not be empty.")) def check_va_format(self): parser = ScriptParser() try: parser.eval(unicode(self.ui.va_file_naming_format.toPlainText())) except Exception, e: raise OptionsCheckError("", str(e)) if self.ui.rename_files.isChecked(): if self.ui.use_va_format.isChecked() and not unicode( self.ui.va_file_naming_format.toPlainText()).strip(): raise OptionsCheckError( "", _("The multiple artist file naming format must not be empty." ))
self.check_format() if self.ui.move_files.isChecked() and not unicode( self.ui.move_files_to.text()).strip(): raise OptionsCheckError( _("Error"), _("The location to move files to must not be empty.")) def check_format(self): parser = ScriptParser() try: parser.eval(unicode(self.ui.file_naming_format.toPlainText())) except Exception, e: raise OptionsCheckError("", str(e)) if self.ui.rename_files.isChecked(): if not unicode(self.ui.file_naming_format.toPlainText()).strip(): raise OptionsCheckError( "", _("The file naming format must not be empty.")) def save(self): self.config.setting[ "windows_compatible_filenames"] = self.ui.windows_compatible_filenames.isChecked( ) self.config.setting[ "ascii_filenames"] = self.ui.ascii_filenames.isChecked() self.config.setting["rename_files"] = self.ui.rename_files.isChecked() self.config.setting["file_naming_format"] = unicode( self.ui.file_naming_format.toPlainText()) self.tagger.window.enable_renaming_action.setChecked( self.config.setting["rename_files"]) self.config.setting["move_files"] = self.ui.move_files.isChecked() self.config.setting["move_files_to"] = os.path.normpath( unicode(self.ui.move_files_to.text()))
def check(self): try: re.compile(unicode(self.ui.ignore_regex.text())) except re.error as e: raise OptionsCheckError(_("Regex Error"), str(e))