Permalink
Browse files

Quit on Ctrl+C, not ENTER

Also made "drip" runnable directly from scripts
  • Loading branch information...
1 parent 6fb9f08 commit e1c2f000fbf1698d598880a1c03080bf76e0f2b8 @epall committed with brainsik Feb 19, 2011
Showing with 11 additions and 5 deletions.
  1. +11 −5 scripts/drip
View
@@ -17,12 +17,18 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+import sys
+import os
+
+if os.path.dirname(os.path.abspath(__file__)).endswith("scripts"):
+ sys.path = [(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))] + sys.path
import dripbox
import re
import logging
import argparse
import getpass
+import time
LOG_FORMAT = "%(asctime)s - %(levelname)s - %(message)s"
@@ -56,8 +62,8 @@ if not args.force:
dripbox.rsync(remote, host, args.remote_port, args.sync)
dripbox.launch(username, host, remote_root, args.remote_port)
-print("Hit ENTER to quit")
-try:
- raw_input()
-except KeyboardInterrupt:
- print
+while True:
+ try:
+ time.sleep(1000)
+ except KeyboardInterrupt:
+ break

0 comments on commit e1c2f00

Please sign in to comment.