def stop_server_in_a_thread(self): print "Trying to close the PHP process on %s" % ( self.program_php_server_thread.php_server_process.pid) if Compiler.is_linux() or Compiler.is_mac(): os.killpg(self.program_php_server_thread.php_server_process.pid, signal.SIGTERM) else: os.system('taskkill /f /im php.exe')
def start_server(self): command = '{0} -S localhost:{1} -t {2}'.format(self.php_path, self.port, self.webroot) if Compiler.is_linux() or Compiler.is_mac(): self.php_server_process = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True, preexec_fn=os.setsid) elif Compiler.is_windows(): self.php_server_process = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True)
def __init__(self, width, height, *args, **kwds): wx.Frame.__init__(self, *args, **kwds) sizer = wx.BoxSizer(wx.VERTICAL) self.browser = wx.html2.WebView.New(self) sizer.Add(self.browser, 1, wx.EXPAND, 10) self.SetSizer(sizer) self.SetSize((width, height)) if Compiler.is_linux(): self.icon = wx.Icon("./icon.png", wx.BITMAP_TYPE_PNG) self.SetIcon(self.icon) self.Bind(wx.EVT_CLOSE, self.event_browser_closed) self.Bind(wx.EVT_CHAR_HOOK, self.handle_keystrokes) self.Bind(wx.html2.EVT_WEBVIEW_TITLE_CHANGED, self.title_changed, self.browser)
def __init__(self, width, height, *args, **kwds): wx.Frame.__init__(self, *args, **kwds) sizer = wx.BoxSizer(wx.VERTICAL) self.browser = wx.html2.WebView.New(self) sizer.Add(self.browser, 1, wx.EXPAND, 10) self.SetSizer(sizer) self.SetSize((width, height)) if Compiler.is_linux(): self.icon = wx.Icon("./icon.png", wx.BITMAP_TYPE_PNG) self.SetIcon(self.icon) self.Bind(wx.EVT_CLOSE, self.event_browser_closed) self.Bind(wx.EVT_CHAR_HOOK, self.handle_keystrokes) self.Bind(wx.html2.EVT_WEBVIEW_TITLE_CHANGED, self.title_changed, self.browser)
def start_server(self): command = '{0} -S localhost:{1} -t {2}'.format(self.php_path, self.port, self.webroot) if Compiler.is_linux() or Compiler.is_mac(): self.php_server_process = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True, preexec_fn=os.setsid) elif Compiler.is_windows(): self.php_server_process = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True)
def stop_server_in_a_thread(self): print "Trying to close the PHP process on %s" % (self.program_php_server_thread.php_server_process.pid) if Compiler.is_linux() or Compiler.is_mac(): os.killpg(self.program_php_server_thread.php_server_process.pid, signal.SIGTERM) else: os.system('taskkill /f /im php.exe')