refactor py/lib into python-scwrypts subproject

This commit is contained in:
2024-02-18 02:30:58 -07:00
parent d4ef1c70e0
commit 3bcd4f3f6d
58 changed files with 719 additions and 331 deletions

View File

@ -1,15 +1,14 @@
#!/usr/bin/env python
from py.lib.redis import get_client
from py.lib.scwrypts import execute, interactive, getenv
from py.lib.scwrypts.exceptions import ImportedExecutableError
if __name__ != '__main__':
raise ImportedExecutableError()
from scwrypts import execute
#####################################################################
from scwrypts import interactive
from scwrypts.env import getenv
from scwrypts.redis import get_client
description = 'establishes a redis client in an interactive python shell'
parse_args = []
@interactive([
f'r = StrictRedis(\'{getenv("REDIS_HOST")}:{getenv("REDIS_PORT")}\')',
])
@ -20,7 +19,5 @@ def main(_args, _stream):
#####################################################################
execute(main,
description = 'establishes a redis client in an interactive python shell',
parse_args = [],
)
if __name__ == '__main__':
execute(main, description, parse_args)