PEATDB/Ekin/Web.py
def showMetaData(self, ekinproj=None, ekindata=None, dataset=None, fdata=None, silent=False):
        """Print html of fit and metadata for the given dataset"""

        if fdata == None:
            if ekinproj == None and ekindata!=None:
                E = EkinProject(data=ekindata)
            else:
                E = ekinproj

            fdata = E.getMetaData(dataset)
        fsock = None
        if silent == True:
            saveout = sys.stdout
            sys.stdout = fsock = StringIO.StringIO()

        print '<table id="mytable">'
        print '<tr>'
        print '<td class="alt" style="bold" colspan=2>%s</td><tr>' % dataset
        kys = fdata.keys()
        ignore = ['error']
        for k in sorted(fdata):
            if k in ignore:
                continue
            if fdata[k] == None:
                continue
            elif type(fdata[k]) is types.DictType:
                print '<td>%s</td>' %k
                print '<td> <table id="mytable">'
                for n in fdata[k]:
                    val = fdata[k][n][1]
                    print '<td class="alt">%s</td><td>%.2f</td><tr>' %(n, val)
                print '</table></td><tr>'
            elif type(fdata[k]) is types.StringType:
                print '<td class="alt">%s</td><td>%s</td><tr>' %(k, fdata[k])

            else:
                print '<td class="alt">%s</td><td>%.2f</td><tr>' %(k, fdata[k])
        print '</table>'
        if silent == True:
            sys.stdout = saveout

        if fsock == None:
            return ''
        else:
            return fsock.getvalue()
        return
Print html of fit and metadata for the given dataset
Print html of fit and metadata for the given dataset
Print html of fit and metadata for the given dataset
def showMetaData(self, ekinproj=None, ekindata=None, dataset=None, fdata=None, silent=False):
        if fdata == None:
            if ekinproj == None and ekindata!=None:
                E = EkinProject(data=ekindata)
            else:
                E = ekinproj
            fdata = E.getMetaData(dataset)
        fsock = None
        if silent == True:
            saveout = sys.stdout
            sys.stdout = fsock = StringIO.StringIO()
        print '<table id="mytable">'
        print '<tr>'
        print '<td class="alt" style="bold" colspan=2>%s</td><tr>' % dataset
        kys = fdata.keys()
        ignore = ['error']
        for k in sorted(fdata):
            if k in ignore:
                continue
            if fdata[k] == None:
                continue
            elif type(fdata[k]) is types.DictType:
                print '<td>%s</td>' %k
                print '<td> <table id="mytable">'
                for n in fdata[k]:
                    val = fdata[k][n][1]
                    print '<td class="alt">%s</td><td>%.2f</td><tr>' %(n, val)
                print '</table></td><tr>'
            elif type(fdata[k]) is types.StringType:
                print '<td class="alt">%s</td><td>%s</td><tr>' %(k, fdata[k])
            else:
                print '<td class="alt">%s</td><td>%.2f</td><tr>' %(k, fdata[k])
        print '</table>'
        if silent == True:
            sys.stdout = saveout
        if fsock == None:
            return ''
        else:
            return fsock.getvalue()
        return
def showMetaData ( self , ekinproj = None , ekindata = None , dataset = None , fdata = None , silent = False ) : if fdata == None : if ekinproj == None and ekindata != None : E = EkinProject ( data = ekindata ) else : E = ekinproj fdata = E . getMetaData ( dataset ) fsock = None if silent == True : saveout = sys . stdout sys . stdout = fsock = StringIO . StringIO ( ) print '<table id="mytable">' print '<tr>' print '<td class="alt" style="bold" colspan=2>%s</td><tr>' % dataset kys = fdata . keys ( ) ignore = [ 'error' ] for k in sorted ( fdata ) : if k in ignore : continue if fdata [ k ] == None : continue elif type ( fdata [ k ] ) is types . DictType : print '<td>%s</td>' % k print '<td> <table id="mytable">' for n in fdata [ k ] : val = fdata [ k ] [ n ] [ 1 ] print '<td class="alt">%s</td><td>%.2f</td><tr>' % ( n , val ) print '</table></td><tr>' elif type ( fdata [ k ] ) is types . StringType : print '<td class="alt">%s</td><td>%s</td><tr>' % ( k , fdata [ k ] ) else : print '<td class="alt">%s</td><td>%.2f</td><tr>' % ( k , fdata [ k ] ) print '</table>' if silent == True : sys . stdout = saveout if fsock == None : return '' else : return fsock . getvalue ( ) return
Print html of fit and metadata for the given dataset
Print html of fit and metadata for the given dataset
"""Print html of fit and metadata for the given dataset"""
self
ekinproj
ekindata
dataset
fdata
silent