solidipes.loaders.file module

class solidipes.loaders.file.File(path=None)[source]

Bases: CachedMetadata, DataContainer

Abstract container class for file metadata.

A File can be read from disk and may contain multiple DataContainer entries.

_has_unresolved_comments
_has_valid_extension
_is_not_empty
classmethod _supported_extensions()[source]
add_message(author, msg) None[source]
archive_discussions(flag=True) None[source]
property archived_discussions
property discussions
property file_info
property file_stats
property modified_time
other_allowed_mime_types = ['text/plain']

List of other allowed mime types (when automatic detection is inaccurate).

property preferred_loader_name: str
property preferred_viewer: Type[Viewer] | None

Returns the default viewer for this data container.

property preferred_viewer_name: str | None

Returns the default viewer name for this data container.

supported_mime_types = {}

List of supported mime types and extensions. Override in subclasses. The key is the mime type and the value is one or more file extensions (string or list of strings)

solidipes.loaders.file._supported_extensions = {}

List of supported extensions per class

solidipes.loaders.file.get_cached_preferred_loader(path: str) Type[File] | None[source]

Get the preferred loader for a file from global cache.

solidipes.loaders.file.load_file(path: str | Path) File[source]

Load a file from path into the appropriate object type.