jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/676811 )
Change subject: [sphinx] Fix docstrings in archivebot.py ......................................................................
[sphinx] Fix docstrings in archivebot.py
Change-Id: Ifd57ed14ef52f641064e207ddd939f04b2a9b4fe --- M scripts/archivebot.py 1 file changed, 20 insertions(+), 17 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/archivebot.py b/scripts/archivebot.py index a48673b..8c947d6 100755 --- a/scripts/archivebot.py +++ b/scripts/archivebot.py @@ -222,12 +222,16 @@ """ Return the key and duration extracted from the string.
- @param string: a string defining a time period: + @param string: a string defining a time period + + Examples:: + 300s - 300 seconds 36h - 36 hours 7d - 7 days 2w - 2 weeks (14 days) 1y - 1 year + @return: key and duration extracted form the string """ if string.isdigit(): @@ -246,12 +250,13 @@ """ Return a size for a shorthand size.
- Accepts a string defining a size: - 1337 - 1337 bytes - 150K - 150 kilobytes - 2M - 2 megabytes - Returns a tuple (size,unit), where size is an integer and unit is - 'B' (bytes) or 'T' (threads). + Accepts a string defining a size:: + 1337 - 1337 bytes + 150K - 150 kilobytes + 2M - 2 megabytes + + @Returns: a tuple ``(size, unit)``, where C{size} is an integer and + unit is C{'B'} (bytes) or C{'T'} (threads). """ match = re.fullmatch(r'(\d{1,3}(?: \d{3})+|\d+) *([BkKMT]?)', string) if not match: @@ -326,7 +331,7 @@ """ An object representing a discussion thread on a page.
- It represents something that is of the form: + It represents something that is of the form::
== Title of thread ==
@@ -500,17 +505,15 @@
algo = 'none'
- def __init__(self, page, template, salt, force=False) -> None: + def __init__(self, page, template, salt: str, force: bool = False) -> None: """Initializer.
- param page: a page object to be archived - type page: pywikibot.Page - param template: a template with configuration settings - type template: pywikibot.Page - param salt: salt value - type salt: str - param force: override security value - type force: bool + @param page: a page object to be archived + @type page: L{pywikibot.Page} + @param template: a template with configuration settings + @type template: L{pywikibot.Page} + @param salt: salt value + @param force: override security value """ self.attributes = OrderedDict([ ('archive', ['', False]),
pywikibot-commits@lists.wikimedia.org