Browse files

changed api

  • Loading branch information...
1 parent 223cdce commit 9f6331db5e8dd2042e4a24bb179de1957532f648 @colinmarc committed Mar 23, 2012
Showing with 4 additions and 14 deletions.
  1. +1 −0 python-spdy/__init__.py
  2. +1 −14 python-spdy/{connection.py → context.py}
  3. +2 −0 requirements.txt
View
1 python-spdy/__init__.py
@@ -0,0 +1 @@
+from spdy.context import *
View
15 python-spdy/connection.py → python-spdy/context.py
@@ -5,25 +5,12 @@
SERVER = 'SERVER'
CLIENT = 'CLIENT'
-def _print_bits_nice(bits):
- for i in range(0, len(bits), 4):
- if i % 32 == 0: print('')
- print(bits[i:i+4].to01(), end=" ")
- print("")
-bitarray.print_nice = _print_bits_nice
-
-def _ignore_first_bit(b):
- arr = bytearray()
- arr.append(b[0] & 0b01111111)
- arr.extend(b[1:])
- return bytes(arr)
-
def _bitmask(length, split, mask=0):
invert = 1 if mask == 0 else 0
b = str(mask)*split + str(invert)*(length-split)
return int(b, 2)
-class Connection:
+class Context(object):
def __init__(self, side, version=2):
if side not in [SERVER, CLIENT]:
raise TypeError("side must be SERVER or CLIENT")
View
2 requirements.txt
@@ -0,0 +1,2 @@
+Cython==0.15.1
+bitarray==0.7.0

0 comments on commit 9f6331d

Please sign in to comment.