Skip to content

Commit 4e2c8f4

Browse files
authored
Merge pull request CloudBotIRC#123 from linuxdaemon/gonzobot+poll-docs-fix
Fix docstrings for poll.py
2 parents 80031d1 + f34e7c8 commit 4e2c8f4

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

plugins/poll.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
from re import findall
22

33
from cloudbot import hook
4-
54
from cloudbot.util.formatting import get_text_list
65

7-
86
polls = {}
97

108

@@ -19,7 +17,7 @@ def __init__(self, title):
1917

2018

2119
class Poll:
22-
def __init__(self, question, creator, options=["Yes", "No"]):
20+
def __init__(self, question, creator, options=("Yes", "No")):
2321
self.question = question
2422
self.creator = creator
2523
self.options = {i.lower(): PollOption(i) for i in options}
@@ -65,6 +63,7 @@ def format_results(self):
6563

6664
@hook.command()
6765
def poll(text, conn, nick, chan, message, reply):
66+
"""{<question>[: <option1>, <option2>[, <option3>]...|close} - Creates a poll for [question] with the provided options (default: Yes, No), or closes the poll if the argument is 'close'"""
6867
global polls
6968

7069
# get poll ID
@@ -104,7 +103,7 @@ def poll(text, conn, nick, chan, message, reply):
104103

105104
@hook.command(autohelp=True)
106105
def vote(text, nick, conn, chan, notice):
107-
""".vote <poll> <choice> - Vote on a poll; responds on error and silently records on success."""
106+
"""<poll> <choice> - Vote on a poll; responds on error and silently records on success."""
108107
global polls
109108

110109
if len(text.split(' ', 1)) == 2:
@@ -126,10 +125,9 @@ def vote(text, nick, conn, chan, notice):
126125
notice("Voted \x02\"{}\"\x02 on {}'s poll!".format(o.title, p.creator))
127126

128127

129-
@hook.command(autohelp=Poll)
128+
@hook.command(autohelp=False)
130129
def results(text, conn, chan, nick, message, reply):
131-
"""[user] -- Shows current results from [user]'s poll. If [user] is empty,
132-
it will show results for your poll."""
130+
"""[user] - Shows current results from [user]'s poll. If [user] is empty, it will show results for your poll."""
133131
global polls
134132

135133
if text:

0 commit comments

Comments
 (0)