コード例 #1
0
ファイル: meep_example_app.py プロジェクト: pfritschen/meep
    def list_search(self, environ, start_response):
   #     print "ENVIRON", environ
        results=meeplib.get_search_results()
        s = []

        #print "RESULTS"
       # print results 
        for result in results:
            s.append(meeplib.get_message(result))
##          m=meeplib.get_message(result)
##            s.append('id: %d<p>' % (m.id,))
##            s.append('title: %s<p>' % (m.title))
##            s.append('message: %s<p>' % (m.post))
##            try:
##                s.append('author: %s<p>' % (m.author.username))
##            except:
##                s.append('author: %s<p>' % (m.author))
##            s.append("<a href='/m/post_reply?id="+str(m.id)+"'>Reply</a><p>")
##            if meeplib.has_replies(m.id):
##                s.append('<dd>Replies:<hr />')
##                for r in meeplib.get_replies(m.id):
##                    s.append('<dd>%s<p>' % (r))
##                s.append('</dd>')
##
##            s.append('<hr>')
       
         #TODO MAKE IT DO SEARCH
      #  s.append("<form action='delete_action' method='POST'>Delete a Message?<br> Message ID: <input type='text' name='id'><input type='submit'>Delete</form>")    
        headers = [('Content-type', 'text/html')]
        start_response("200 OK", headers)
       # s.append("<form action='search_action' method='POST'>Search for Messages?<br> Message ID: <input type='text' name='text'><input type='submit'>Delete</form>")    
        return [ render_page('search_messages.html', messages=s, meeplib=meeplib) ]

        return ["".join(s)]
コード例 #2
0
ファイル: meep_example_app.py プロジェクト: kgleas/meep
    def list_search(self, environ, start_response):
        results=meeplib.get_search_results()
        s = []
        for result in results:
            s.append(meeplib.get_message(result))
            # replies = meeplib.get_replies(m.id)

            # if (replies!=-1):
                # s.append('<div style="padding-left: 50px;">Replies:</div><br />')
                # for r in replies:
                    
                    # s.append(""" <div style="padding-left: 70px;">&nbsp;%s</div><p>""" % r)

            # s.append('<hr>')
       
        headers = [('Content-type', 'text/html')]
        start_response("200 OK", headers)

        return [ render_page('search_results.html', messages=s) ]
コード例 #3
0
    def list_search(self, environ, start_response):
        #     print "ENVIRON", environ
        results = meeplib.get_search_results()
        s = []

        #print "RESULTS"
        # print results
        for result in results:
            s.append(meeplib.get_message(result))
##          m=meeplib.get_message(result)
##            s.append('id: %d<p>' % (m.id,))
##            s.append('title: %s<p>' % (m.title))
##            s.append('message: %s<p>' % (m.post))
##            try:
##                s.append('author: %s<p>' % (m.author.username))
##            except:
##                s.append('author: %s<p>' % (m.author))
##            s.append("<a href='/m/post_reply?id="+str(m.id)+"'>Reply</a><p>")
##            if meeplib.has_replies(m.id):
##                s.append('<dd>Replies:<hr />')
##                for r in meeplib.get_replies(m.id):
##                    s.append('<dd>%s<p>' % (r))
##                s.append('</dd>')
##
##            s.append('<hr>')

#TODO MAKE IT DO SEARCH
#  s.append("<form action='delete_action' method='POST'>Delete a Message?<br> Message ID: <input type='text' name='id'><input type='submit'>Delete</form>")
        headers = [('Content-type', 'text/html')]
        start_response("200 OK", headers)
        # s.append("<form action='search_action' method='POST'>Search for Messages?<br> Message ID: <input type='text' name='text'><input type='submit'>Delete</form>")
        return [
            render_page('search_messages.html', messages=s, meeplib=meeplib)
        ]

        return ["".join(s)]