docutils: Fix handling of ", or None ...".
This commit is contained in:
parent
b78d3934d7
commit
53b024f246
@ -99,7 +99,7 @@ Download a given URL, or current page if no URL given.
|
||||
|
||||
==== positional arguments
|
||||
* +'url'+: The URL to download. If not given, download the current page.
|
||||
* +'dest'+: The file path to write the download to to ask.
|
||||
* +'dest'+: The file path to write the download to, or not given to ask.
|
||||
|
||||
[[download-cancel]]
|
||||
=== download-cancel
|
||||
|
@ -102,7 +102,10 @@ class DocstringParser:
|
||||
if stop:
|
||||
break
|
||||
for k, v in self.arg_descs.items():
|
||||
self.arg_descs[k] = ' '.join(v).replace(', or None', '')
|
||||
desc = ' '.join(v)
|
||||
desc = re.sub(r', or None($|\.)', r'\1', desc)
|
||||
desc = re.sub(r', or None', r', or not given', desc)
|
||||
self.arg_descs[k] = desc
|
||||
self.long_desc = ' '.join(self.long_desc)
|
||||
self.short_desc = ' '.join(self.short_desc)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user