コード例 #1
0
    def go(self):
        extra = self.options.get_extra()

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

        db = self.get_easy_logs_db()
        logs0 = db.query(query)
        logs = get_valid(logs0)
        print(f"logs: {len(logs)}")
        m = MakeIPFS()

        create_ipfs_dag(logs, m)

        def url_to_resource(log, rname):
            return log.log_name + "." + rname

        m.add_file_content("gallery_fancy.html", get_report(logs, url_to_resource))
        m.add_file_content("gallery.html", get_report(logs, url_to_resource, initial_screens=False))
        if True:
            print("adding cloud.yaml")
            m.add_file_content("cloud.yaml", yaml_representation_of_phy_logs(logs))
        m.add_file_content("style.css", get_gallery_style())
        m0 = MakeIPFS()

        m0.add_file("logs", m.get_ipfs_hash(), size=m.total_size())
        m0.add_file_content("index.html", get_index())

        hashed = m0.get_ipfs_hash()
        print(hashed)
        print((f"Total size :  {m.total_size() / (1000 * 1000 * 1000.0):.3f} GB"))
コード例 #2
0
    def go(self):
        extra = self.options.get_extra()

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

        db = self.get_easy_logs_db()
        logs0 = db.query(query)
        logs = get_valid(logs0)
        print('logs: %s' % len(logs))
        m = MakeIPFS()

        create_ipfs_dag(logs, m)

        def url_to_resource(log, rname):
            return log.log_name + '.' + rname

        m.add_file_content('gallery_fancy.html',
                           get_report(logs, url_to_resource))
        m.add_file_content(
            'gallery.html',
            get_report(logs, url_to_resource, initial_screens=False))
        if True:
            print('adding cloud.yaml')
            m.add_file_content('cloud.yaml',
                               yaml_representation_of_phy_logs(logs))
        m.add_file_content('style.css', get_gallery_style())
        m0 = MakeIPFS()

        m0.add_file('logs', m.get_ipfs_hash(), size=m.total_size())
        m0.add_file_content('index.html', get_index())

        hashed = m0.get_ipfs_hash()
        print hashed
        print('Total size :  %.3f GB' % (m.total_size() /
                                         (1000 * 1000 * 1000.0)))