v1.0.0
===================================================================== Finally decided to port personal scripts into a standalone library. --- Release Notes ------------------------ - added support for python, zsh, and zx scripts - added support for "interactive" scripts which drop the user to a REPL - added support for passing arguments to commands - added support for python/node virtualenv management through scwrypts - added contributing and usage docs - updated zsh plugin to write commands to history - licensed under GPLv3 --- New Scripts -------------------------- zsh/scwrypts ) - configure - environment/copy - environment/delete - environment/edit - environment/synchronize - logs/clear - logs/view zsh ) - aws/ecr/login - aws/efs/mount - aws/efs/unmount - aws/route53/backup - aws/s3/media-sync/pull - aws/s3/media-sync/push python ) - redis/interactive
This commit is contained in:
1
py/redis/__init__.py
Normal file
1
py/redis/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
|
15
py/redis/client.py
Normal file
15
py/redis/client.py
Normal file
@ -0,0 +1,15 @@
|
||||
from redis import StrictRedis
|
||||
|
||||
from py.scwrypts import getenv
|
||||
|
||||
|
||||
class RedisClient(StrictRedis):
|
||||
def __init__(self):
|
||||
super().__init__(
|
||||
host = getenv('REDIS_HOST'),
|
||||
port = getenv('REDIS_PORT'),
|
||||
password = getenv('REDIS_AUTH'),
|
||||
decode_responses = True,
|
||||
)
|
||||
|
||||
Client = RedisClient()
|
20
py/redis/interactive.py
Executable file
20
py/redis/interactive.py
Executable file
@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env python
|
||||
from os import getenv
|
||||
|
||||
from py.redis.client import Client
|
||||
from py.scwrypts import interactive
|
||||
|
||||
|
||||
@interactive
|
||||
def main():
|
||||
r = Client
|
||||
|
||||
print('''
|
||||
r = StrictRedis("{getenv("REDIS_HOST")}")
|
||||
''')
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Reference in New Issue
Block a user