--- /dev/null
+# This file specifies files that are *not* uploaded to Google Cloud
+# using gcloud. It follows the same syntax as .gitignore, with the addition of
+# "#!include" directives (which insert the entries of the given .gitignore-style
+# file at that point).
+#
+# For more information, run:
+# $ gcloud topic gcloudignore
+#
+.gcloudignore
+# If you would like to upload your .git directory, .gitignore file or files
+# from your .gitignore file, remove the corresponding line
+# below:
+.git
+.gitignore
+
+# Python pycache:
+__pycache__/
+# Ignored by the build system
+/setup.cfg
+
+# sample files
+*.mbox
\ No newline at end of file
def app(environ, start_response):
out = []
query = parse_qs(environ.get('QUERY_STRING', ''))
- msgid = query.get('msgid', None)
+ msgid = query.get('msgid', [''])[0]
+ print(repr(msgid))
all_topic_roots = parse_mbox()
out.append(' <title>Mehlbrei</title>')
out.append(' <style>')
out.append(' html {height: 100%;width:100%;margin:0px;}')
- out.append(' body {display: flex;height: 100%;width:100%;margin:0px;}')
+ out.append(' body {display: flex;flex-direction: column; height: 100%;width:100%;margin:0px;}')
+ out.append(' #header {width: 100%; flex-shrink:0;}')
+ out.append(' #below-header {display: flex;width:100%;margin:0px;flex-grow:2;flex-shrink:1;min-height:0;}')
out.append(' #topic_panel {height: 100%; overflow:scroll;flex-shrink:0;}')
out.append(' #main_panel {height: 100%; overflow:scroll;flex-grow:2;}')
out.append(' .topic_link {display:block;}')
out.append(' </style>')
out.append(' </head>')
out.append(' <body>')
- out.append(' <div id="topic_panel">')
- out.append(' <h1>Topics</h1>')
- for topic_root in all_topic_roots:
- out.append(' <span class="topic_link'+(' empty-topic' if topic_root.non_diff_root_descendants == 0 else '')+'"><a href="#topic-'+str(topic_root.index)+'">'+html.escape(topic_root.msg.get('subject', '<no subject>'), quote=False)+'</a> ('+str(topic_root.non_diff_root_descendants)+' replies)</span>')
+ out.append(' <div id="header">')
+ out.append(' <form action="/thread" method="get">')
+ out.append(' Message ID (must exist on <a href="https://lore.kernel.org/">lore.kernel.org</a>):')
+ out.append(' <input type="text" name="msgid" size="50" value="'+html.escape(msgid)+'">')
+ out.append(' <button>lookup</button>')
+ out.append(' </form>')
out.append(' </div>')
- out.append(' <div id="main_panel">')
+ out.append(' <div id="below-header">')
+ out.append(' <div id="topic_panel">')
+ out.append(' <h1>Topics</h1>')
+ for topic_root in all_topic_roots:
+ out.append(' <span class="topic_link'+(' empty-topic' if topic_root.non_diff_root_descendants == 0 else '')+'"><a href="#topic-'+str(topic_root.index)+'">'+html.escape(topic_root.msg.get('subject', '<no subject>'), quote=False)+'</a> ('+str(topic_root.non_diff_root_descendants)+' replies)</span>')
+ out.append(' </div>')
+ out.append(' <div id="main_panel">')
for topic_root in all_topic_roots:
- out.append(' <div class="alt-content" id="topic-'+str(topic_root.index)+'">')
+ out.append(' <div class="alt-content" id="topic-'+str(topic_root.index)+'">')
printed_top_header = False
printed_threads_header = False
for block in topic_root.blocks.ranges:
if block.start_pos_child < 0 and not printed_top_header:
- out.append(' <h1>Top-posted messages (sorry this section looks like a mess)</h1>')
+ out.append(' <h1>Top-posted messages (sorry this section looks like a mess)</h1>')
printed_top_header = True
if block.start_pos_child >= 0 and not printed_threads_header:
- out.append(' <h1>Actual thread</h1>')
+ out.append(' <h1>Actual thread</h1>')
printed_threads_header = True
- out.append(' <div class="message-block-container" style="margin-left:'+str(block.message.depth*4)+'em">')
- out.append(' <div class="message-block-meta">'+html.escape(block.message.from_hdr, quote=False)+'</div>')
- out.append(' <div class="message-block-content">'+html.escape(block.get_text(), quote=False)+'</div>')
- out.append(' </div>')
- out.append(' </div>')
+ out.append(' <div class="message-block-container" style="margin-left:'+str(block.message.depth*4)+'em">')
+ out.append(' <div class="message-block-meta">'+html.escape(block.message.from_hdr, quote=False)+'</div>')
+ out.append(' <div class="message-block-content">'+html.escape(block.get_text(), quote=False)+'</div>')
+ out.append(' </div>')
+ out.append(' </div>')
+ out.append(' </div>')
out.append(' </div>')
out.append(' </body>')
out.append('</html>')