Ejemplo n.º 1
0
def call_summary():
    try:
        db = get_easy_logs_db2(do_not_use_cloud=True, do_not_use_local=False, ignore_cache=False)
        logs = db.query(query='*')
        s = format_logs(logs)
        return s
    except dtu.DTNoMatches:
        pass
Ejemplo n.º 2
0
    def define_jobs_context(self, context):
        outdir = self.options["outdir"]
        if outdir is None:
            outdir = "."
            msg = 'Option "--outdir" not passed. Will copy to current directory.'
            self.warn(msg)

        max_images = self.options["max_images"]
        only_camera = not self.options["all_topics"]
        write_frames = self.options["write_frames"]
        extra = self.options.get_extra()

        if not extra:
            query = "*"
        else:
            query = extra

        db = self.get_easy_logs_db()
        logs = db.query(query)

        self.info(f"Found {len(logs)} logs.")
        logs_valid = {}
        for log_name, log in list(logs.items()):
            if log.valid:
                logs_valid[log_name] = log

        if not logs_valid:
            msg = "None of the logs were valid."
            raise dtu.DTUserError(msg)

        s = format_logs(logs_valid)
        self.info(s)

        od = self.options["output"]

        for log_name, log in list(logs_valid.items()):
            out = os.path.join(od, log_name)

            log_downloaded = download_if_necessary(log)

            context.comp(
                work,
                log_downloaded,
                out,
                max_images,
                only_camera=only_camera,
                write_frames=write_frames,
                job_id=log_name,
            )
Ejemplo n.º 3
0
    def define_jobs_context(self, context):
        outdir = self.options.outdir
        if outdir is None:
            outdir = '.'
            msg = 'Option "--outdir" not passed. Will copy to current directory.'
            self.warn(msg)

        max_images = self.options.max_images
        only_camera = not self.options.all_topics
        write_frames = self.options.write_frames
        extra = self.options.get_extra()

        if not extra:
            query = '*'
        else:
            query = extra

        db = self.get_easy_logs_db()
        logs = db.query(query)

        self.info('Found %d logs.' % len(logs))
        logs_valid = OrderedDict()
        for log_name, log in logs.items():
            if log.valid:
                logs_valid[log_name] = log

        if not logs_valid:
            msg = 'None of the logs were valid.'
            raise dtu.DTUserError(msg)

        s = format_logs(logs_valid)
        self.info(s)

        od = self.options.output

        for log_name, log in logs_valid.items():
            out = os.path.join(od, log_name)

            log_downloaded = download_if_necessary(log)

            context.comp(work,
                         log_downloaded,
                         out,
                         max_images,
                         only_camera=only_camera,
                         write_frames=write_frames,
                         job_id=log_name)
Ejemplo n.º 4
0
    def define_jobs_context(self, context):
        outdir = self.options["outdir"]
        if outdir is None:
            outdir = "."
            msg = 'Option "--outdir" not passed. Will copy to current directory.'
            self.warn(msg)

        only_camera = not self.options["all_topics"]

        extra = self.options.get_extra()

        if not extra:
            query = "*"
        else:
            query = extra

        db = self.get_easy_logs_db()
        logs = db.query(query)

        self.info(f"Found {len(logs)} logs.")
        logs_valid = {}
        for log_name, log in list(logs.items()):
            if log.valid:
                logs_valid[log_name] = log

        s = format_logs(logs_valid)
        self.info(s)

        for log_name, log in list(logs_valid.items()):
            out = os.path.join(outdir, log_name)

            job_id = f"download-{log.log_name}"
            log_downloaded = context.comp(download_if_necessary,
                                          log,
                                          job_id=job_id)

            job_id = f"setup-{log_name}"
            context.comp_dynamic(jobs_videos,
                                 log_downloaded,
                                 log_name,
                                 out,
                                 only_camera,
                                 job_id=job_id)
Ejemplo n.º 5
0
    def define_jobs_context(self, context):
        outdir = self.options.outdir
        if outdir is None:
            outdir = '.'
            msg = 'Option "--outdir" not passed. Will copy to current directory.'
            self.warn(msg)

        only_camera = not self.options.all_topics

        extra = self.options.get_extra()

        if not extra:
            query = '*'
        else:
            query = extra

        db = self.get_easy_logs_db()
        logs = db.query(query)

        self.info('Found %d logs.' % len(logs))
        logs_valid = OrderedDict()
        for log_name, log in logs.items():
            if log.valid:
                logs_valid[log_name] = log

        s = format_logs(logs_valid)
        self.info(s)

        for log_name, log in logs_valid.items():
            out = os.path.join(outdir, log_name)

            job_id = 'download-%s' % log.log_name
            log_downloaded = context.comp(download_if_necessary,
                                          log,
                                          job_id=job_id)

            job_id = 'setup-%s' % log_name
            context.comp_dynamic(jobs_videos,
                                 log_downloaded,
                                 log_name,
                                 out,
                                 only_camera,
                                 job_id=job_id)
Ejemplo n.º 6
0
    def go(self):
        extra = self.options.get_extra()

        Gallery.deploy_ipfs = self.options["ipfs"]

        if not extra:
            query = "*"
        else:
            query = extra

        db = self.get_easy_logs_db()
        logs = db.query(query)

        logs_valid = {}
        ninvalid = 0
        length_invalid = 0.0
        for log_name, log in list(logs.items()):
            if log.valid:
                logs_valid[log_name] = log
            else:
                ninvalid += 1
                if log.length is not None:
                    length_invalid += log.length
        logs = logs_valid

        self.info(f"Found {len(logs)} valid logs.")

        s = format_logs(logs)
        self.info(s)

        res = get_report(logs)

        out = self.options["destination"]
        fn_html = os.path.join(out, "index.html")

        dtu.write_str_to_file(res, fn_html)
Ejemplo n.º 7
0
 def show_info(self, logs):
     s = format_logs(logs)
     print(s)