lsst.daf.persistence  13.0-11-gfc17871
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
Static Public Member Functions | Static Public Attributes | List of all members
lsst.daf.persistence.storage.storageContinued.Storage Class Reference

Static Public Member Functions

def registerStorageClass
 
def getRepositoryCfg
 
def putRepositoryCfg
 
def getMapperClass
 
def makeFromURI
 
def isPosix
 
def relativePath
 
def absolutePath
 
def search
 
def storageExists
 

Static Public Attributes

dictionary storages = {}
 

Detailed Description

Base class for storages

Definition at line 38 of file storageContinued.py.

Member Function Documentation

def lsst.daf.persistence.storage.storageContinued.Storage.absolutePath (   fromUri,
  toUri 
)
static
Get an absolute path for the path from fromUri to toUri

Parameters
----------
fromUri : the starting location
    Description
toUri : the location relative to fromUri
    Description

Returns
-------
string
    URI that is absolutepath fromUri + toUri, if one exists. If toUri is absolute or if fromUri is not
    related to toUri (e.g. are of different storage types) then toUri will be returned.

Definition at line 202 of file storageContinued.py.

def lsst.daf.persistence.storage.storageContinued.Storage.getMapperClass (   uri)
static
Get a mapper class cfg value from location described by uri.

Note that in legacy repositories the mapper may be specified by a file called _mapper at the uri
location, and in newer repositories the mapper would be specified by a RepositoryCfg stored at the uri
location.

.. warning::

    Storage is 'wet paint' and very likely to change during factorization of Butler back end and
    storage formats (DM-6225). Use of it in production code other than via the 'old butler' API is
    strongly discouraged.

Definition at line 99 of file storageContinued.py.

def lsst.daf.persistence.storage.storageContinued.Storage.getRepositoryCfg (   uri)
static
Get a RepositoryCfg from a location specified by uri.

Definition at line 77 of file storageContinued.py.

def lsst.daf.persistence.storage.storageContinued.Storage.isPosix (   uri)
static
Test if a URI is for a local filesystem storage.

This is mostly for backward compatibility; Butler V1 repositories were only ever on the local
filesystem. They may exist but not have a RepositoryCfg class. This enables conditional checking for a
V1 Repository.

This function treats 'file' and '' (no scheme) as posix storages, see
the class docstring for more details.

Parameters
----------
uri : string
    URI to the root of a Repository.

Returns
-------
Bool
    True if the URI is associated with a posix storage, else false.

Definition at line 150 of file storageContinued.py.

def lsst.daf.persistence.storage.storageContinued.Storage.makeFromURI (   uri)
static
Instantiate a storage sublcass from a URI.

.. warning::

    Storage is 'wet paint' and very likely to change during factorization of Butler back end and
    storage formats (DM-6225). Use of it in production code other than via the 'old butler' API is
    strongly discouraged.

Parameters
----------
uri : string
    The uri to the root location of a repository.

Returns
-------
A Storage subclass instance.

Definition at line 122 of file storageContinued.py.

def lsst.daf.persistence.storage.storageContinued.Storage.putRepositoryCfg (   cfg,
  uri 
)
static
Write a RepositoryCfg object to a location described by uri

Definition at line 88 of file storageContinued.py.

def lsst.daf.persistence.storage.storageContinued.Storage.registerStorageClass (   scheme,
  cls 
)
static
Register derived classes for lookup by URI scheme.

A scheme is a name that describes the form a resource at the beginning of a URI
e.g. 'http' indicates HTML and related code, such as is found in http://www.lsst.org

The only currently supported schemes are:
* 'file' where the portion of the URI after the // indicates an absolute locaiton on disk.
  for example: file:/my_repository_folder/
* '' (no scheme) where the entire string is a relative path on the local system
  for example "my_repository_folder" will indicate a folder in the current working directory with the
  same name.

See documentation for the urlparse python library for more information.

.. warning::

    Storage is 'wet paint' and very likely to change during factorization of Butler back end and
    storage formats (DM-6225). Use of it in production code other than via the 'old butler' API is
    strongly discouraged.

Parameters
----------
scheme : str
    Name of the `scheme` the class is being registered for, which appears at the beginning of a URI.
cls : class object
    A class object that should be used for a given scheme.

Definition at line 44 of file storageContinued.py.

def lsst.daf.persistence.storage.storageContinued.Storage.relativePath (   fromUri,
  toUri 
)
static
Get a relative path from a location to a location, if a relative path for these 2 locations exists.

Parameters
----------
fromPath : string
    A URI that describes a location at which to start.
toPath : string
    A URI that describes a target location.

Returns
-------
string
    A relative path that describes the path from fromUri to toUri, provided one exists. If a relative
    path between the two URIs does not exist then the entire toUri path is returned.

Definition at line 176 of file storageContinued.py.

def lsst.daf.persistence.storage.storageContinued.Storage.search (   uri,
  path 
)
static
Look for the given path in a storage root at URI; return None if it can't be found.

If the path contains an HDU indicator (a number in brackets before the
dot, e.g. 'foo.fits[1]', this will be stripped when searching and so
will match filenames without the HDU indicator, e.g. 'foo.fits'. The
path returned WILL contain the indicator though, e.g. ['foo.fits[1]'].


Parameters
----------
root : string
    URI to the the root location to search
path : string
    A filename (and optionally prefix path) to search for within root.

Returns
-------
string or None
    The location that was found, or None if no location was found.

Definition at line 228 of file storageContinued.py.

def lsst.daf.persistence.storage.storageContinued.Storage.storageExists (   uri)
static
Ask if a storage at the location described by uri exists

Parameters
----------
root : string
    URI to the the root location of the storage

Returns
-------
bool
    True if the storage exists, false if not

Definition at line 256 of file storageContinued.py.

Member Data Documentation

dictionary lsst.daf.persistence.storage.storageContinued.Storage.storages = {}
static

Definition at line 41 of file storageContinued.py.


The documentation for this class was generated from the following file: