Mercurial > public > sg101
annotate irc/channel.py @ 1096:d9cd3180c12c
More GCalendar V3 conversion in progress.
Built a brand new post editor. It is hardcoded into GCalendar
right now. We will make it more general in the future.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Tue, 14 Jun 2016 21:16:09 -0500 |
parents | 79e785f0bdad |
children |
rev | line source |
---|---|
bgneal@656 | 1 """Abstracts the list of users in the IRC channel.""" |
bgneal@656 | 2 |
bgneal@656 | 3 from redis import RedisError |
bgneal@656 | 4 |
bgneal@656 | 5 from core.services import get_redis_connection |
bgneal@656 | 6 |
bgneal@656 | 7 def get_users(): |
bgneal@656 | 8 """Return a list of users in the IRC channel.""" |
bgneal@656 | 9 conn = get_redis_connection() |
bgneal@656 | 10 try: |
bgneal@656 | 11 nicks = conn.get('irc:channel_members') |
bgneal@656 | 12 except RedisError: |
bgneal@656 | 13 nicks = None |
bgneal@656 | 14 |
bgneal@656 | 15 return nicks.split() if nicks else [] |