Coverage for python/lsst/daf/persistence/fmtPosixRepositoryCfg.py : 88%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# # LSST Data Management System # Copyright 2017 LSST Corporation. # # This product includes software developed by the # LSST Project (http://www.lsst.org/). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the LSST License Statement and # the GNU General Public License along with this program. If not, # see <http://www.lsstcorp.org/LegalNotices/>. #
"""Serialize a RepositoryCfg to a location.
When the location is the same as cfg.root, the RepositoryCfg is to be written at the root location of the repository. In that case, root is not written in the serialized cfg; it is implicit in the location of the cfg. This allows the cfg to move from machine to machine without modification.
Parameters ---------- butlerLocation : ButlerLocation The location to write the RepositoryCfg. cfg : RepositoryCfg instance The RepositoryCfg to be serialized. """
# This class supports schema 'file' and also treats no schema as 'file'. # Split the URI and take only the path; remove the schema from loc if it's there. raise else: cfg.dirty = False return except ParentsMismatch as e: raise RuntimeError("Can not extend existing repository cfg because: {}".format(e))
"""Get a persisted RepositoryCfg from an open file object.
Parameters ---------- fileObject : an open file object the file that contains the RepositoryCfg. uri : string path to the repositoryCfg
Returns ------- A RepositoryCfg instance or None """
"""Deserialize a RepositoryCfg from a location.
Parameters ---------- butlerLocation : ButlerLocation The lcoation from which to read the RepositoryCfg.
Returns ------- RepositoryCfg The deserialized RepoistoryCfg.
Raises ------ IOError Raised if no repositoryCfg exists at the location. """ raise
|