ARLO Nester
Functions
workspace.nesterSettings Namespace Reference

Functions

def getMediaFilePath (library, relativeFilePath)
 
                   #

MediaFile Paths # # More...

 
def getJobResultFileUploadFilePath (instance, filename)
 
                  #

JobResultFiles # # More...

 
def getExportFilePath (user, filename)
 
                #

Export Files # # More...

 
def getUsersJpegCacheDirectory (mediaFile)
 
               #

Cache Files # # More...

 
def getUsersSegmentCacheDirectory (mediaFile)
 Get the path to the segment (wav) cache storage. More...
 

Detailed Description

Nester Settings for Managing properties of the installation.

This is in parallel to the standard Django settings.py. This class is
intended to keep Nester (ARLO) settings, keeping settings.py for Django
specific settings.

Notably this will be defining file paths. Use these functions to dynamically
generate file paths. This abstracts the file storage structure.

These paths are relative to MEDIA_ROOT (for the file system) and
MEDIA_URL

Function Documentation

def workspace.nesterSettings.getExportFilePath (   user,
  filename 
)

                #

Export Files # #

Generate Path for an Export file, given it's base filename.

Parameters
userUser object.
filenameName of the export file.
Returns
Path of the destination file, relative to MEDIA_ROOT
def workspace.nesterSettings.getJobResultFileUploadFilePath (   instance,
  filename 
)

                  #

JobResultFiles # #

Generate Path for a JobResultFile upload.

Note
This is intended to only be used by the JobResultFile.resultFile models.FileField.
Parameters
instanceJobResultFile instance.
filenameName of the uploaded file.
Returns
Path of the destination file, relative to MEDIA_ROOT
def workspace.nesterSettings.getMediaFilePath (   library,
  relativeFilePath 
)

                   #

MediaFile Paths # #

Given a username and mediafile name, generate the file path. This abstracts the file storage structure.

Note
Relative to MEDIA_ROOT and MEDIA_URL
Parameters
libraryLibrary object that owns the file
relativeFilePathRelative path of the file (usually the filename)
Returns
The file's relative path location, as a string
def workspace.nesterSettings.getUsersJpegCacheDirectory (   mediaFile)

               #

Cache Files # #

Get the path to the jpeg (spectra image) cache storage.

Note
Relative to MEDIA_ROOT and MEDIA_URL
Parameters
mediaFileMediaFile object that corresponds to the image.
Returns
Path of the destination file, relative to MEDIA_ROOT
def workspace.nesterSettings.getUsersSegmentCacheDirectory (   mediaFile)

Get the path to the segment (wav) cache storage.

Note
Relative to MEDIA_ROOT and MEDIA_URL
Parameters
mediaFileMediaFile object that corresponds to the segment.
Returns
Path of the destination file, relative to MEDIA_ROOT