コード例 #1
0
ファイル: WindowSched.py プロジェクト: olympu/ancient-pythons
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
ファイル: wwww.py プロジェクト: asottile/ancient-pythons
		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
ファイル: wwww.py プロジェクト: olympu/ancient-pythons
     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()