X-Git-Url: http://gitweb.pimeys.fr/?a=blobdiff_plain;f=today.py;h=c08f8e6e155742af049d4db8893135de209f13b7;hb=d96481cd936bbd0a71a84f23bb78c6965d1c23fc;hp=81cc8b8e6f7e43133c5aae90336ffbf7d8dbe6cd;hpb=03ed1ffcef304a06564c1bb974401aa25f9c5e8c;p=today.git diff --git a/today.py b/today.py index 81cc8b8..c08f8e6 100755 --- a/today.py +++ b/today.py @@ -181,7 +181,14 @@ def get_saints(): now = get_now() saints = {} saints["today"] = _parse_saint(sourcesaints[now.month - 1][now.day - 1]) - saints["tomorrow"] = _parse_saint(sourcesaints[now.month - 1][now.day]) + nbdays = len(sourcesaints[now.month - 1]) + if now.day == nbdays: # il faut regarder le mois suivant + if now.month == 12: # il faut regarder l'année suivante + saints["tomorrow"] = _parse_saint(sourcesaints[0][0]) + else: + saints["tomorrow"] = _parse_saint(sourcesaints[now.month][0]) + else: + saints["tomorrow"] = _parse_saint(sourcesaints[now.month - 1][now.day]) firstnames = _get_firstnames() towish = {"today" : [], "tomorrow" : []} for day in ["today", "tomorrow"]: @@ -228,7 +235,7 @@ def get_dtc(*args): cmd = "~/bin/dtc %s %s --json" % (args[0], args[1]) else: return None - proc = subprocess.Popen(["ssh", config.distant_server, cmd], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + proc = subprocess.Popen(["ssh", "-4", config.distant_server, cmd], stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = proc.communicate() out += err quotes = json.loads(out) @@ -285,7 +292,7 @@ THINGS = { def check_all(): """Vérifie si il y a des derniers trucs non lus/vus.""" cmd = "%s whatsup" % (config.path_today_server,) - proc = subprocess.Popen(["ssh", config.distant_server, cmd], stdout=subprocess.PIPE) + proc = subprocess.Popen(["ssh", "-4", config.distant_server, cmd], stdout=subprocess.PIPE) out, err = proc.communicate() news = json.loads(out) seen = get_last_seen() @@ -380,7 +387,7 @@ def sync(): le maximum de chaque truc vu est gardé des deux côtés.""" lasts = get_last_seen() cmd = "%s sync" % (config.path_today_server,) - proc = subprocess.Popen(["ssh", config.distant_server, cmd], + proc = subprocess.Popen(["ssh", "-4", config.distant_server, cmd], stdin = subprocess.PIPE, stdout=subprocess.PIPE, close_fds = True) lasts_raw = json.dumps(lasts)