import binascii import urllib2 import json from decimal import Decimal try: from filecache import filecache, MONTH except: def filecache(x): def _inner(y): return y return _inner MONTH = None import types_pb2 as proto_types def op_push_data(data): l = len(data) if l < 0x4C: return chr(l) + data elif i < 0xFF: return '\x4C' + chr(l) + data elif i < 0xFFFF: return '\x4D' + struct.pack("