Show
Ignore:
Timestamp:
05/23/09 02:06:34 (3 years ago)
Author:
ocjhb
Message:

when storing: removed b64, added zlib

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/sandbox/jhb/oc2/transports.py

    r301 r319  
    6565        return response             
    6666                     
     67class TestTransport(object): 
    6768 
     69    def __init__(self, *args): 
     70        self.results = list(args) 
     71 
     72    def __call__(self,message): 
     73        result = self.results.pop(0) 
     74         
     75        if type(result) == type([]) or type(result) == type(()): 
     76            method = result[0] 
     77            args = list(result[1:]) 
     78            args.append(message) 
     79            return method(*args) 
     80         
     81        elif callable(result): 
     82            return result(message)         
     83         
     84        else: 
     85            return result 
     86