refactor py/lib into python-scwrypts subproject
This commit is contained in:
		@@ -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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user