def __init__(self): address = ('', _PORT) # HTTPServer is an old-style class :( BaseHTTPServer.HTTPServer.__init__(self, address, StatusServerRequestHandler) self._shutting_down = False self._drone_manager = drone_manager.instance() self._shutdown_scheduler = False # ensure the listening socket is not inherited by child processes old_flags = fcntl.fcntl(self.fileno(), fcntl.F_GETFD) fcntl.fcntl(self.fileno(), fcntl.F_SETFD, old_flags | fcntl.FD_CLOEXEC)
def initialize_globals(): global _drone_manager _drone_manager = drone_manager.instance()