def create_location(): h = HomePage('Location') body = '{}\n'.format(make_lines(3)) body += '{}\n'.format(head(bold('Paul Scherrer Institut (PSI)'))) body += make_figure(join('figures', 'PSIAir.jpg'), 'PSI-Air', width=1200) h.set_body(indent(body, 2)) h.create()
def create_years(self): for year in self.HomePage.get_years(): if year.isdigit(): h = HomePage(year) table = YearTable(year) h.set_body(table.get_body()) h.create()
def create_boards(self): h = HomePage('AmpBoards') body = '{}\n'.format(make_lines(3)) body += '{}\n'.format(head(bold('Diamond Amplifier Boards'))) rows = sorted([[center_txt(nr), option] for option in self.Config.options('Boards') for nr in loads(self.Config.get('Boards', option))]) body += add_bkg(HTMLTable.table(rows, header_row=['Nr', 'Pulser Type'], ), self.BkgCol) h.set_body(body) h.create()
def create_home(): h = HomePage('HomePage') body = '{}\n'.format(make_lines(3)) body += '{}\n'.format(head(bold('Complete Set of Data Taken at Beam Tests at PSI ...'))) body += ' <script type="text/javascript">\n' body += ' load_home();\n' body += ' </script>\n' h.set_body(indent(body, 2)) h.create()
def create_full_runplans(self): table = RunPlanTable() print_banner('CREATING FULL RUNPLAN TABLES') test_campaigns = [str_to_tc(tc) for tc in table.TestCampaigns if tc == self.TestCampaign or self.TestCampaign is None] for tc in test_campaigns: h = HomePage() h.set_file_path(join('BeamTests', tc_to_str(tc), 'RunPlans.html')) h.set_body(table.get_tc_body(tc)) h.create()
def create_runs(dia_scans): table = RunTable() dia = dia_scans[0].Diamond dias = table.Diamonds print_banner('CREATING RUN TABLES FOR {} ({}/{}) in {}'.format(dia, dias.index(dia), len(dias), tc_to_str(dia_scans[0].TestCampaign, short=False))) for dia_scan in dia_scans: if dia_scan.TestCampaign < '201508': continue h = HomePage() h.set_file_path(join(dia_scan.Path, 'index.html')) h.set_body(table.get_body(dia_scan)) h.create()
def create_dias(self): if self.TestCampaign is not None: return table = DiaTable() print_banner('CREATING SINGLE DIAMOND TABLES') diamonds = [dia for dia in table.Diamonds if dia == self.Diamond or self.Diamond is None] table.start_pbar(len(diamonds)) for i, dia in enumerate(diamonds, 1): dia_scans = table.DiaScans.get_diamond_scans(dia) h = HomePage() h.set_file_path(join('Diamonds', dia, 'index.html')) h.set_body(table.get_body(dia_scans)) h.create() table.ProgressBar.update(i) table.ProgressBar.finish()
def create_dia_runplans(self): table = RunPlanTable() print_banner('CREATING DIAMOND RUNPLAN TABLES') diamonds = [dia for dia in table.Diamonds if dia == self.Diamond or self.Diamond is None] test_campaigns = [str_to_tc(tc) for tc in table.TestCampaigns if tc == self.TestCampaign or self.TestCampaign is None] for dia in diamonds: for tc in test_campaigns: dia_scans = table.DiaScans.get_tc_diamond_scans(dia, tc) if not dia_scans: continue # continue if the diamond was not measured during this campaign h = HomePage() h.set_file_path(join(dirname(dia_scans[0].Path), 'index.html')) h.set_body(table.get_dia_body(dia_scans)) h.create() self.create_runs(dia_scans) self.create_picture_pages(dia_scans)
def create_old(): h = HomePage('Old') table = OldTable() h.set_body(table.get_body()) h.create()