Created
June 20, 2014 23:06
-
-
Save Phyks/23ccf7ca33d96c29d6fd to your computer and use it in GitHub Desktop.
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
def notifs_emprunts(self, serv): | |
"""Notifications when borrowing is over""" | |
now = datetime.datetime.now() | |
1h_later = now + datetime.timedelta(hours=1) | |
query = ("SELECT borrower, tool, until FROM borrowings " + | |
"WHERE until BETWEEN %s AND %s") | |
try: | |
self.bdd_cursor.execute(query, (now, 1h_later)) | |
except mysql.connector.errors.Error: | |
serv.say(serv, | |
"Impossible de récupérer les notifications d'emprunts.") | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment