2022-04-28 16:09:23 -06:00
|
|
|
#!/usr/bin/env python
|
2024-02-06 14:06:44 -07:00
|
|
|
from scwrypts import execute
|
2023-02-21 18:44:27 -07:00
|
|
|
#####################################################################
|
2024-02-06 14:06:44 -07:00
|
|
|
from scwrypts import interactive
|
|
|
|
|
from scwrypts.env import getenv
|
|
|
|
|
from scwrypts.redis import get_client
|
|
|
|
|
|
2023-01-11 17:09:59 -07:00
|
|
|
|
2024-02-06 14:06:44 -07:00
|
|
|
description = 'establishes a redis client in an interactive python shell'
|
|
|
|
|
parse_args = []
|
2022-04-28 16:09:23 -06:00
|
|
|
|
2023-02-21 18:44:27 -07:00
|
|
|
@interactive([
|
|
|
|
|
f'r = StrictRedis(\'{getenv("REDIS_HOST")}:{getenv("REDIS_PORT")}\')',
|
|
|
|
|
])
|
|
|
|
|
def main(_args, _stream):
|
2023-01-11 17:09:59 -07:00
|
|
|
# pylint: disable=possibly-unused-variable
|
2023-02-21 18:44:27 -07:00
|
|
|
r = get_client()
|
2022-04-28 16:09:23 -06:00
|
|
|
return locals()
|
|
|
|
|
|
2023-02-21 18:44:27 -07:00
|
|
|
|
|
|
|
|
#####################################################################
|
2024-02-06 14:06:44 -07:00
|
|
|
if __name__ == '__main__':
|
|
|
|
|
execute(main, description, parse_args)
|