Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
uva
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
uva
Commits
4835e157
Commit
4835e157
authored
Feb 13, 2011
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed control-c in input handler
parent
4e94aa8d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
telematica/ass1/async.py
telematica/ass1/async.py
+7
-2
telematica/ass1/cli.py
telematica/ass1/cli.py
+2
-3
No files found.
telematica/ass1/async.py
View file @
4835e157
...
@@ -12,7 +12,7 @@ class ClientConnection(object, asyncore.dispatcher):
...
@@ -12,7 +12,7 @@ class ClientConnection(object, asyncore.dispatcher):
self
.
authenticated
=
False
self
.
authenticated
=
False
self
.
authentification_sent
=
False
self
.
authentification_sent
=
False
self
.
nickname
=
'Anonymous'
self
.
user
=
'Anonymous'
self
.
send_queue
=
Queue
()
self
.
send_queue
=
Queue
()
self
.
send_buffer
=
''
self
.
send_buffer
=
''
...
@@ -22,6 +22,11 @@ class ClientConnection(object, asyncore.dispatcher):
...
@@ -22,6 +22,11 @@ class ClientConnection(object, asyncore.dispatcher):
self
.
port
=
addr
[
1
]
self
.
port
=
addr
[
1
]
super
(
ClientConnection
,
self
).
connect
(
addr
)
super
(
ClientConnection
,
self
).
connect
(
addr
)
def
username
(
self
,
name
=
''
):
if
not
user
:
return
self
.
user
self
.
user
=
name
def
handle_connect
(
self
):
def
handle_connect
(
self
):
"""
"""
Called when a connection is established. This method will/should be
Called when a connection is established. This method will/should be
...
@@ -82,7 +87,7 @@ class ClientConnection(object, asyncore.dispatcher):
...
@@ -82,7 +87,7 @@ class ClientConnection(object, asyncore.dispatcher):
def
parse_response
(
self
,
buf
):
def
parse_response
(
self
,
buf
):
if
not
self
.
authenticated
:
if
not
self
.
authenticated
:
if
not
self
.
authentification_sent
:
if
not
self
.
authentification_sent
:
self
.
send_queue
.
put
(
'USER %s'
%
self
.
user
name
)
self
.
send_queue
.
put
(
'USER %s'
%
self
.
user
)
self
.
authentification_sent
=
True
self
.
authentification_sent
=
True
def
parse_notification
(
self
,
buf
):
def
parse_notification
(
self
,
buf
):
...
...
telematica/ass1/cli.py
View file @
4835e157
...
@@ -94,11 +94,10 @@ class CLI:
...
@@ -94,11 +94,10 @@ class CLI:
# application gracefully.
# application gracefully.
try
:
try
:
c
=
self
.
stdscr
.
getch
()
c
=
self
.
stdscr
.
getch
()
except
KeyboardInterrupt
:
self
.
execute
(
'quit'
)
if
c
!=
curses
.
ERR
and
self
.
command_bar
.
handle_input
(
c
):
if
c
!=
curses
.
ERR
and
self
.
command_bar
.
handle_input
(
c
):
break
break
except
KeyboardInterrupt
:
self
.
execute
(
'quit'
)
def
init_command_handler
(
self
):
def
init_command_handler
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment