This file contains hidden or 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
| """ | |
| run python web.rewrite.example.py | |
| and then open a browser to localhost:8080/data/foo/bar | |
| The two segments of the path below /data are transformed into query | |
| arguments using the rewrite function pathToArgs. | |
| The root resource is wrapped with the rewrite resource | |
| The second arg to RewriterResource is the rewrite function. |
This file contains hidden or 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
| """binary search. | |
| Given an pre-sorted array (list), keep track of a range L (a subset of the list) in | |
| which a sought value T would exist if it is anywhere in the list. | |
| """ | |
| class End(Exception): | |
| """can't reduce list anymore""" | |
| class TrackList(object): |
This file contains hidden or 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 dictstore.py | |
| @brief Demonstration of technique for testing a class in the magnet/lcaarch | |
| shell that requires asynchronous setup. | |
| """ | |
| from twisted.internet import defer | |
| class DictStore(object): | |
| def __init__(self, backend): |
This file contains hidden or 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
| """ | |
| Example of making many xmlrpc calls in parallel. | |
| The original example is from Jp Calderone's blog: | |
| http://jcalderone.livejournal.com/24285.html | |
| """ | |
| from twisted.internet import reactor | |
| from twisted.internet import defer | |
| from twisted.internet import task |
This file contains hidden or 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 will be w00t |
This file contains hidden or 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
| Teh latest example! |
This file contains hidden or 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 |
This file contains hidden or 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
| n00b |