forked from hackyourlife/orakel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstatus.py
More file actions
24 lines (21 loc) · 713 Bytes
/
status.py
File metadata and controls
24 lines (21 loc) · 713 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# vim:set ts=8 sts=8 sw=8 tw=80 noet cc=80:
class Status(object):
def __getattr__(self, name):
if name == 'participants':
return self.get_participants()
if name == 'online':
online = self.get_participants()
return [ online[x]['nick'] for x in online ]
def show_participants(self, *args, **keywords):
if len(args) != 0:
return
send_message = keywords['send_message']
participants = self.participants
send_message("participants: %s" % ", ".join(
[ participants[x]['nick'] \
for x in participants ]))
def show_online_users(self, *args, **keywords):
if len(args) != 0:
return
send_message = keywords['send_message']
send_message("online: %s" % ", ".join(self.online))