self.green = u"\e[1;32m"
else:
self.endcolor = self.blue = self.red = self.green = ""
+ #: Faut-il contacter le serveur distant
+ self.do_remote = True
#: Serveur distant où aller récupérer les checks
self.distant_server = "pimeys"
#: path de today-server.py sur le serveur distant
return checks
def get_everything():
- """Récupère toutes les infos"""
- work = [action() for action in AUTOMATED_ACTIONS.values()]
+ """Récupère toutes les infos."""
+ work = [action() for (keyword, action) in AUTOMATED_ACTIONS.iteritems()
+ if (config.do_remote or not keyword in REMOTE_ACTIONS)]
chain = u"\n\n".join([result for result in work if result])
return chain
"init" : initialize,
}
+#: Les actions qui nécessitent un accès au serveur distant
+REMOTE_ACTIONS = ["check", "sync"]
+
#: Toutes les actions
ACTIONS = dict(AUTOMATED_ACTIONS)
ACTIONS.update(OTHER_ACTIONS)
import sys
if "--no-color" in sys.argv:
config.endcolor, config.red, config.blue = u"", u"", u""
+ sys.argv.remove("--no-color")
+ if "--no-remote" in sys.argv:
+ config.do_remote = False
+ sys.argv.remove("--no-remote")
if len(sys.argv) == 1:
# Juste un today
output = ACTIONS[None]()