Fix script to correctly figure out the static directory.
Review URL: http://chromereview.prom.corp.google.com/1178030

git-svn-id: svn://chrome-svn/chromeos/trunk@107 06c00378-0e64-4dae-be16-12b19f9950a1
diff --git a/devserver.py b/devserver.py
index c53057a..44f79ed 100644
--- a/devserver.py
+++ b/devserver.py
@@ -6,13 +6,7 @@
 import buildutil
 import os
 import web
-
-app_id = "87efface-864d-49a5-9bb3-4b050a7c227a"
-root_dir = "/usr/local/google/home/rtc/chromeos/trunk/src"
-scripts_dir = "%s/scripts" % root_dir
-app_dir = os.popen("pwd").read().strip()
-static_dir = "%s/static" % app_dir
-web.debug("Serving images from %s/static" % app_dir)
+import sys
 
 urls = ('/', 'index',
         '/update', 'update')
@@ -34,8 +28,10 @@
   def POST(self):
     return autoupdate.HandleUpdatePing(web.data())
 
-if __name__ == "__main__": 
+if __name__ == "__main__":
   web.debug("Setting up the static repo")
+  static_dir = os.path.realpath("%s/static" % os.path.dirname(sys.argv[0]))
+  web.debug("Serving images from %s" % static_dir)
   os.system("mkdir -p %s" % static_dir)
   app.run()