コード例 #1
0
ファイル: FilePage.py プロジェクト: devinjacobson/prediction
 def renderGET(self, ctx):
     page = [header]
     page.append("""
         <title>File Upload</title>
         </head>
         <body>
         <div class="content">
         <h1>
         <a href="/">
         <img src="/images/HipersatLogo.png"/>
         </a>
         </h1>
         <p>
          The following services are currently available
          """)
     page.append(apply(serverMenu.renderMenu()))
     page.append("""
             </p>
             <p>
                 Welcome to the HiPerSAT Infomax testbed. Here you can
                 try out the latest version of our Infomax implementation.
             </p>""")
     page.append(fileDatabase.renderdb())
     page.append(self.form.renderForm())
     return "".join(page)
コード例 #2
0
ファイル: SobiPage.py プロジェクト: devinjacobson/prediction
    def renderGET( self, ctx ):
        page = [ header ]
        page.append( """
            <title>Sobi</title>
        </head>
        <body>
            <div class="content">
                <h1>
                    <a href="/">
                        <img src="/images/HipersatLogo.png"/>
                    </a>
                </h1>
                <p>
                    The following services are currently available
""")
        page.append( apply(serverMenu.renderMenu() ))
        page.append( """
                </p>
                <p>
                    Welcome to the HiPerSAT Sobi testbed. Here you can
                    try out the latest version of our Sobi implementation.
                </p>""")
        page.append( self.form.renderForm() )
        page.append( """
        </body>
    </html>""")
        return "".join( page )
コード例 #3
0
    def renderGET( self, ctx ):
        status = "active"
        if self.q.stopped:
            status = "stopped"
        page = [ "" ]
        page.append( header )
        page.append("""
        <title>
            HiPerSAT Queue
        </title>
    </head>
    <body>
        <div class="content">
            <h1>
                <a href="/">
                    <img src="/images/HipersatLogo.png" />
                </a>
            </h1>
            <p>
                The following pages are currently available
""")
        page.append( apply(serverMenu.renderMenu() ))
        page.append( """
            </p>
            <p>
                The queue is %s
            </p>
            <table>
                <tr>
                    <th>Job number</th>
                    <th>Type</th>
                    <th>Status</th>
                </tr>""" % ( status ))
        length = self.q.getLength()
        for i in range( length ):
            process = self.q.getProcess( i )
            if process:
                page.append( """
                    <tr>
                    <td><a href="/queue/%s">%s</a></td>
                    <td>%s</td>
                    <td>%s</td>
                </tr>""" % ( i, i, process.command, process.state ) )
        page.append("""
            </table>""")
        if status == "active":
            page.append( self.killForm.renderForm() )
        else:
            page.append( self.startForm.renderForm() )
        page.append("""
        </div>
    </body>
</html>""")

        return "".join( page )
コード例 #4
0
    def renderPOST(self, ctx):
        page = [""]
        page.append(header)
        page.append("""
            <title>FastICA</title>
        </head>
        <body>
            <div class="content">
            <h1>
                <a href="/">
                    <img src="/images/HipersatLogo.png" />
                </a>
            </h1> 
            <p>
                The following services are currently available
""")
        page.append(apply(serverMenu.renderMenu()))
        page.append("""
            </p>""")

        args = inevow.IRequest(ctx).args
        arguments = {}
        print "making argument list"
        for key in args:
            arguments[key] = args[key][0]
        errors = self.form.validateForm(arguments)
        if len(errors) > 0:
            page.append("""
                <p>
                    There was an error in your submission.
                    It appears that the following entries were invalid:
                    <ul>""")
            for error in errors:
                page.append("""
                        <li>%s</li>""" % (error))
            page.append("""
                    </ul>
                </p>""")
        else:
            page.append("""
                <p>
                    Your request was submitted to the HiPerSAT job queue.
                </p>""")
            fastica = self.form.createFastICA(arguments)
            q.addProcess(fastica.getCommand(), fastica.getArgs(),
                         fastica.timestamp)
        page.append(self.form.renderForm())

        page.append("""
            </div>
        </body>
    </html>""")

        return "".join(page)
