Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
guppy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Svetlana Tkachenko
guppy
Commits
1e6d48e6
Commit
1e6d48e6
authored
13 years ago
by
Svetlana Tkachenko
Browse files
Options
Downloads
Patches
Plain Diff
blockbot plugin - no crash on first msg
parent
4d6afa4b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
irc.py
+1
-1
1 addition, 1 deletion
irc.py
plugins/blockbot.py
+4
-2
4 additions, 2 deletions
plugins/blockbot.py
plugins/wikipedia.py
+3
-1
3 additions, 1 deletion
plugins/wikipedia.py
with
8 additions
and
4 deletions
irc.py
+
1
−
1
View file @
1e6d48e6
...
...
@@ -9,7 +9,7 @@ class User(str):
self
.
ident
=
user
.
ident
self
.
host
=
user
.
host
else
:
self
.
nick
=
nick
self
.
nick
=
user
self
.
ident
=
""
self
.
host
=
""
...
...
This diff is collapsed.
Click to expand it.
plugins/blockbot.py
+
4
−
2
View file @
1e6d48e6
...
...
@@ -68,6 +68,8 @@ class Blockbot(object):
def
get_mps
(
self
,
user_msgs
):
'''
Count the number of messages sent per second
'''
print
user_msgs
[
0
][
3
]
print
user_msgs
[
-
1
][
3
]
time_range
=
user_msgs
[
0
][
3
]
-
user_msgs
[
-
1
][
3
]
mps
=
len
(
user_msgs
)
/
time_range
return
mps
if
time_range
==
0
:
return
1
else
:
return
len
(
user_msgs
)
/
time_range
This diff is collapsed.
Click to expand it.
plugins/wikipedia.py
+
3
−
1
View file @
1e6d48e6
...
...
@@ -37,4 +37,6 @@ class Wikipedia(object):
for
item
in
result
.
childNodes
:
for
textNode
in
item
.
childNodes
:
resultStr
+=
textNode
.
data
+
"
-
"
self
.
server
.
doMessage
(
channel
,
user
+
"
:
"
+
str
(
resultStr
))
self
.
server
.
doMessage
(
channel
,
user
+
"
: Hi.
"
)
print
resultStr
.
strip
()
self
.
server
.
doMessage
(
channel
,
user
+
"
:
"
+
resultStr
.
strip
())
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment