From: Vincent Le Gallic Date: Fri, 14 Feb 2014 20:03:21 +0000 (+0100) Subject: Modularisation : enfin découplé, il n'y a plus rien d'hardcodé dans today_server X-Git-Url: http://gitweb.pimeys.fr/?p=today.git;a=commitdiff_plain;h=4f4431b576ad8bc3012d9d6811ce1d215ff29743 Modularisation : enfin découplé, il n'y a plus rien d'hardcodé dans today_server --- 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: