def user_options(self): source = shared_custom_widgets.UserOptionCustomDataType( "Source", shared_custom_widgets.FolderData) destination = shared_custom_widgets.UserOptionCustomDataType( "Destination", shared_custom_widgets.FolderData) return [source, destination]
def user_options(self) -> List[UserOptions]: suppoted_identifer_types: List[str] = ["Bibid", "MMS ID"] workflow_options: List[UserOptions] = [ shared_custom_widgets.UserOptionCustomDataType( "Source", shared_custom_widgets.FolderData), shared_custom_widgets.UserOptionCustomDataType( "Destination", shared_custom_widgets.FolderData) ] id_type_option = shared_custom_widgets.ListSelection("Identifier type") for id_type in suppoted_identifer_types: id_type_option.add_selection(id_type) workflow_options.append(id_type_option) return workflow_options
def user_options(self) -> List[Union[UserOption2, UserOption3]]: def valid_tessdata_path(item: Optional[str]) -> bool: if item is None: return False if not os.path.exists(item): return False return path_contains_traineddata(item) options: List[Union[UserOption2, UserOption3]] = [] package_type = shared_custom_widgets.ListSelection("Image File Type") for file_type in OCRWorkflow.SUPPORTED_IMAGE_TYPES: package_type.add_selection(file_type) options.append(package_type) language_type = shared_custom_widgets.ListSelection( "Language") self.tessdata_path = self.global_settings.get("tessdata") if not valid_tessdata_path(self.tessdata_path): tessdata_path = locate_tessdata() print( "Note: Invalid setting for tessdata. " f"Using path {tessdata_path}", file=sys.stderr ) else: tessdata_path = self.tessdata_path for lang in self.get_available_languages( path=typing.cast(str, tessdata_path) ): fullname = ocr.LANGUAGE_CODES.get(lang) if fullname is None: continue language_type.add_selection(fullname) options.append(language_type) package_root_option = \ shared_custom_widgets.UserOptionCustomDataType( "Path", shared_custom_widgets.FolderData) options.append(package_root_option) return options
def user_options( self) -> List[Union[options.UserOption2, options.UserOption3]]: """Get the options types need to configuring the workflow. Returns: Returns a list of user option types """ user_options: List[Union[options.UserOption2, options.UserOption3]] = [ options.UserOptionCustomDataType("Input", options.FolderData), ] package_type_selection = options.ListSelection("Package Type") for package_type_name in SUPPORTED_PACKAGE_SOURCES: package_type_selection.add_selection(package_type_name) user_options.append(package_type_selection) user_options += [ options.UserOptionCustomDataType("Output Digital Library", options.FolderData), options.UserOptionCustomDataType("Output HathiTrust", options.FolderData), ] return user_options
def user_options( self) -> List[Union[options.UserOption2, options.UserOption3]]: """Get the options types need to configuring the workflow. Returns: Returns a list of user option types """ user_options: List[Union[options.UserOption2, options.UserOption3]] = [ options.UserOptionCustomDataType(USER_INPUT_PATH, options.FolderData), ] package_type_selection = options.ListSelection(PACKAGE_TYPE) for package_type_name in SUPPORTED_PACKAGE_SOURCES: package_type_selection.add_selection(package_type_name) user_options.append(package_type_selection) user_options += [ options.UserOptionCustomDataType(OUTPUT_DIGITAL_LIBRARY, options.FolderData), options.UserOptionCustomDataType(OUTPUT_HATHITRUST, options.FolderData), ] return user_options
def user_options(self): return [ shared_custom_widgets.UserOptionCustomDataType( "Input", shared_custom_widgets.FolderData) ]