Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (19 sloc) 590 Bytes
from redis import Redis
import uuid
CHANNELS = "channels"
r = Redis()
class Channel(object):
def __init__(self, name=None):
if name: = name
else: = str(uuid.uuid1())
def all():
return r.lrange(CHANNELS, 0, -1)
def add_command(self, cmd):
""" add command to channel command list """
r.rpush( + ":commands", cmd)
def get_commands(self):
return r.lrange( + ":commands", 0, -1)