def __init__(self, *args, **kwargs): Component.__init__(self, *args, **kwargs) plt.close('all') # matplotlib.rcdefaults() # set a figure size that doesn't overflow typical browser windows matplotlib.rcParams['figure.figsize'] = (5.5, 4.5)
def __init__(self, *args, **kwargs): Component.__init__(self, *args, **kwargs) self.template_name = kwargs.get("template_name") self.outdir = kwargs.get("outdir") self.rstdir = kwargs.get("rstdir") self.builddir = kwargs.get("builddir") self.srcdir = kwargs.get("srcdir") self.content = kwargs.get("content") self.display_options = kwargs.get("display_options") self.tracker_id = kwargs.get("tracker_id") self.links = kwargs.get("links")
def __init__(self, cache_name, mode="a"): Component.__init__(self) self.cache_filename = None self._cache = None self.cache_name = cache_name if "report_cachedir" in Utils.PARAMS: self.cache_dir = Utils.PARAMS["report_cachedir"] else: self.cache_dir = None if self.cache_dir: try: os.mkdir(self.cache_dir) except OSError as msg: pass if not os.path.exists(self.cache_dir): raise OSError("could not create directory %s: %s" % (self.cache_dir, msg)) self.cache_filename = os.path.join(self.cache_dir, cache_name) if mode == "r": if not os.path.exists(self.cache_filename): raise ValueError("cache %s does not exist at %s" % (self.cache_name, self.cache_filename)) # on Windows XP, the shelve does not work, work without cache try: self._cache = shelve.open( self.cache_filename, "c", writeback=False) self.debug("disp%s: using cache %s" % (id(self), self.cache_filename)) self.debug("disp%s: keys in cache: %s" % (id(self,), str(list(self._cache.keys())))) # except bsddb.db.DBFileExistsError as msg: except OSError as msg: self.warn( "disp%s: could not open cache %s - continuing without. Error = %s" % (id(self), self.cache_filename, msg)) self.cache_filename = None self._cache = None else: self.debug("disp%s: not using cache" % (id(self),))
def __init__(self, *args, **kwargs): Component.__init__(self, *args, **kwargs)