diff options
Diffstat (limited to 'libpathod/utils.py')
-rw-r--r-- | libpathod/utils.py | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/libpathod/utils.py b/libpathod/utils.py index daeccdea..6d42c9b2 100644 --- a/libpathod/utils.py +++ b/libpathod/utils.py @@ -1,8 +1,34 @@ -import copy, os, re +import copy, os, re, StringIO import rparse class AnchorError(Exception): pass + +class Sponge: + def __getattr__(self, x): + return Sponge() + + def __call__(self, *args, **kwargs): + pass + + +class DummyRequest: + connection = Sponge() + def __init__(self): + self.buf = [] + + def write(self, d, callback=None): + self.buf.append(str(d)) + if callback: + callback() + + def getvalue(self): + return "".join(self.buf) + + def finish(self): + return + + def parse_anchor_spec(s, settings): """ For now, this is very simple, and you can't have an '=' in your regular |