[PATCH 5/5] nmbug-status: Shift the script description into a docstring
[notmuch-archives.git] / 4a / b482a6651d6d6d26efd56015335d6b4d42ed40
1 Return-Path: <wking@tremily.us>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 2FB20429E26\r
6         for <notmuch@notmuchmail.org>; Sat, 10 May 2014 12:13:56 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
9 X-Spam-Flag: NO\r
10 X-Spam-Score: 0\r
11 X-Spam-Level: \r
12 X-Spam-Status: No, score=0 tagged_above=-999 required=5\r
13         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001]\r
14         autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id nYgVbRFFCKqA for <notmuch@notmuchmail.org>;\r
18         Sat, 10 May 2014 12:13:48 -0700 (PDT)\r
19 Received: from qmta08.westchester.pa.mail.comcast.net\r
20         (qmta08.westchester.pa.mail.comcast.net [76.96.62.80])\r
21         by olra.theworths.org (Postfix) with ESMTP id 4A278431FC7\r
22         for <notmuch@notmuchmail.org>; Sat, 10 May 2014 12:13:34 -0700 (PDT)\r
23 Received: from omta20.westchester.pa.mail.comcast.net ([76.96.62.71])\r
24         by qmta08.westchester.pa.mail.comcast.net with comcast\r
25         id 0K6m1o0031YDfWL58KDW9e; Sat, 10 May 2014 19:13:30 +0000\r
26 Received: from odin.tremily.us ([24.18.63.50])\r
27         by omta20.westchester.pa.mail.comcast.net with comcast\r
28         id 0KDV1o00N152l3L3gKDWwU; Sat, 10 May 2014 19:13:30 +0000\r
29 Received: from mjolnir.tremily.us (unknown [192.168.0.140])\r
30         by odin.tremily.us (Postfix) with ESMTPS id 233C6119F47B;\r
31         Sat, 10 May 2014 12:13:29 -0700 (PDT)\r
32 Received: (nullmailer pid 7441 invoked by uid 1000);\r
33         Sat, 10 May 2014 19:12:55 -0000\r
34 From: "W. Trevor King" <wking@tremily.us>\r
35 To: notmuch@notmuchmail.org\r
36 Subject: [PATCH 5/5] nmbug-status: Shift the script description into a\r
37         docstring\r
38 Date: Sat, 10 May 2014 12:12:49 -0700\r
39 Message-Id:\r
40  <983e6540ad12f69cd5c82a442282e26a4cbf6335.1399748615.git.wking@tremily.us>\r
41 X-Mailer: git-send-email 1.9.1.353.gc66d89d\r
42 In-Reply-To: <cover.1399748615.git.wking@tremily.us>\r
43 References: <cover.1399748615.git.wking@tremily.us>\r
44 In-Reply-To: <cover.1399748615.git.wking@tremily.us>\r
45 References: <cover.1399748615.git.wking@tremily.us>\r
46 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;\r
47         s=q20140121; t=1399749210;\r
48         bh=bz4oE7HbPJE1smC/TZszPDNsONZ8HVvk5yzL4IbISUU=;\r
49         h=Received:Received:Received:Received:From:To:Subject:Date:\r
50         Message-Id;\r
51         b=hawBnwEfTFmArzs3vHuKw6TrIToLrRdfW2DORd2jlhDleE8ZeMDlrOn4YaWANFfSh\r
52         8GAE16iIDyghR0dIT0119HD9dRJsGA2ofEimUOOhV/UrRas22K2rk1xkuyEsi4HF02\r
53         NdRefTYm1MivgC5E5dW+S8obLJWAkxppE4SpWYN43T0nT8aQveHVVHymnvuOwm5rvu\r
54         SGbWXjITPut9XQ6TFLThSNUhAmzKT1/l+4zc2IfPm/vtO+u2ZPpVl1Y3lqp44C9MlI\r
55         AmT6Ell/KbCm7dKm1pRPKkF8O8xK45//kPfWXkTGkh8DLiwDJ2fRETz1Ihjw7Qs8PU\r
56         KBn59HjeGbqEA==\r
57 X-BeenThere: notmuch@notmuchmail.org\r
58 X-Mailman-Version: 2.1.13\r
59 Precedence: list\r
60 List-Id: "Use and development of the notmuch mail system."\r
61         <notmuch.notmuchmail.org>\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
65 List-Post: <mailto:notmuch@notmuchmail.org>\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
68         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
69 X-List-Received-Date: Sat, 10 May 2014 19:13:56 -0000\r
70 \r
71 This way we can use it as the ArgumentParser description (formatted\r
72 with 'nmbug-status --help') and script readers still have it near the\r
73 top of the file.  I rephrased things a bit to match PEP 257's\r
74 summary-line-and-body format [1] while elaborating on the "if\r
75 available" Gmane views.\r
76 \r
77 [1]: http://legacy.python.org/dev/peps/pep-0257/#multi-line-docstrings\r
78 ---\r
79  devel/nmbug/nmbug-status | 12 ++++++++----\r
80  1 file changed, 8 insertions(+), 4 deletions(-)\r
81 \r
82 diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status\r
83 index c9cc745..926d4e4 100755\r
84 --- a/devel/nmbug/nmbug-status\r
85 +++ b/devel/nmbug/nmbug-status\r
86 @@ -1,8 +1,5 @@\r
87  #!/usr/bin/python\r
88  #\r
89 -# Generate an HTML page with the result of one or more notmuch\r
90 -# searches, (with links to gmane views of each email if available).\r
91 -#\r
92  # Copyright (c) 2011-2012 David Bremner <david@tethera.net>\r
93  #\r
94  # dependencies\r
95 @@ -22,6 +19,13 @@\r
96  # You should have received a copy of the GNU General Public License\r
97  # along with this program.  If not, see http://www.gnu.org/licenses/ .\r
98  \r
99 +"""Generate HTML for one or more notmuch searches.\r
100 +\r
101 +Messages matching each search are grouped by thread.  Each message\r
102 +that contains both a subject and message-id will have the displayed\r
103 +subject link to the Gmane view of the message.\r
104 +"""\r
105 +\r
106  from __future__ import print_function\r
107  from __future__ import unicode_literals\r
108  \r
109 @@ -258,7 +262,7 @@ class HtmlPage (Page):\r
110      def _slug(self, string):\r
111          return self._slug_regexp.sub('-', string)\r
112  \r
113 -parser = argparse.ArgumentParser()\r
114 +parser = argparse.ArgumentParser(description=__doc__)\r
115  parser.add_argument('--text', help='output plain text format',\r
116                      action='store_true')\r
117  parser.add_argument('--config', help='load config from given file',\r
118 -- \r
119 1.9.1.353.gc66d89d\r
120 \r