Uranium
Application Framework
Loading...
Searching...
No Matches
UM.FileHandler.FileHandler.FileHandler Class Reference
Inheritance diagram for UM.FileHandler.FileHandler.FileHandler:
UM.Mesh.MeshFileHandler.MeshFileHandler UM.Workspace.WorkspaceFileHandler.WorkspaceFileHandler

Public Member Functions

None __init__ (self, "QtApplication" application, str writer_type="unknown_file_writer", str reader_type="unknown_file_reader", QObject parent=None)
 
List[str] supportedReadFileTypes (self)
 
List[str] supportedWriteFileTypes (self)
 
None readLocalFile (self, QUrl file, bool add_to_recent_files_hint=True)
 
List[Dict[str, Union[str, int]]] getSupportedFileTypesWrite (self)
 
Dict[str, str] getSupportedFileTypesRead (self)
 
None addReader (self, "FileReader" reader)
 
None addWriter (self, "FileWriter" writer)
 
 readerRead (self, reader, str file_name, **Any kwargs)
 
Optional["FileWriter"] getWriterByMimeType (self, str mime)
 
Optional["FileWriter"] getWriter (self, str writer_id)
 
Optional["FileReader"] getReaderForFile (self, str file_name)
 
"FileHandler" getInstance (cls, *args, **kwargs)
 

Public Attributes

 addWriter
 
 addReader
 

Protected Member Functions

None _readLocalFile (self, QUrl file, bool add_to_recent_files_hint=True)
 

Protected Attributes

 _application
 
 _readers
 
 _writers
 
 _writer_type
 
 _reader_type
 
 _add_to_recent_files_hints
 

Detailed Description

Central class for reading and writing meshes.
This class is created by Application and handles reading and writing mesh files.

Member Function Documentation

◆ getReaderForFile()

Optional["FileReader"] UM.FileHandler.FileHandler.FileHandler.getReaderForFile ( self,
str file_name )
Find a Reader that accepts the given file name.
:param file_name: The name of file to load.
:returns: Reader that accepts the given file name. If no acceptable Reader is found None is returned.

◆ getSupportedFileTypesWrite()

List[Dict[str, Union[str, int]]] UM.FileHandler.FileHandler.FileHandler.getSupportedFileTypesWrite ( self)
Get list of all supported filetypes for writing.
:return: List of dicts containing id, extension, description and mime_type for all supported file types.

◆ getWriter()

Optional["FileWriter"] UM.FileHandler.FileHandler.FileHandler.getWriter ( self,
str writer_id )
Get an instance of a mesh writer by ID

◆ getWriterByMimeType()

Optional["FileWriter"] UM.FileHandler.FileHandler.FileHandler.getWriterByMimeType ( self,
str mime )
Get a mesh writer object that supports writing the specified mime type

:param mime: The mime type that should be supported.
:return: A FileWriter instance or None if no mesh writer supports the specified mime type. If there are multiple
writers that support the specified mime type, the first entry is returned.

◆ readerRead()

UM.FileHandler.FileHandler.FileHandler.readerRead ( self,
reader,
str file_name,
**Any kwargs )

The documentation for this class was generated from the following file: