Storage API¶
-
class
flowws.Storage.
Storage
[source]¶ Base class for file storage.
Storage objects expose methods for reading and writing of files which could actually be backed by a database or archive file, for example.
-
open
(filename, mode='r', modifiers=[], on_filesystem=False, noop=False)[source]¶ Open a file stored within this object.
Parameters: - filename – Name of the (internal) file
- mode – One of ‘r’ (read), ‘w’ (write/overwrite), ‘a’ (append) and, optionally, ‘b’ (open in binary mode)
- modifiers – List of filename modifiers which will be appended to the filename, respecting the file suffix
- on_filesystem – If True, the file must exist as a real file on the filesystem; otherwise, a python stream object may be returned
- noop – If True, return a dummy file object instead that does nothing
-
-
class
flowws.
DirectoryStorage
(root='.', group=None)[source]¶ Stores files directly on the filesystem.