oioioi.filetracker.storage

Module Contents

Classes

FiletrackerStorage

A base storage class, providing some default behaviors that all other

class oioioi.filetracker.storage.FiletrackerStorage(prefix='/', client=None)[source]

Bases: django.core.files.storage.Storage

A base storage class, providing some default behaviors that all other storage systems can inherit or override, as necessary.

_make_filetracker_path(name)[source]
_cut_prefix(path)[source]
_open(name, mode)[source]
_save(name, content)[source]
read_using_cache(name)[source]

Opens a file using a cache (if it’s possible)

save(name, content, max_length=None)[source]

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.

delete(name)[source]

Delete the specified file from the storage system.

exists(name)[source]

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.

size(name)[source]

Return the total size, in bytes, of the file specified by name.

modified_time(name)[source]
created_time(name)[source]
accessed_time(name)[source]
get_modified_time(name)[source]

Return the last modified time (as a datetime) of the file specified by name. The datetime will be timezone-aware if USE_TZ=True.

get_created_time(name)[source]

Return the creation time (as a datetime) of the file specified by name. The datetime will be timezone-aware if USE_TZ=True.

get_accessed_time(name)[source]

Return the last accessed time (as a datetime) of the file specified by name. The datetime will be timezone-aware if USE_TZ=True.

url(name)[source]

Return an absolute URL where the file’s contents can be accessed directly by a web browser.

abstract path(name)[source]

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.

abstract listdir(path)[source]

List the contents of the specified path. Return a 2-tuple of lists: the first item being directories, the second item being files.