def __init__(self, dir, host, rrd, period="day"):
        api = twirrdy.RRDBasicAPI()
        self.rrd = rrd
        self.host = host
        path = "%s/%s/%s" % (dir, host, rrd)
        self.rrd_path = "%s.rrd" % path
        self.info = api.info(self.rrd_path)
        self.color = Colorator()
        self.period = period

        try:
            coil_fd = open("%s.coil" % path)
            try:
              coil_stat = os.fstat(coil_fd.fileno())
              self.private = not (coil_stat.st_mode & stat.S_IROTH)
              self.conf = coil.parse(coil_fd.read())
            finally:
              coil_fd.close()
        except (IOError, __HOLE__), ex:
            raise errors.InitError("Unable to read coil file: %s" % ex)

        if period not in ('day', 'week', 'month', 'year'):
            raise ValueError("Invalid period parameter")

        self.args = []
        self.ds = []
        self._init_args()
        self._init_ds()
        self._init_ds_args()
dataset/ETHPy150Open marineam/nagcat/python/nagcat/graph.py/Graph.__init__