Debian Codegraph @

debian/patches/0011-Add-docstrings-to-click-subcommands.patch

raw
1 From: Michael Fladischer <[email protected]>
2 Date: Sun, 20 Sep 2026 13:49:35 +0000
3 Subject: Add docstrings to click subcommands.
4
5 Fixes #1148092, as click-man expects each command and sub-command to have a docstring.
6 ---
7 celery/bin/amqp.py | 28 ++++++++++++++++++++++++++++
8 celery/bin/logtool.py | 15 +++++++++++++++
9 2 files changed, 43 insertions(+)
10
11 diff --git a/celery/bin/amqp.py b/celery/bin/amqp.py
12 index b42b1da..ded9d09 100644
13 --- a/celery/bin/amqp.py
14 +++ b/celery/bin/amqp.py
15 @@ -88,6 +88,9 @@ def amqp(ctx):
16 @click.pass_obj
17 def exchange_declare(amqp_context, exchange, type, passive, durable,
18 auto_delete):
19 + """
20 + Declare an exchange on the AMQP broker.
21 + """
22 if amqp_context.channel is None:
23 amqp_context.echo_error('Not connected to broker. Please retry...')
24 amqp_context.reconnect()
25 @@ -112,6 +115,9 @@ def exchange_declare(amqp_context, exchange, type, passive, durable,
26 type=bool)
27 @click.pass_obj
28 def exchange_delete(amqp_context, exchange, if_unused):
29 + """
30 + Delete an exchange on the AMQP broker.
31 + """
32 if amqp_context.channel is None:
33 amqp_context.echo_error('Not connected to broker. Please retry...')
34 amqp_context.reconnect()
35 @@ -135,6 +141,9 @@ def exchange_delete(amqp_context, exchange, if_unused):
36 type=str)
37 @click.pass_obj
38 def queue_bind(amqp_context, queue, exchange, routing_key):
39 + """
40 + Bind an exchange to a queue using a routing key.
41 + """
42 if amqp_context.channel is None:
43 amqp_context.echo_error('Not connected to broker. Please retry...')
44 amqp_context.reconnect()
45 @@ -164,6 +173,9 @@ def queue_bind(amqp_context, queue, exchange, routing_key):
46 default=False)
47 @click.pass_obj
48 def queue_declare(amqp_context, queue, passive, durable, auto_delete):
49 + """
50 + Declare a queue in the AMQP broker.
51 + """
52 if amqp_context.channel is None:
53 amqp_context.echo_error('Not connected to broker. Please retry...')
54 amqp_context.reconnect()
55 @@ -194,6 +206,9 @@ def queue_declare(amqp_context, queue, passive, durable, auto_delete):
56 default=False)
57 @click.pass_obj
58 def queue_delete(amqp_context, queue, if_unused, if_empty):
59 + """
60 + Delete a queue in the AMQP broker.
61 + """
62 if amqp_context.channel is None:
63 amqp_context.echo_error('Not connected to broker. Please retry...')
64 amqp_context.reconnect()
65 @@ -217,6 +232,9 @@ def queue_delete(amqp_context, queue, if_unused, if_empty):
66 type=str)
67 @click.pass_obj
68 def queue_purge(amqp_context, queue):
69 + """
70 + Purge all messages from a queue on the AMQP broker.
71 + """
72 if amqp_context.channel is None:
73 amqp_context.echo_error('Not connected to broker. Please retry...')
74 amqp_context.reconnect()
75 @@ -241,6 +259,10 @@ def queue_purge(amqp_context, queue):
76 default=False)
77 @click.pass_obj
78 def basic_get(amqp_context, queue, no_ack):
79 + """
80 + Synchonously polls the AMQP broker for a message in a queue, and retrieves
81 + the message if a message is in the queue.
82 + """
83 if amqp_context.channel is None:
84 amqp_context.echo_error('Not connected to broker. Please retry...')
85 amqp_context.reconnect()
86 @@ -271,6 +293,9 @@ def basic_get(amqp_context, queue, no_ack):
87 @click.pass_obj
88 def basic_publish(amqp_context, msg, exchange, routing_key, mandatory,
89 immediate):
90 + """
91 + Publishes a message to an exchange on the AMQP broker.
92 + """
93 if amqp_context.channel is None:
94 amqp_context.echo_error('Not connected to broker. Please retry...')
95 amqp_context.reconnect()
96 @@ -296,6 +321,9 @@ def basic_publish(amqp_context, msg, exchange, routing_key, mandatory,
97 type=int)
98 @click.pass_obj
99 def basic_ack(amqp_context, delivery_tag):
100 + """
101 + Acknowledge a delivery tag to the AMQP broker.
102 + """
103 if amqp_context.channel is None:
104 amqp_context.echo_error('Not connected to broker. Please retry...')
105 amqp_context.reconnect()
106 diff --git a/celery/bin/logtool.py b/celery/bin/logtool.py
107 index ae64c3e..f50ad8c 100644
108 --- a/celery/bin/logtool.py
109 +++ b/celery/bin/logtool.py
110 @@ -121,6 +121,9 @@ def logtool(ctx):
111 @click.argument('files', nargs=-1)
112 @click.pass_context
113 def stats(ctx, files):
114 + """
115 + Read log files and output report.
116 + """
117 ctx.obj.echo(REPORT_FORMAT.format(
118 **Audit().run(files).report()
119 ))
120 @@ -130,6 +133,9 @@ def stats(ctx, files):
121 @click.argument('files', nargs=-1)
122 @click.pass_context
123 def traces(ctx, files):
124 + """
125 + Read log files and output tracebacks.
126 + """
127 Audit(on_trace=ctx.obj.echo).run(files)
128
129
130 @@ -137,6 +143,9 @@ def traces(ctx, files):
131 @click.argument('files', nargs=-1)
132 @click.pass_context
133 def errors(ctx, files):
134 + """
135 + Read log files and output error messages.
136 + """
137 Audit(on_task_error=lambda line, *_: ctx.obj.echo(line)).run(files)
138
139
140 @@ -144,6 +153,9 @@ def errors(ctx, files):
141 @click.argument('files', nargs=-1)
142 @click.pass_context
143 def incomplete(ctx, files):
144 + """
145 + Read log files and output incomplete tasks.
146 + """
147 audit = Audit()
148 audit.run(files)
149 for task_id in audit.incomplete_tasks():
150 @@ -154,4 +166,7 @@ def incomplete(ctx, files):
151 @click.argument('files', nargs=-1)
152 @click.pass_context
153 def debug(ctx, files):
154 + """
155 + Read log files and output debug messages.
156 + """
157 Audit(on_debug=ctx.obj.echo).run(files)