2013-04-01, 17:49
(2013-04-01, 17:29)MilhouseVH Wrote: Yeah, I'd have to rework entirely the way the argument parsing is handled, which would be a major pain, particularly as much of the functionality expects the script to be executed on the client (where the host would be localhost). Will give it some thought.It's a good alternative, but it would be neat to maintain only one cfg file and updating the script only once.
Though off the top of my head, wouldn't it be easier (certainly for me! ) if you had a directory per client, each containing the required config file? Then just cd to client1, run the script (which can be in a shared/common location all clients), then cd to client2, running the script against client2... The script should (since v0.3.1 or so) look in the current directory first for a config file, then if it doesn't find a config file, it will look in the script folder.
Suggestion 2:
-Handling CTRL-C for graceful exits
e.g.
Code:
import signal
import sys
def signal_handler(signal, frame):
#Call the stats routine here
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)