From 36691df514e7f9fcef6fb8a95631e36a4972e3d9 Mon Sep 17 00:00:00 2001 From: Jan Rude Date: Sun, 24 Aug 2014 13:25:10 +0200 Subject: [PATCH] Added support for Windows --- lib/tor_only.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/lib/tor_only.py b/lib/tor_only.py index 0eac5f4..a9f0056 100644 --- a/lib/tor_only.py +++ b/lib/tor_only.py @@ -6,11 +6,21 @@ from colorama import Fore try: import socks except: - print "The module 'SocksiPy' is not installed.\nPlease install it with: sudo apt-get install python-socksipy" + print "The module 'SocksiPy' is not installed." + if sys.platform.startswith('linux'): + "Please install it with: sudo apt-get install python-socksipy" + else: + "You can download it from http://socksipy.sourceforge.net/" sys.exit(-2) def start_daemon(): - os.system('service tor start') + if sys.platform.startswith('linux'): + os.system('service tor start') + elif sys.platform.startswith('win32') or sys.platform.startswith('cygwin'): + print "Please make sure TOR is running..." + else: + print "You are using", sys.platform, ", which is not supported (yet)." + sys.exit(-2) # Using TOR for all connections def connect(port): @@ -42,4 +52,7 @@ def connect(port): def stop(): print "\n" - os.system('service tor stop') \ No newline at end of file + if sys.platform.startswith('linux'): + os.system('service tor stop') + elif sys.platform.startswith('win32') or sys.platform.startswith('cygwin'): + print "You can close TOR now..."