示例#1
0
def delayfunc(msecs):
	msecs = int(msecs)
	#
	# Check for immediate stdwin event
	#
	event = stdwinq.pollevent()
	if event:
		mainloop.dispatch(event)
		return
	#
	# Use sleep for very short delays or if there are no windows
	#
	if msecs < 100 or mainloop.countwindows() == 0:
		if msecs > 0:
			time.sleep(msecs * 0.001)
		return
	#
	# Post a timer event on an arbitrary window and wait for it
	#
	window = mainloop.anywindow()
	window.settimer(msecs/100)
	event = stdwinq.getevent()
	window.settimer(0)
	if event[0] <> WE_TIMER:
		mainloop.dispatch(event)
示例#2
0
def empty():
    return q.empty() and mainloop.countwindows() == 0
示例#3
0
def empty():
	return q.empty() and mainloop.countwindows() == 0
示例#4
0
		args.append(history[-1])
		del history[-1]
	#
	if server_mode:
		start_server()
	#
	stdwin.setdefwinsize(0, 0)
	for addr in args:
		w = WWWWindow()
		w.set_raw_mode(raw_mode)
		if not w.setaddr(addr):
			w.close()
		else:
			w.set_history(history)
	#
	if not server_mode and mainloop.countwindows() == 0:
		# Fallback -- try default pages
		for addr in wwwutil.user_home, wwwutil.system_home:
			if addr not in args:
				w = WWWWindow()
				w.set_raw_mode(raw_mode)
				if not w.setaddr(addr):
					w.close()
				else:
					w.set_history(history)
					break
	#
	if help or not server_mode and mainloop.countwindows() == 0:
		make_help_window()
	#
	mainloop.mainloop()
示例#5
0
def CountWindows():
	return mainloop.countwindows()
示例#6
0
     args.append(history[-1])
     del history[-1]
 #
 if server_mode:
     start_server()
 #
 stdwin.setdefwinsize(0, 0)
 for addr in args:
     w = WWWWindow()
     w.set_raw_mode(raw_mode)
     if not w.setaddr(addr):
         w.close()
     else:
         w.set_history(history)
 #
 if not server_mode and mainloop.countwindows() == 0:
     # Fallback -- try default pages
     for addr in wwwutil.user_home, wwwutil.system_home:
         if addr not in args:
             w = WWWWindow()
             w.set_raw_mode(raw_mode)
             if not w.setaddr(addr):
                 w.close()
             else:
                 w.set_history(history)
                 break
 #
 if help or not server_mode and mainloop.countwindows() == 0:
     make_help_window()
 #
 mainloop.mainloop()