def __init__(self, module_name, format_fields=None, summary_fmt=None, help_page_fmt=None, group=None): if not summary_fmt: summary_fmt = "No summary for '%(command)s'" if not help_page_fmt: help_page_fmt = "No help page for '%(command)s'" self.module_name = module_name self.logger = logger.get_logger(module_name) self.command = cli.command_from_module_name(module_name) self.format_fields = format_fields if format_fields else {} self.format_fields['command'] = self.command self.summary_fmt = summary_fmt self.help_page_fmt = help_page_fmt self.group = group
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # import os from tau import logger, util from tau import SYSTEM_PREFIX, USER_PREFIX, PROJECT_DIR from tau.storage import StorageError from tau.storage.local_file import LocalFileStorage LOGGER = logger.get_logger(__name__) class ProjectStorageError(StorageError): """Indicates that the project storage has not been initialized.""" message_fmt = ("%(value)s\n" "\n" "%(hints)s\n" "Please contact %(contact)s for assistance.") def __init__(self, search_root): """Initialize the error object. Args: search_root (str): Directory in which the search for a project directory was initiated. """