# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. """ Manages a metadata file. """ import datetime import json import os from collections.abc import MutableMapping
from condprof.util import logger
METADATA_NAME = "condprofile.json"
class Metadata(MutableMapping): """dict-like class that holds metadata for a profile."""
def __init__(self, profile_dir):
self.metadata_file = os.path.join(profile_dir, METADATA_NAME)
logger.info("Reading existing metadata at %s" % self.metadata_file) ifnot os.path.exists(self.metadata_file):
logger.info("Could not find the metadata file in that profile")
self._data = {} else: with open(self.metadata_file) as f:
self._data = json.loads(f.read())
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.