コード例 #5
0
ファイル: SobiPage.py プロジェクト: devinjacobson/prediction
    def renderPOST( self, ctx ):
        page = [""]
        page.append( header )
        page.append( """
            <title>Sobi</title>
        </head>
        <body>
            <div class="content">
            <h1>
                <a href="/">
                    <img src="/images/HipersatLogo.png" />
                </a>
            </h1> 
            <p>
                The following services are currently available
""" )
        page.append( apply(serverMenu.renderMenu() ))
        page.append( """
            </p>""")

        args = inevow.IRequest(ctx).args
        arguments = {}
        print "making argument list"
        for key in args:
            arguments[key] = args[key][0]
        errors = self.form.validateForm( arguments )
        if len(errors) > 0:
            page.append( """
                <p>
                    There was an error in your submission.
                    It appears that the following entries were invalid:
                    <ul>""")
            for error in errors:
                page.append("""
                        <li>%s</li>""" % ( error ) )
            page.append( """
                    </ul>
                </p>""")
        else:
            page.append( """
                <p>
                    Your request was submitted to the HiPerSAT job queue.
                </p>""")
            sobi = self.form.createSobi( arguments )
            q.addProcess( sobi.getCommand(), sobi.getArgs(), sobi.timestamp )
        page.append( self.form.renderForm() )

        page.append( """
            </div>
        </body>
    </html>""")

        return "".join( page )
コード例 #6
0
ファイル: FilePage.py プロジェクト: devinjacobson/prediction
 def generalContent( self ):
     divContent = []
     newpage = html(
         head( "File Upload", "Neuroinformatics Center", "/styles/style.css" ),
         body( '',
             div( 'class="content"',
                 h1( '',
                     a( 'href="/"',
                         img( 'src="images/HipersatLogo.png"',
                             text("")))),
                 divContent )))
     divContent.append(
         p( '',
             text( 'The following services are currently available' ),
             serverMenu.renderMenu() ) )
     return ( newpage, divContent )
コード例 #7
0
ファイル: FilePage.py プロジェクト: devinjacobson/prediction
 def generalContent(self):
     divContent = []
     newpage = html(
         head("File Upload", "Neuroinformatics Center",
              "/styles/style.css"),
         body(
             '',
             div(
                 'class="content"',
                 h1(
                     '',
                     a('href="/"',
                       img('src="images/HipersatLogo.png"', text("")))),
                 divContent)))
     divContent.append(
         p('', text('The following services are currently available'),
           serverMenu.renderMenu()))
     return (newpage, divContent)
コード例 #8
0
 def generalContent(self):
     divContent = []
     newpage = html(
         head("Infomax", "Neuroinformatics Center", "/styles/style.css"),
         body(
             "",
             div(
                 'class="content"',
                 h1(
                     "",
                     a('href="/"',
                       img('src="images/HipersatLogo.png"', text("")))),
                 divContent)))
     divContent.append(
         p('', text('The following services are currently available'),
           serverMenu.renderMenu()))
     # the divContent represents the actual contents of the page,
     # collected in the top div
     return (newpage, divContent)
コード例 #9
0
 def generalContent( self ):
     divContent = []
     newpage = html(
         head( "Infomax", "Neuroinformatics Center", "/styles/style.css" ),
         body( "",
             div( 'class="content"',
                 h1( "",
                     a( 'href="/"', 
                         img( 'src="images/HipersatLogo.png"',
                             text("")))),
                 divContent )))
     divContent.append( 
         p( '',
             text( 'The following services are currently available' ),
             serverMenu.renderMenu()
         )
     )
     # the divContent represents the actual contents of the page, 
     # collected in the top div
     return ( newpage, divContent )