def info(self): result = Redis.do(self, 'info') d = {} for i in result.split('\r\n'): key, value = i.split(':', 1) if '=' in value: tempd = {} for i in value.split(','): k, v = i.split('=') tempd[k] = v d[key] = tempd elif ',' in value: d[key] = value.split(',') else: if value.isdigit(): d[key] = int(value) else: d[key] = value return d
def hgetall(self, key): d = {} values = Redis.do(self, 'hgetall', key) for i in range(0, len(values), 2): d[values[i]] = values[i+1] return d