misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
84616827ad
commit
d636c2b1f2
@ -67,6 +67,7 @@ def is_excluded(what):
|
|||||||
|
|
||||||
def on_ui_update(ui):
|
def on_ui_update(ui):
|
||||||
if UNREAD_MESSAGES > 0:
|
if UNREAD_MESSAGES > 0:
|
||||||
|
logging.debug("[grid] unread:%d total:%d" % (UNREAD_MESSAGES, TOTAL_MESSAGES))
|
||||||
ui.on_unread_messages(UNREAD_MESSAGES, TOTAL_MESSAGES)
|
ui.on_unread_messages(UNREAD_MESSAGES, TOTAL_MESSAGES)
|
||||||
|
|
||||||
|
|
||||||
@ -135,4 +136,4 @@ def on_internet_available(agent):
|
|||||||
logging.debug("grid: reporting disabled")
|
logging.debug("grid: reporting disabled")
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error("grid api: %s" % e)
|
logging.error("grid api: %s" % e)
|
||||||
|
@ -70,9 +70,12 @@ class Voice:
|
|||||||
self._('My crime is that of curiosity ...')])
|
self._('My crime is that of curiosity ...')])
|
||||||
|
|
||||||
def on_new_peer(self, peer):
|
def on_new_peer(self, peer):
|
||||||
return random.choice([
|
if peer.first_encounter():
|
||||||
self._('Hello {name}! Nice to meet you.').format(name=peer.name()),
|
return random.choice([
|
||||||
self._('Unit {name} is nearby!').format(name=peer.name())])
|
self._('Hello {name}! Nice to meet you.').format(name=peer.name())])
|
||||||
|
else:
|
||||||
|
return random.choice([
|
||||||
|
self._('Unit {name} is nearby!').format(name=peer.name())])
|
||||||
|
|
||||||
def on_lost_peer(self, peer):
|
def on_lost_peer(self, peer):
|
||||||
return random.choice([
|
return random.choice([
|
||||||
|
Loading…
x
Reference in New Issue
Block a user