Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
irker
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iDB
irker
Commits
6106961a
Commit
6106961a
authored
12 years ago
by
Eric S. Raymond
Browse files
Options
Downloads
Patches
Plain Diff
Simplify - I don't think we'll need fancy hooks.
parent
8c1f62ab
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
irker.py
+1
-12
1 addition, 12 deletions
irker.py
with
1 addition
and
12 deletions
irker.py
+
1
−
12
View file @
6106961a
...
...
@@ -24,6 +24,7 @@ class Session():
"
IRC session and message queue processing.
"
count
=
1
def
__init__
(
self
,
ircserver
,
url
):
self
.
ircserver
=
ircserver
self
.
url
=
url
# The consumer thread
self
.
queue
=
Queue
.
Queue
()
...
...
@@ -65,23 +66,11 @@ class Irker:
"
Persistent IRC multiplexer.
"
def
__init__
(
self
):
self
.
irc
=
irclib
.
IRC
()
self
.
irc
.
add_global_handler
(
"
welcome
"
,
lambda
c
,
e
:
self
.
__on_connect
(
c
,
e
))
self
.
irc
.
add_global_handler
(
"
join
"
,
lambda
c
,
e
:
self
.
__on_join
(
c
,
e
))
self
.
irc
.
add_global_handler
(
"
disconnect
"
,
lambda
c
,
e
:
self
.
__on_quit
(
c
,
e
))
thread
=
threading
.
Thread
(
target
=
self
.
irc
.
process_forever
)
self
.
irc
.
_thread
=
thread
thread
.
daemon
=
True
thread
.
start
()
self
.
sessions
=
{}
def
__on_connect
(
self
,
event
):
pass
def
__on_join
(
self
,
event
):
pass
def
__on_quit
(
self
,
event
):
pass
def
logerr
(
self
,
errmsg
):
"
Log a processing error.
"
sys
.
stderr
.
write
(
"
irker:
"
+
errmsg
+
"
\n
"
)
...
...
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