Permalink
Browse files

Switched license to MIT, added some module-level comments.

  • Loading branch information...
1 parent a3bb21e commit a963c013e71329a2eafdf282a57ad1ac8d735c09 @mrjoes committed Dec 9, 2011
View
27 LICENSE
@@ -1,14 +1,19 @@
-Copyright (c) 2011, Serge. S. Koval. <http://in-square.net/>
+Copyright (C) 2011 Serge S. Koval
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
View
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+
import tornado.ioloop
import tornado.web
View
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+
from tornado import web, httpserver, ioloop
from sockjs.tornado import SockJSRouter, SockJSConnection
@@ -1,2 +1,4 @@
+# -*- coding: utf-8 -*-
+
from .router import SockJSRouter
from .conn import SockJSConnection
@@ -1,3 +1,11 @@
+# -*- coding: utf-8 -*-
+"""
+ sockjs.tornado.basehandler
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Various base http handlers
+"""
+
import datetime
from tornado.web import asynchronous, RequestHandler
View
@@ -1,22 +1,9 @@
# -*- coding: utf-8 -*-
-#
-# Copyright: (c) 2011 by the Serge S. Koval, see AUTHORS for more details.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
"""
sockjs.tornado.conn
~~~~~~~~~~~~~~~~~~~
+
+ SockJS connection interface
"""
View
@@ -1,26 +1,12 @@
# -*- coding: utf-8 -*-
-#
-# Copyright: (c) 2011 by the Serge S. Koval, see AUTHORS for more details.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
"""
- sockjs.tornado.flashserver
- ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ sockjs.tornado.periodic
+ ~~~~~~~~~~~~~~~~~~~~~~~
This module implements customized PeriodicCallback from tornado with
support of the sliding window.
"""
+
import time
import logging
View
@@ -1,19 +1,4 @@
# -*- coding: utf-8 -*-
-#
-# Copyright: (c) 2011 by the Serge S. Koval, see AUTHORS for more details.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
"""
sockjs.tornado.proto
~~~~~~~~~~~~~~~~~~~~
View
@@ -1,22 +1,9 @@
# -*- coding: utf-8 -*-
-#
-# Copyright: (c) 2011 by the Serge S. Koval, see AUTHORS for more details.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
"""
sockjs.tornado.router
~~~~~~~~~~~~~~~~~~~~~
+
+ SockJS protocol router implementation.
"""
from tornado import ioloop, version_info
View
@@ -1,19 +1,4 @@
# -*- coding: utf-8 -*-
-#
-# Copyright: (c) 2011 by the Serge S. Koval, see AUTHORS for more details.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
"""
sockjs.tornado.session
~~~~~~~~~~~~~~~~~~~~~~
@@ -1,19 +1,4 @@
# -*- coding: utf-8 -*-
-#
-# Copyright: (c) 2011 by the Serge S. Koval, see AUTHORS for more details.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
"""
sockjs.tornado.sessioncontainer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
View
@@ -1,3 +1,11 @@
+# -*- coding: utf-8 -*-
+"""
+ sockjs.tornado.static
+ ~~~~~~~~~~~~~~~~~~~~~
+
+ Various static handlers required for SockJS to function properly.
+"""
+
import time
import hashlib
@@ -24,6 +32,8 @@
class IFrameHandler(BaseHandler):
+ """IFrame page handler"""
+
def initialize(self, server):
self.server = server
@@ -50,6 +60,8 @@ def get(self):
class GreetingsHandler(BaseHandler):
+ """Greetings page handler"""
+
def initialize(self, server):
self.server = server
@@ -61,6 +73,9 @@ def get(self):
class ChunkingTestHandler(PreflightHandler):
+ """Chunking test handler"""
+
+ # Step timeouts according to sockjs documentation
steps = [0.005, 0.025, 0.125, 0.625, 3.125]
def initialize(self, server):
@@ -73,12 +88,15 @@ def post(self):
self.preflight()
self.set_header('Content-Type', 'application/javascript; charset=UTF-8')
+ # Send one 'h' immediately
self.write('h\n')
self.flush()
+ # Send 2048 spaces followed by 'h'
self.write(' ' * 2048 + 'h\n')
self.flush()
+ # Send 'h' with different timeouts
def run_step():
try:
self.write('h\n')
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+
import sockjs.tornado.transports.pollingbase
from .xhr import XhrPollingTransport, XhrSendHandler
@@ -1,11 +1,17 @@
+# -*- coding: utf-8 -*-
+"""
+ sockjs.tornado.transports.eventsource
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ EventSource transport implementation.
+"""
+
from tornado.web import asynchronous
from sockjs.tornado.transports import pollingbase
class EventSourceTransport(pollingbase.PollingTransportBase):
- name = 'eventsource'
-
@asynchronous
def get(self, session_id):
# Start response
@@ -1,8 +1,17 @@
+# -*- coding: utf-8 -*-
+"""
+ sockjs.tornado.transports.htmlfile
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ HtmlFile transport implementation.
+"""
+
from tornado.web import asynchronous
from sockjs.tornado import proto
from sockjs.tornado.transports import pollingbase
+# HTMLFILE template
HTMLFILE_HEAD = r'''
<!doctype html>
<html><head>
@@ -17,14 +26,11 @@
window.onload = function() {c.stop();};
</script>
'''.strip()
-
HTMLFILE_HEAD += ' ' * (1024 - len(HTMLFILE_HEAD) + 14)
HTMLFILE_HEAD += '\r\n\r\n'
class HtmlFileTransport(pollingbase.PollingTransportBase):
- name = 'htmlfile'
-
@asynchronous
def get(self, session_id):
# Start response
@@ -1,3 +1,11 @@
+# -*- coding: utf-8 -*-
+"""
+ sockjs.tornado.transports.jsonp
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ JSONP transport implementation.
+"""
+
import urllib
from tornado.web import asynchronous
@@ -1,12 +1,18 @@
-import logging
+# -*- coding: utf-8 -*-
+"""
+ sockjs.tornado.transports.pollingbase
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Polling transports base
+"""
from tornado.web import asynchronous
from sockjs.tornado.basehandler import PreflightHandler
class PollingTransportBase(PreflightHandler):
- """Polling handler base"""
+ """Polling transport handler base class"""
def initialize(self, server):
self.server = server
self.session = None
@@ -1,24 +1,9 @@
# -*- coding: utf-8 -*-
-#
-# Copyright: (c) 2011 by the Serge S. Koval, see AUTHORS for more details.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
"""
sockjs.tornado.transports.websocket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Websocket transport implementation.
+ Websocket transport implementation
"""
import logging
@@ -29,7 +14,7 @@
class WebSocketTransport(WebSocketHandler):
- """Websocket tranport"""
+ """Websocket transport"""
def initialize(self, server):
self.server = server
self.session = None
@@ -1,3 +1,11 @@
+# -*- coding: utf-8 -*-
+"""
+ sockjs.tornado.transports.xhr
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Xhr-Polling transport implementation
+"""
+
from tornado.web import asynchronous
from sockjs.tornado import proto
Oops, something went wrong.

0 comments on commit a963c01

Please sign in to comment.