From 4f4431b576ad8bc3012d9d6811ce1d215ff29743 Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Fri, 14 Feb 2014 21:03:21 +0100 Subject: [PATCH] =?utf8?q?Modularisation=20:=20enfin=20d=C3=A9coupl=C3=A9,?= =?utf8?q?=20il=20n'y=20a=20plus=20rien=20d'hardcod=C3=A9=20dans=20today?= =?utf8?q?=5Fserver?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- today_server.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/today_server.py b/today_server.py index d40d552..ec60fe4 100755 --- a/today_server.py +++ b/today_server.py @@ -37,19 +37,6 @@ def update_file(news): json.dump(news, f) f.close() -FETCHS = { - } - -def fetch_all(): - """Va chercher sur les différents sites les nouveaux trucs.""" - news = {} - for (k, f) in FETCHS.iteritems(): - try: - news[k] = f() - except Exception as e: - raise - news.update(gather.gather()) - return news def sync(): """Reçoit une requête de synchronisation.""" @@ -72,7 +59,7 @@ def sync(): if __name__ == "__main__": DEBUG = ("--debug" in sys.argv) or ("--verbose" in sys.argv) or serverconfig.DEBUG if sys.argv[1] == "check": - news = fetch_all() + news = gather.gather() if "--init" in sys.argv: olds = news else: -- 2.39.2