コード例 #1
0
def beamline(blid=None):
    session_init(session, db)
    beamlines = []
    for _bldat in get_beamline_list(db):
        if _bldat['id'] == "%i" % blid:
            bldat = _bldat
            break

    spectra = spectra_for_beamline(db, blid)
    opts = {'nspectra': len(spectra), 'spectra': spectra}
    opts.update(bldat)
    beamlines.append(opts)

    return render_template('beamlines.html',
                           nbeamlines=len(beamlines), beamlines=beamlines)
コード例 #2
0
ファイル: xdl_app.py プロジェクト: samwebb10/XASDataLibrary
def beamline(blid=None):
    session_init(session, db)
    beamlines = []
    for _bldat in get_beamline_list(db):
        if _bldat['id'] == "%i" % blid:
            bldat = _bldat
            break

    spectra = spectra_for_beamline(db, blid)
    opts = {'nspectra': len(spectra), 'spectra': spectra}
    opts.update(bldat)
    beamlines.append(opts)

    return render_template('beamlines.html',
                           nbeamlines=len(beamlines),
                           beamlines=beamlines)
コード例 #3
0
def beamlines(blid=None, orderby='id', reverse=0):
    session_init(session, db)
    beamlines = []

    for bldat in get_beamline_list(db, orderby=orderby):
        blid = bldat['id']
        spectra = spectra_for_beamline(db, blid)
        opts = {'nspectra': len(spectra), 'spectra': spectra}
        opts.update(bldat)
        beamlines.append(opts)

    reverse = int(reverse)
    if reverse:
        beamlines.reverse()
        reverse = 0
    else:
        reverse = 1

    return render_template('beamlines.html',
                           nbeamlines=len(beamlines),
                           beamlines=beamlines, reverse=reverse)
コード例 #4
0
ファイル: xdl_app.py プロジェクト: samwebb10/XASDataLibrary
def beamlines(blid=None, orderby='id', reverse=0):
    session_init(session, db)
    beamlines = []

    for bldat in get_beamline_list(db, orderby=orderby):
        blid = bldat['id']
        spectra = spectra_for_beamline(db, blid)
        opts = {'nspectra': len(spectra), 'spectra': spectra}
        opts.update(bldat)
        beamlines.append(opts)

    reverse = int(reverse)
    if reverse:
        beamlines.reverse()
        reverse = 0
    else:
        reverse = 1

    return render_template('beamlines.html',
                           nbeamlines=len(beamlines),
                           beamlines=beamlines,
                           reverse=reverse)