diff --git a/html/ptg.html b/html/ptg.html
index b15744f..ee56321 100644
--- a/html/ptg.html
+++ b/html/ptg.html
@@ -27,10 +27,11 @@
Currently playing...
- {{#each now}}
+ {{#each now as |what room|}}
- {{@key}} |
- {{#hashtag}}{{this}}{{/hashtag}} |
+ {{room}} |
+ {{#hashtag}}{{what}}{{/hashtag}} |
+ {{lookup @root.location room}} |
{{else}}
Nothing yet | |
diff --git a/ptgbot/bot.py b/ptgbot/bot.py
index 05f3e14..42ff544 100644
--- a/ptgbot/bot.py
+++ b/ptgbot/bot.py
@@ -137,6 +137,8 @@ class PTGBot(irc.bot.SingleServerIRCBot):
self.data.clean_rooms([room])
elif adverb == 'color':
self.data.add_color(room, session)
+ elif adverb == 'location':
+ self.data.add_location(room, session)
else:
self.send(chan, "%s: unknown directive '%s'" % (nick, adverb))
self.usage(chan)
diff --git a/ptgbot/db.py b/ptgbot/db.py
index addf3e8..71331d2 100644
--- a/ptgbot/db.py
+++ b/ptgbot/db.py
@@ -21,7 +21,8 @@ import datetime
class PTGDataBase():
- BASE = {'rooms': [], 'ethercalc': [], 'now': {}, 'next': {}, 'colors': {}}
+ BASE = {'rooms': [], 'ethercalc': [], 'now': {}, 'next': {}, 'colors': {},
+ 'location': {}}
def __init__(self, filename, ethercalc):
self.filename = filename
@@ -43,6 +44,12 @@ class PTGDataBase():
self.data['colors'][room] = color
self.save()
+ def add_location(self, room, location):
+ if 'location' not in self.data:
+ self.data['location'] = {}
+ self.data['location'][room] = location
+ self.save()
+
def add_next(self, room, session):
if room not in self.data['next']:
self.data['next'][room] = []