Example #1
0
 def SetFile(self, filename):
     """
     Sets which file will be sent by the HTTP server.
     """
     path = abspath(os.path.normcase(filename))
     resource = static.File(path)
     resource.isLeaf = 1
     self.root_resource.putChild(self.default_url_path, resource)
Example #2
0
 def python_args(self):
     # Find the proper executable in the current dir
     for f in self.launcher_alternatives:
         if os.path.isfile(f):
             prog_name = f
             break
     else:
         return None
     prog_path = abspath(prog_name)
     # We try to keep the same Python interpreter as currently
     if os.path.exists(sys.executable) and re.match(r".*\.py[cow]?$", prog_name, re.IGNORECASE):
         return [sys.executable, prog_path]
     else:
         return [prog_path]