Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix io package import #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions pyramid_socketio/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import logging
import gevent
import sys

__all__ = ['SocketIOError', 'SocketIOContext', 'socketio_manage']

Expand Down Expand Up @@ -51,7 +52,13 @@ def __init__(self, request, in_type="type", out_type="type", debug=False,
dispatched.
"""
self.request = request
self.io = request.environ['socketio']
print 'io before1'
try:
self.io = request.environ['socketio']
except:
print sys.exc_info()[0],sys.exc_info()[1]
raise Exception('Error')
print 'io finish1'
if json_dumps:
self.io.dumps = json_dumps
if json_loads:
Expand Down Expand Up @@ -271,8 +278,9 @@ def socketio_manage(start_context):
messages for a particular context.
"""
request = start_context.request
print 'io before'
io = request.environ['socketio']

print 'io finish'
if hasattr(start_context, 'connect'):
getattr(start_context, 'connect')()

Expand Down
2 changes: 1 addition & 1 deletion pyramid_socketio/pasteserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# hump'ly ripped from pastegevent 0.1

from gevent import reinit
from socketio import SocketIOServer
from socketio.server import SocketIOServer
from gevent.monkey import patch_all

__all__ = ["server_factory",
Expand Down
2 changes: 1 addition & 1 deletion pyramid_socketio/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import sys
import os

from socketio import SocketIOServer
from socketio.server import SocketIOServer
from paste.deploy import loadapp


Expand Down