Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefane Fermigier
neo
Commits
321b0bf8
Commit
321b0bf8
authored
8 years ago
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update neo/debug.py example
parent
e5c056b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
neo/debug.py
neo/debug.py
+9
-3
No files found.
neo/debug.py
View file @
321b0bf8
...
@@ -12,12 +12,15 @@ The prompt is accessible through network in case that the process is daemonized:
...
@@ -12,12 +12,15 @@ The prompt is accessible through network in case that the process is daemonized:
IF
=
'pdb'
IF
=
'pdb'
if
IF
==
'pdb'
:
if
IF
==
'pdb'
:
import
socket
,
sys
,
threading
import
socket
,
sys
,
threading
from
neo.lib.debug
import
getPdb
# Unfortunately, IPython does not always print to given stdout.
#from pdb import Pdb as getPdb
#from neo.lib.debug import getPdb
from
pdb
import
Pdb
as
getPdb
class
Socket
(
object
):
class
Socket
(
object
):
def
__init__
(
self
,
socket
):
def
__init__
(
self
,
socket
):
# In case that the default timeout is not None.
socket
.
settimeout
(
None
)
self
.
_socket
=
socket
self
.
_socket
=
socket
self
.
_buf
=
''
self
.
_buf
=
''
...
@@ -55,9 +58,12 @@ if IF == 'pdb':
...
@@ -55,9 +58,12 @@ if IF == 'pdb':
def
pdb
(
app_set
):
def
pdb
(
app_set
):
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
try
:
try
:
# For better security, maybe we should use a unix socket.
s
.
settimeout
(
60
)
s
.
bind
((
'127.0.0.1'
,
0
))
s
.
bind
((
'127.0.0.1'
,
0
))
s
.
listen
(
0
)
s
.
listen
(
0
)
print
'Listening to %u'
%
s
.
getsockname
()[
1
]
print
'Listening to %u'
%
s
.
getsockname
()[
1
]
sys
.
stdout
.
flush
()
# BBB: On Python 3, print() takes a 'flush' arg.
_socket
=
Socket
(
s
.
accept
()[
0
])
_socket
=
Socket
(
s
.
accept
()[
0
])
finally
:
finally
:
s
.
close
()
s
.
close
()
...
@@ -69,7 +75,7 @@ if IF == 'pdb':
...
@@ -69,7 +75,7 @@ if IF == 'pdb':
app
# this is Application instance (see 'app_set' if there are several)
app
# this is Application instance (see 'app_set' if there are several)
try
:
try
:
app_set
=
sys
.
modules
[
'neo.
client.
app'
].
app_set
app_set
=
sys
.
modules
[
'neo.
lib.threaded_
app'
].
app_set
except
KeyError
:
except
KeyError
:
f
=
sys
.
_getframe
(
3
)
f
=
sys
.
_getframe
(
3
)
try
:
try
:
...
...
This diff is collapsed.
Click to expand it.
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