PEATDB/Ekin/Web.py
def makeHtml(self, images, outfile=None, imgpath=None, columns=2,
                        title=None,colheader=None, rowheader=None):
        """Put given images into a html file and save it"""
        if outfile != None:
            saveout = sys.stdout
            fsock = open(outfile, 'w')
            sys.stdout = fsock
        if title!=None:
            print '<h1>%s</h1>' %title
        print '<table id="mytable" align=center cellspacing="0" borderwidth=1>'
        if colheader!=None:
            print '<tr>'
            print '<th></th>'
            for col in range(columns):
                print '<th>%s</th>' %colheader[col]
            print '</tr>'
        row=0;c=0
        for img in images:
            if c==0:
                print '<tr>'
                if rowheader!=None:
                    try:
                        print '<th>%s</th>' %rowheader[row]
                    except:
                        print '<th>??</th>'

            print '<td> <img src=%s/%s  align=center></td>' % (imgpath,img)
            c=c+1
            if c >= columns:
                print '</tr>'
                row=row+1
                c=0
        print '</table>'
        if outfile != None:
            sys.stdout.flush()
            sys.stdout = saveout
            fsock.close()
        return
Put given images into a html file and save it
Put given images into a html file and save it
Put given images into a html file and save it
def makeHtml(self, images, outfile=None, imgpath=None, columns=2,
                        title=None,colheader=None, rowheader=None):
        if outfile != None:
            saveout = sys.stdout
            fsock = open(outfile, 'w')
            sys.stdout = fsock
        if title!=None:
            print '<h1>%s</h1>' %title
        print '<table id="mytable" align=center cellspacing="0" borderwidth=1>'
        if colheader!=None:
            print '<tr>'
            print '<th></th>'
            for col in range(columns):
                print '<th>%s</th>' %colheader[col]
            print '</tr>'
        row=0;c=0
        for img in images:
            if c==0:
                print '<tr>'
                if rowheader!=None:
                    try:
                        print '<th>%s</th>' %rowheader[row]
                    except:
                        print '<th>??</th>'
            print '<td> <img src=%s/%s  align=center></td>' % (imgpath,img)
            c=c+1
            if c >= columns:
                print '</tr>'
                row=row+1
                c=0
        print '</table>'
        if outfile != None:
            sys.stdout.flush()
            sys.stdout = saveout
            fsock.close()
        return
def makeHtml ( self , images , outfile = None , imgpath = None , columns = 2 , title = None , colheader = None , rowheader = None ) : if outfile != None : saveout = sys . stdout fsock = open ( outfile , 'w' ) sys . stdout = fsock if title != None : print '<h1>%s</h1>' % title print '<table id="mytable" align=center cellspacing="0" borderwidth=1>' if colheader != None : print '<tr>' print '<th></th>' for col in range ( columns ) : print '<th>%s</th>' % colheader [ col ] print '</tr>' row = 0 ; c = 0 for img in images : if c == 0 : print '<tr>' if rowheader != None : try : print '<th>%s</th>' % rowheader [ row ] except : print '<th>??</th>' print '<td> <img src=%s/%s  align=center></td>' % ( imgpath , img ) c = c + 1 if c >= columns : print '</tr>' row = row + 1 c = 0 print '</table>' if outfile != None : sys . stdout . flush ( ) sys . stdout = saveout fsock . close ( ) return
Put given images into a html file and save it
Put given images into a html file and save it
"""Put given images into a html file and save it"""
self
images
outfile
imgpath
columns
title
colheader
rowheader