Created
September 7, 2012 18:37
-
-
Save PEM-FR/3668449 to your computer and use it in GitHub Desktop.
meeting summary module for phenny
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
meeting_summary.py - Phenny meeting_summary Module | |
""" | |
import datetime as dt | |
from tools import deprecated | |
startTime = 0 | |
stopTime = 0 | |
elapsed = 0 | |
agenda = [] | |
def meetingStart(phenny, input): | |
""".meetingStart - starts a new meeting.""" | |
startTime = dt.datetime.now() | |
t = str(startTime) | |
msg = "Meeting started at %s on %s" % (t, input.sender) | |
return phenny.reply(msg) | |
meetingStart.rule = (['meetingStart'], r'(\S+)') | |
def meetingStop(phenny, input): | |
""".meetingStop - stops a meeting.""" | |
stopTime = dt.datetime.now() | |
t = str(stopTime) | |
elapsed = str(stopTime - startTime) | |
msg = "Meeting stopped at %s on %s - meeting lasted for %s" % (t, input.sender, elapsed) | |
return phenny.reply(msg) | |
meetingStop.rule = (['meetingStop'], r'(\S+)') | |
def addAgenda(phenny, input): | |
""".addAgenda <topic> - adds an agenda.""" | |
topic = input.group(2) | |
agenda.append(topic) | |
msg = "Adding topic %s to Meeting Agenda. Currently having %d topic(s)" % (topic, len(agenda)) | |
return phenny.reply(msg) | |
addAgenda.rule = (['addAgenda'], r'(\S+)') | |
if __name__ == '__main__': | |
print __doc__.strip() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
working solution :
!/usr/bin/env python
"""
meeting_summary.py - Phenny meeting_summary Module
"""
import datetime as dt
from tools import deprecated
startTime = 0
stopTime = 0
elapsed = 0
agenda = []
def meetingStart(phenny, input):
""".meetingStart - starts a new meeting."""
global startTime
startTime = dt.datetime.now()
t = str(startTime)
msg = "Meeting started at %s on %s" % (t, input.sender)
return phenny.reply(msg)
meetingStart.rule = (['meetingStart'], r'(\S+)')
def meetingStop(phenny, input):
""".meetingStop - stops a meeting."""
global startTime, elapsed
stopTime = dt.datetime.now()
t = str(stopTime)
elapsed = str(stopTime - startTime)
msg = "Meeting stopped at %s on %s - meeting lasted for %s" % (t, input.sender, elapsed)
return phenny.reply(msg)
meetingStop.rule = (['meetingStop'], r'(\S+)')
def addAgenda(phenny, input):
""".addAgenda - adds an agenda."""
topic = input.group(2)
agenda.append(topic)
msg = "Adding topic %s to Meeting Agenda. Currently having %d topic(s)" % (topic, len(agenda))
return phenny.reply(msg)
addAgenda.rule = (['addAgenda'], r'(\S+)')
if name == 'main':
print doc.strip()