From: Jann Horn Date: Sun, 1 Sep 2024 23:54:36 +0000 (+0200) Subject: add ui for entering message id X-Git-Url: http://git.thejh.net/?a=commitdiff_plain;h=21b3687c0789b59feb2b2810cfaafbfaad7ec4de;p=mehlbrei.git add ui for entering message id --- diff --git a/.gcloudignore b/.gcloudignore new file mode 100644 index 0000000..df94e0f --- /dev/null +++ b/.gcloudignore @@ -0,0 +1,22 @@ +# 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 diff --git a/main.py b/main.py index 38c0bfd..cb35da4 100755 --- a/main.py +++ b/main.py @@ -345,7 +345,8 @@ def parse_mbox(): 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() @@ -355,7 +356,9 @@ def app(environ, start_response): out.append(' Mehlbrei') out.append(' ') out.append(' ') out.append(' ') - out.append('
') - out.append('

Topics

') - for topic_root in all_topic_roots: - out.append(' '+html.escape(topic_root.msg.get('subject', ''), quote=False)+' ('+str(topic_root.non_diff_root_descendants)+' replies)') + out.append(' ') - out.append('
') + out.append('
') + out.append('
') + out.append('

Topics

') + for topic_root in all_topic_roots: + out.append(' '+html.escape(topic_root.msg.get('subject', ''), quote=False)+' ('+str(topic_root.non_diff_root_descendants)+' replies)') + out.append('
') + out.append('
') for topic_root in all_topic_roots: - out.append('
') + out.append('
') 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('

Top-posted messages (sorry this section looks like a mess)

') + out.append('

Top-posted messages (sorry this section looks like a mess)

') printed_top_header = True if block.start_pos_child >= 0 and not printed_threads_header: - out.append('

Actual thread

') + out.append('

Actual thread

') printed_threads_header = True - out.append('
') - out.append('
'+html.escape(block.message.from_hdr, quote=False)+'
') - out.append('
'+html.escape(block.get_text(), quote=False)+'
') - out.append('
') - out.append('
') + out.append('
') + out.append('
'+html.escape(block.message.from_hdr, quote=False)+'
') + out.append('
'+html.escape(block.get_text(), quote=False)+'
') + out.append('
') + out.append('
') + out.append('
') out.append('
') out.append(' ') out.append('')