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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iDB
irker
Commits
9771179d
Commit
9771179d
authored
Aug 30, 2012
by
Eric S. Raymond
Browse files
Options
Downloads
Patches
Plain Diff
pylint cleanup.
parent
c2ec8582
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
irker.py
+11
-11
11 additions, 11 deletions
irker.py
with
11 additions
and
11 deletions
irker.py
+
11
−
11
View file @
9771179d
...
...
@@ -33,7 +33,7 @@ CHANNEL_MAX = 18 # Max channels open per socket (freenet limit)
# No user-serviceable parts below this line
import
sys
,
json
,
exceptions
,
getopt
,
urlparse
,
time
import
sys
,
json
,
getopt
,
urlparse
,
time
import
threading
,
Queue
,
SocketServer
import
irc.client
,
logging
...
...
@@ -67,8 +67,8 @@ version = "1.0"
# unreliable.
class
Connection
:
def
__init__
(
self
,
irker
,
servername
,
port
):
self
.
irker
=
irker
def
__init__
(
self
,
irker
d
,
servername
,
port
):
self
.
irker
=
irker
d
self
.
servername
=
servername
self
.
port
=
port
self
.
connection
=
None
...
...
@@ -97,7 +97,7 @@ class Connection:
"
The server says our nick has a conflict.
"
self
.
irker
.
debug
(
1
,
"
nick %s rejected
"
%
self
.
nickname
())
self
.
nick_trial
+=
1
self
.
nick
(
self
.
nickname
())
self
.
connection
.
nick
(
self
.
nickname
())
def
enqueue
(
self
,
channel
,
message
):
"
Enque a message for transmission.
"
self
.
queue
.
put
((
channel
,
message
))
...
...
@@ -190,8 +190,8 @@ class Target():
class
Dispatcher
:
"
Manage connections to a particular server-port combination.
"
def
__init__
(
self
,
irker
,
servername
,
port
):
self
.
irker
=
irker
def
__init__
(
self
,
irker
d
,
servername
,
port
):
self
.
irker
=
irker
d
self
.
servername
=
servername
self
.
port
=
port
self
.
connections
=
[]
...
...
@@ -235,15 +235,15 @@ class Irker:
"
Debugging information.
"
if
self
.
debuglevel
>=
level
:
sys
.
stderr
.
write
(
"
irker: %s
\n
"
%
errmsg
)
def
_handle_ping
(
self
,
connection
,
event
):
def
_handle_ping
(
self
,
connection
,
_
event
):
"
PING arrived, bump the last-received time for the connection.
"
if
connection
.
context
:
connection
.
context
.
handle_ping
()
def
_handle_welcome
(
self
,
connection
,
event
):
def
_handle_welcome
(
self
,
connection
,
_
event
):
"
Welcome arrived, nick accepted for this connection.
"
if
connection
.
context
:
connection
.
context
.
handle_welcome
()
def
_handle_badnick
(
self
,
connection
,
event
):
def
_handle_badnick
(
self
,
connection
,
_
event
):
"
Nick not accepted for this connection.
"
if
connection
.
context
:
connection
.
context
.
handle_badnick
()
...
...
@@ -253,7 +253,7 @@ class Irker:
for
lump
in
event
.
arguments
():
if
lump
.
startswith
(
"
DEAF=
"
):
connection
.
mode
(
connection
.
context
.
nickname
(),
"
+
"
+
lump
[
5
:])
def
drop_server
(
servername
,
port
):
def
drop_server
(
self
,
servername
,
port
):
"
Drop a server out of the server map.
"
del
self
.
servers
[(
servername
,
port
)]
def
handle
(
self
,
line
):
...
...
@@ -309,7 +309,7 @@ if __name__ == '__main__':
if
debuglvl
>
1
:
logging
.
basicConfig
(
level
=
logging
.
DEBUG
)
elif
opt
==
'
-p
'
:
# Set the listening port
port
=
int
(
val
)
srv
port
=
int
(
val
)
elif
opt
==
'
-V
'
:
# Emit version and exit
sys
.
stdout
.
write
(
"
irker version %s
\n
"
%
version
)
sys
.
exit
(
0
)
...
...
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