Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Add syntax highlighting to README #1

Merged
merged 1 commit into from almost 2 years ago

2 participants

Dominik Dabrowski Colin Marc
Dominik Dabrowski
doda commented June 20, 2012

No description provided.

Colin Marc
Owner

good call, thanks

Dominik Dabrowski
doda commented June 20, 2012

np! noticed when i browsed around my hackerschool github feed folder in google reader :)

Colin Marc colinmarc merged commit 5d09e5f into from June 30, 2012
Colin Marc colinmarc closed this June 30, 2012
Colin Marc
Owner

I thought I merged this before!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jun 20, 2012
Add syntax highlighting to README 4dfaf2f
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 22 additions and 21 deletions. Show diff stats Hide diff stats

  1. 43  README.md
43  README.md
Source Rendered
@@ -5,32 +5,33 @@ python-spdy is a simple spdy parser/(de)muxer for python >= 2.7 (including 3.x).
5 5
 
6 6
 usage
7 7
 -----
  8
+```python
8 9
 
9  
-	import spdy, spdy.frames
10  
-	
11  
-	#with an existing socket or something
12  
-	context = spdy.Context(side=spdy.SERVER, version=2)
  10
+import spdy, spdy.frames
13 11
 
14  
-	while True:
15  
-		data = sock.recv(1024)
16  
-		if not data:
17  
-			break
  12
+#with an existing socket or something
  13
+context = spdy.Context(side=spdy.SERVER, version=2)
18 14
 
19  
-		context.incoming(data)
  15
+while True:
  16
+	data = sock.recv(1024)
  17
+	if not data:
  18
+		break
20 19
 
21  
-		while True:
22  
-			frame = context.get_frame()
23  
-			if not frame: 
24  
-				break
25  
-			
26  
-			if isinstance(frame, spdy.frames.Ping):
27  
-				pong = spdy.frames.Ping(frame.ping_id)
28  
-				context.put_frame(pong)
29  
-	
30  
-		outgoing = context.outgoing()
31  
-		if outgoing:
32  
-			sock.sendall(outgoing)	
  20
+	context.incoming(data)
33 21
 
  22
+	while True:
  23
+		frame = context.get_frame()
  24
+		if not frame: 
  25
+			break
  26
+		
  27
+		if isinstance(frame, spdy.frames.Ping):
  28
+			pong = spdy.frames.Ping(frame.ping_id)
  29
+			context.put_frame(pong)
  30
+
  31
+	outgoing = context.outgoing()
  32
+	if outgoing:
  33
+		sock.sendall(outgoing)	
  34
+```
34 35
 installation
35 36
 ------------
36 37
 
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.