:py:mod:`oioioi.filetracker.storage` ==================================== .. py:module:: oioioi.filetracker.storage Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: oioioi.filetracker.storage.FiletrackerStorage .. py:class:: FiletrackerStorage(prefix='/', client=None) Bases: :py:obj:`django.core.files.storage.Storage` A base storage class, providing some default behaviors that all other storage systems can inherit or override, as necessary. .. py:method:: _make_filetracker_path(name) .. py:method:: _cut_prefix(path) .. py:method:: _open(name, mode) .. py:method:: _save(name, content) .. py:method:: read_using_cache(name) Opens a file using a cache (if it's possible) .. py:method:: save(name, content, max_length=None) Save new content to the file specified by name. The content should be a proper File object or any Python file-like object, ready to be read from the beginning. .. py:method:: delete(name) Delete the specified file from the storage system. .. py:method:: exists(name) Return True if a file referenced by the given name already exists in the storage system, or False if the name is available for a new file. .. py:method:: size(name) Return the total size, in bytes, of the file specified by name. .. py:method:: modified_time(name) .. py:method:: created_time(name) .. py:method:: accessed_time(name) .. py:method:: get_modified_time(name) Return the last modified time (as a datetime) of the file specified by name. The datetime will be timezone-aware if USE_TZ=True. .. py:method:: get_created_time(name) Return the creation time (as a datetime) of the file specified by name. The datetime will be timezone-aware if USE_TZ=True. .. py:method:: get_accessed_time(name) Return the last accessed time (as a datetime) of the file specified by name. The datetime will be timezone-aware if USE_TZ=True. .. py:method:: url(name) Return an absolute URL where the file's contents can be accessed directly by a web browser. .. py:method:: path(name) :abstractmethod: Return a local filesystem path where the file can be retrieved using Python's built-in open() function. Storage systems that can't be accessed using open() should *not* implement this method. .. py:method:: listdir(path) :abstractmethod: List the contents of the specified path. Return a 2-tuple of lists: the first item being directories, the second item being files.