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
import sys, json | |
class External(object): | |
def run(self): | |
line = sys.stdin.readline() | |
while line: | |
try: | |
response = self.process(json.loads(line.decode('utf_8'))) | |
except Exception, e: | |
response = {'code':500, 'json':{'error':True, 'reason':"Internal error processing request (%s)" % e}} |
NewerOlder