zephyr-mirror: Clean up hardcoded path names.

(imported from commit 42338d94deb94312c2dee43851bc3c04e3ab373c)
This commit is contained in:
Tim Abbott 2012-10-12 15:15:44 -04:00
parent 959a69f700
commit cb9ad456e7
1 changed files with 5 additions and 4 deletions

View File

@ -13,8 +13,9 @@ import datetime
import textwrap import textwrap
from urllib2 import HTTPError from urllib2 import HTTPError
sys.path.append("/mit/tabbott/Public/python-zephyr/") root_path = "/mit/tabbott/for_friends"
sys.path.append("/mit/tabbott/Public/python-zephyr/build/lib.linux-x86_64-2.6/") sys.path.append(root_path + "/python-zephyr")
sys.path.append(root_path + "/python-zephyr/build/lib.linux-x86_64-2.6/")
parser = optparse.OptionParser() parser = optparse.OptionParser()
parser.add_option('--forward-class-messages', parser.add_option('--forward-class-messages',
@ -134,11 +135,11 @@ def update_subscriptions_from_humbug():
ensure_subscribed(stream) ensure_subscribed(stream)
def maybe_restart_mirroring_script(): def maybe_restart_mirroring_script():
if os.stat("/mit/tabbott/for_friends/restart_stamp").st_mtime > start_time: if os.stat(root_path + "/restart_stamp").st_mtime > start_time:
print "zephyr mirroring script has been updated; restarting..." print "zephyr mirroring script has been updated; restarting..."
while True: while True:
try: try:
os.execvp("/mit/tabbott/for_friends/zephyr_mirror.py", sys.argv) os.execvp(root_path + "/zephyr_mirror.py", sys.argv)
except: except:
print "Error restarting, trying again." print "Error restarting, trying again."
traceback.print_exc() traceback.print_exc()