File system plugins

Those plugins provide methods to access files on various storages. For instance, ‘python’ plugin uses the python API to access local files (file://), so does the GIO implementation (openpaperwork-gtk). Memory plugin allow storing data in filesystem-like manner (memory://). Later other plugins could provide access to other storages (MariaDB, HTTP, etc).

The reference implementation is ‘python’.

A fake/mock implementation is provided for testing. It behaves in a way similar to the memory plugin.


Python-based implementation


In-Memory implementation

Provides support for URIs “memory://”. Those files are actually stored in memory. It is only useful for temporary files. It has been made as a plugin so it can easily be disabled on low-memory systems (will fall back on gio.fs –> real on-disk files).

class openpaperwork_core.fs.memory.Plugin[source]
PRIORITY = 100
fs_copy(old_url, new_url)[source]
fs_exists(url)[source]
fs_get_mime(url)[source]
fs_get_mtime(url)[source]
fs_getsize(url)[source]
fs_hide(url)[source]
fs_isdir(url)[source]
fs_iswritable(url)[source]
fs_listdir(url)[source]
fs_mkdir_p(url)[source]
fs_mktemp(prefix=None, suffix=None, mode='w+b', on_disk=False, **kwargs)[source]
fs_open(uri, mode='r', needs_fileno=False, **kwargs)[source]
fs_recurse(parent_url, dir_included=False)[source]
fs_rename(old_url, new_url)[source]
fs_resolve(uri)[source]
fs_rm_rf(url, **kwargs)[source]