|
|
@@ -40,7 +40,7 @@ class RedisClient(object):
|
|
|
:param value:
|
|
|
:return:
|
|
|
"""
|
|
|
- value = json.dump(value, ensure_ascii=False).encode('utf-8') if isinstance(value, (dict, list)) else value
|
|
|
+ value = json.dumps(value) if isinstance(value, (dict, list)) else value
|
|
|
return self.__conn.sadd(self.name, value)
|
|
|
|
|
|
def pop(self):
|
|
|
@@ -73,14 +73,15 @@ if __name__ == '__main__':
|
|
|
# redis_con.put('abc')
|
|
|
# redis_con.put('123')
|
|
|
# redis_con.put('123.115.235.221:8800')
|
|
|
- # print redis_con.getAll()
|
|
|
+ # redis_con.put(['123', '115', '235.221:8800'])
|
|
|
+ # print(redis_con.getAll())
|
|
|
# redis_con.delete('abc')
|
|
|
- # print redis_con.getAll()
|
|
|
+ # print(redis_con.getAll())
|
|
|
# redis_con.pop()
|
|
|
- # print redis_con.getAll()
|
|
|
+ # print(redis_con.getAll())
|
|
|
redis_con.changeTable('raw_proxy')
|
|
|
|
|
|
redis_con.put('132.112.43.221:8888')
|
|
|
# redis_con.changeTable('proxy')
|
|
|
- print redis_con.get_status()
|
|
|
- print redis_con.getAll()
|
|
|
+ print(redis_con.get_status())
|
|
|
+ print(redis_con.getAll())
|