]> gitweb.pimeys.fr Git - today.git/blobdiff - today.py
[saints] échec de .split si y'a pas de saint ce jour-là
[today.git] / today.py
index e430fd881a3030ab8768ced77b3ca24f4ae4366d..6d28b1fe591d7d4486be9640697ac08ef2e21457 100755 (executable)
--- a/today.py
+++ b/today.py
@@ -159,6 +159,8 @@ def get_birthdays(*search):
 def _parse_saint(s):
     """Renvoie la liste des fêtes contenue dans un jour"""
     l = s.split(",")
+    if l == [""]:
+        l = []
     ll = []
     for st in l:
         if st[0] == "&":
@@ -270,6 +272,9 @@ def update_cyprien(newid):
 def update_grenier(newid):
     update_last_seen({"grenier" : int(newid)})
 
+def update_jl8(newid):
+    update_last_seen({"dc" : int(newid)})
+
 
 THINGS = {
           "dtc" : u"Quotes DTC",
@@ -282,6 +287,7 @@ THINGS = {
           "norman" : u"Vidéos de Norman",
           "cyprien" : u"Vidéos de Cyprien",
           "grenier" : u"Épisodes du joueur du grenier",
+          "dc" : u"Épisodes de la BD youngDC",
 
           "birthdays" : u"Anniversaires à souhaiter",
           "saints" : u"Fêtes à souhaiter",
@@ -419,6 +425,7 @@ OTHER_ACTIONS = {
            "norman" : update_norman,
            "cyprien" : update_cyprien,
            "grenier" : update_grenier,
+           "dc" : update_jl8,
            
            "dtc" : get_dtc,
            "ping" : ping,
@@ -450,7 +457,7 @@ if __name__ == "__main__":
         output = ACTIONS[None]()
     else:
         commande = sys.argv[1]
-        args = sys.argv[2:]
+        args = [s.decode("utf-8") for s in sys.argv[2:]]
         output = ACTIONS[commande](*args)
     if output:
         print output.encode("utf-8")