本文整理汇总了Python中stdwin.fleep函数的典型用法代码示例。如果您正苦于以下问题:Python fleep函数的具体用法?Python fleep怎么用?Python fleep使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fleep函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: do_cut
def do_cut(win):
text = win.editor.getfocustext()
if not text:
stdwin.fleep()
return
stdwin.setcutbuffer(0, text)
replace(win, '')
示例2: char
def char(self, detail):
try:
func = eval('self.do_' + detail)
except (AttributeError, SyntaxError):
stdwin.fleep()
return
func()
示例3: do_down
def do_down(self):
if self.curindex + 1 == len(self.stack):
stdwin.fleep()
else:
self.curindex = self.curindex + 1
self.curframe = self.stack[self.curindex][0]
self.refreshstack()
示例4: icopy
def icopy(win):
focustext = win.textobj.getfocustext()
if not focustext:
stdwin.fleep()
else:
stdwin.rotatecutbuffers(1)
stdwin.setcutbuffer(0, focustext)
示例5: do_up
def do_up(self):
if self.curindex == 0:
stdwin.fleep()
else:
self.curindex = self.curindex - 1
self.curframe = self.stack[self.curindex][0]
self.refreshstack()
示例6: make_selection
def make_selection(self):
s = self.tefocus.getfocustext()
if not s:
return
stdwin.rotatecutbuffers(1)
stdwin.setcutbuffer(0, s)
if not self.window.setselection(WS_PRIMARY, s):
stdwin.fleep()
示例7: playfile
def playfile(filename):
killchild()
try:
tuple = sndhdr.what(filename)
except IOError, msg:
print 'Can\'t open', filename, msg
stdwin.fleep()
return
示例8: do_clear
def do_clear(window):
first, last = window.textobject.getfocus()
if first == last:
stdwin.fleep() # Nothing to clear
else:
window.textobject.replace('')
window.changed = 1
fix_docsize(window)
示例9: mouse_up
def mouse_up(self, detail):
if self.last_mouse_down:
h1, v1 = self.last_mouse_down[0]
h2, v2 = detail[0]
long1 = self.cur_backend.whereis(stdwin, h1, v1)
long2 = self.cur_backend.whereis(stdwin, h2, v2)
if not long1 or not long2:
return
long1, long2 = self.roundpositions(long1, long2)
self.cur_backend.setselection((long1, long2))
#
selection = self.cur_backend.extractpart(long1, long2)
if not selection:
return
if not self.window.setselection(WS_PRIMARY, selection):
# Meaning some other application got it now
stdwin.fleep()
return
stdwin.rotatecutbuffers(1)
stdwin.setcutbuffer(0, selection)
return
h, v = detail[0]
hits = self.cur_backend.hitcheck(h, v)
if not hits:
return
if len(hits) > 1:
stdwin.message('Please click in exactly one anchor')
return
id = hits[0]
if 1 <= id <= len(self.cur_anchors):
addr = self.cur_anchors[id-1]
name = self.cur_anchornames[id-1]
type = self.cur_anchortypes[id-1]
button = detail[2]
if button == 2:
if name:
msg = 'NAME="' + name + '" '
else:
msg = ''
if addr:
msg = msg + 'HREF="' + addr + '"'
stdwin.message(msg)
elif addr[:7] == 'telnet:':
self.telnet(addr)
elif button == 3 and addr and addr[0] <> '#':
addr = self.full_addr(addr)
w = self.new()
history = self.history + [self.cur_addr]
if not w.setaddr(addr):
w.close()
stdwin.message(addr + ': ' + \
self.last_msg)
else:
w.set_history(history)
else:
self.follow(addr)
else:
stdwin.message('Strange - bad anchor id???')
示例10: but2
def but2(win):
state = win.player.getstatus()[0]
if state == cd.ready:
win.player.play(1, 1)
elif state in (cd.playing, cd.paused):
win.player.togglepause()
else:
stdwin.fleep()
update(win)
示例11: do_copy
def do_copy(window):
selection = window.textobject.getfocustext()
if not selection:
stdwin.fleep() # Nothing to cut
elif not window.setselection(WS_PRIMARY, selection):
stdwin.fleep() # Window manager glitch...
else:
stdwin.rotatecutbuffers(1)
stdwin.setcutbuffer(0, selection)
示例12: character
def character(self, c):
if charnames.has_key(c):
c = charnames[c]
try:
method = getattr(self, 'key_' + c)
except AttributeError:
stdwin.fleep()
return
method()
示例13: but2
def but2(win):
state = win.player.getstatus()[0]
if state == CD.READY:
win.player.play(1, 1)
elif state in (CD.PLAYING, CD.PAUSED):
win.player.togglepause()
else:
stdwin.fleep()
update(win)
示例14: key_space
def key_space(self): # traverse
if self.gotype('menu', H_PUSH) or self.gotype('next', H_NOP):
return
while 1:
if not self.gotype('up', H_POP):
stdwin.fleep()
return
if self.gotype('next', H_NOP):
return
示例15: idispatch
def idispatch(event):
type, win, detail = event
if type == WE_CHAR:
if not keybindings.has_key(detail):
detail = string.lower(detail)
if keybindings.has_key(detail):
keybindings[detail](win)
return
if detail in '0123456789':
i = eval(detail) - 1
if i < 0: i = len(win.menu) + i
if 0 <= i < len(win.menu):
topic, ref = win.menu[i]
imove(win, ref)
return
stdwin.fleep()
return
if type == WE_COMMAND:
if detail == WC_LEFT:
iprev(win)
elif detail == WC_RIGHT:
inext(win)
elif detail == WC_UP:
iup(win)
elif detail == WC_DOWN:
idown(win)
elif detail == WC_BACKSPACE:
ibackward(win)
elif detail == WC_RETURN:
idown(win)
else:
stdwin.fleep()
return
if type == WE_MENU:
mp, item = detail
if mp == None:
pass # A THINK C console menu was selected
elif mp in (win.mainmenu, win.navimenu):
mp.callback[item](win)
elif mp == win.nodemenu:
topic, ref = win.menu[item]
imove(win, ref)
elif mp == win.footmenu:
topic, ref = win.footnotes[item]
imove(win, ref)
return
if type == WE_SIZE:
win.textobj.move((0, 0), win.getwinsize())
(left, top), (right, bottom) = win.textobj.getrect()
win.setdocsize(0, bottom)
return
if type == WE_CLOSE:
iclose(win)
return
if not win.textobj.event(event):
pass