Пример #1
0
 def __init__(self, path, clustername, include_times=False):
     """Initialize class
     """
     self.path = path
     self.clustername = clustername
     self.include_times = include_times
     self.errstr = antstock.epoch2str(antstock.now(), "%g %H:%M:%S")
     self.base = os.path.basename(__file__)
Пример #2
0
        if db.query('dbRECORD_COUNT') == 0:
            if not legacy:
                antelog.elog_die("%s %s *die*: Zero records for the clustername '%s'." % (self.errstr, self.base, self.clustername))
            else:
                antstock.elog_die("%s %s *die*: Zero records for the clustername '%s'." % (self.errstr, self.base, self.clustername))

        db.sort('time')

        for i in range(db.query('dbRECORD_COUNT')):
            db[3] = i
            dbname_template = db.extfile()
            volumes, time, endtime = db.getv('volumes', 'time', 'endtime')

            if endtime == null_endtime:
                endtime = antstock.now()

            start_day = int(antstock.yearday(time))
            start_month = int(antstock.epoch2str(time, '%L'))
            start_year = int(antstock.epoch2str(time, '%Y'))
            end_day = int(antstock.yearday(endtime))
            end_month = int(antstock.epoch2str(endtime, '%L'))
            end_year = int(antstock.epoch2str(endtime, '%Y'))

            if volumes == 'single':
                if self.include_times:
                    namelist[dbname_template] = (time, endtime)
                else:
                    namelist = dbname_template ;

            elif volumes == 'year':