forked from quantmind/pulsar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
quantmind
committed
Apr 15, 2011
1 parent
c3150fc
commit 94f0298
Showing
31 changed files
with
403 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ docs/build/* | |
dist/* | ||
.project | ||
.pydevproject | ||
cfg.py | ||
.settings/* | ||
lib/src/parser.c | ||
pulsar/http/cparser/parser.* |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from pulsar import test | ||
from pulsar.http import rpc | ||
|
||
from .calculator import run | ||
|
||
|
||
class TestCalculatorExample(test.TestCase): | ||
|
||
def setUp(self): | ||
self.p = rpc.JsonProxy('http://localhost:8060') | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from pulsar import test | ||
from pulsar.http import HttpClient | ||
|
||
from .helloworld import run | ||
|
||
class TestCalculatorExample(test.TestCase): | ||
uri = 'http://localhost:8060' | ||
|
||
def setUp(self): | ||
self.c = HttpClient() | ||
|
||
def testThreadWorker(self): | ||
run(worker_class = 'http_t') | ||
resp = self.c.request(self.uri) | ||
self.assertEqual(resp,'Hello World!') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
'''\ | ||
The Httplib2 clinet | ||
This is a thin layer on top of httplib2 python library. | ||
http://code.google.com/p/httplib2/ | ||
''' | ||
import httplib2 | ||
|
||
from .std import HttpClientBase | ||
|
||
|
||
class Response(object): | ||
__slots__ = ('response','content') | ||
def __init__(self, response, content): | ||
self.response = response | ||
self.content = content | ||
|
||
|
||
class HttpClient2(HttpClientBase): | ||
|
||
def __init__(self, proxy_info = None, | ||
timeout = None, cache = None, headers = None): | ||
self._opener = httplib2.Http(cache = cache, timeout = timeout, | ||
proxy_info = proxy_info) | ||
|
||
def request(self, uri, method='GET', body=None, headers = None, **kwargs): | ||
r = self._opener.open(uri, | ||
method=method, | ||
body=body, | ||
headers=self.headers(headers)) | ||
return Response(r) | ||
|
||
def add_credentials(self, username, password, domain = ''): | ||
self._opener.add_credentials(username, password, domain) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
|
||
|
Oops, something went wrong.