当前位置: 首页>>代码示例>>Python>>正文


Python WConio.clreol方法代码示例

本文整理汇总了Python中WConio.clreol方法的典型用法代码示例。如果您正苦于以下问题:Python WConio.clreol方法的具体用法?Python WConio.clreol怎么用?Python WConio.clreol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WConio的用法示例。


在下文中一共展示了WConio.clreol方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _erase

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import clreol [as 别名]
    def _erase(self):
	self.written_x = 0
	sys.stdout.write ("\r")
	if self.OS != 'nt':
	    sys.stdout.write ("\x1b[0K")
	else:
	    WConio.clreol()
开发者ID:sechacking,项目名称:wfuzz,代码行数:9,代码来源:printers.py

示例2: display_suggestion

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import clreol [as 别名]
def display_suggestion(msg):
    global old_matches
    matches = []
    if not msg or not msg.strip():
        if old_matches != matches:
            W.gotoxy(0, C.height - 2)
            W.clreol()
            old_matches = matches
        return
    msg = msg.split()[0]
    for command in commands:
        if command.command.startswith(msg) and not command.hide:
            matches.append(command)
    if matches:
        #limit our match count
        matches = matches[:5]
        if old_matches != matches:
            old_matches = matches
            W.gotoxy(0, C.height - 2)
            W.clreol()
        
            targetwidth = C.width / len(matches)
            W.textcolor(W.DARKGREY)
            for command in matches:
                W.cputs(('%s (%s)' % (command.command, format_time(command.time, command.time_variable))).center(targetwidth))
    return matches
开发者ID:jtruscott,项目名称:ld21,代码行数:28,代码来源:gameprompt.py

示例3: restore

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import clreol [as 别名]
def restore():
    '''
        Keep the terminal usable.
        Always performed on exit.
    '''
    W.clreol()
    W.textattr(defaultcolor)
    W.setcursortype(1)
开发者ID:jtruscott,项目名称:pyweek13,代码行数:10,代码来源:term_win.py

示例4: status

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import clreol [as 别名]
 def status(self, y, s):
 #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     wc.gotoxy(0, y)
     wc.movetext(0, y, self.ex, self.ey -1, 0, y+1)
     wc.gotoxy(0, y)
     wc.textbackground(7)
     wc.textcolor(15)
     wc.clreol()
     wc.cputs(s)
开发者ID:chyser,项目名称:bin,代码行数:11,代码来源:conio.py

示例5: limpialinea

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import clreol [as 别名]
def limpialinea():
	sys.stdout.write ("\r")
	if OS!='nt':
		sys.stdout.write ("\x1b[0K")
	else:
		WConio.clreol()
开发者ID:4199730967932844,项目名称:wfuzz,代码行数:8,代码来源:wfuzz.py

示例6: get_input

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import clreol [as 别名]
def get_input():
    buf = []
    while True:
        msg = ''.join(buf)
        matches = display_suggestion(msg)

        W.gotoxy(0, C.height - 1)
        W.clreol()
        W.textcolor(W.GREEN)
        W.cputs(game.state.current_node.command_prompt + '$ '),
        W.textcolor(W.LIGHTGREEN)
        W.cputs(msg)

        if matches and len(matches) == 1:
            #show the argument help text
            match = matches[0]
            x = W.wherex()
            W.textcolor(W.DARKGREY)
            splitted = match.arguments.split()
            splitted = splitted[max(0, len(msg.split())-2):]
            W.cputs('  ' + ' '.join(splitted))
            W.textcolor(W.LIGHTGREEN)
            W.gotoxy(x, C.height - 1)
        else:
            match = None
        
        #Read input
        W.setcursortype(1)
        (chn, chs) = W.getch()
        W.setcursortype(0)

        #figure out if we're done
        if chs == '\r':
            #enter, exit
            break

        if chn == 8: 
            #backspace
            if len(buf):
                buf.pop()
            else:
                MessageBeep()
            continue
        if chn == 3:
            log.debug('took a ctrl-c')
            game.fire('specialkey', 'ctrlc')
            break

        if chn == 0 or chn == 224:
            #special keys come in two parts
            (chn2, _) = W.getch()
            if chn2 in W.__keydict:
                game.fire('specialkey', W.__keydict[chn2])
            continue

        if len(buf) >= C.width:
            #way too long now
            break
        
        if chs not in string.printable:
            #dont care
            continue

        buf.append(chs)
    return buf, match
开发者ID:jtruscott,项目名称:ld21,代码行数:67,代码来源:gameprompt.py

示例7:

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import clreol [as 别名]
logger.addHandler(hdlr) 
logger.setLevel(logging.DEBUG)

import sys
import os
if 'nt' not in os.name:
    import XConio
    import curses
    import game
    game.start = curses.wrapper(game.start)
import WConio as W
defaultcolor = W.gettextinfo()[4]

import game
try:
    game.start()
except game.GameShutdown:
    W.textmode()
    pass
except KeyboardInterrupt:
    W.textmode()
    raise
except:
    raise
finally:
    logger.debug("Shutting down")
    logging.shutdown()
    W.clreol()
    W.textattr(defaultcolor)
    W.setcursortype(1)
开发者ID:jtruscott,项目名称:ld21,代码行数:32,代码来源:main.py

示例8: delete_line

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import clreol [as 别名]
 def delete_line(self):
     if os.name != 'nt':
         sys.stdout.write("\r" + Term.delete)
     else:
         WConio.clreol()
开发者ID:SilentZephyrus,项目名称:wfuzz,代码行数:7,代码来源:common.py

示例9: clearLines

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import clreol [as 别名]
def clearLines():
	for i in range (21,24):
		WConio.gotoxy(0,i)
		WConio.clreol()
开发者ID:marcgalang,项目名称:otto,代码行数:6,代码来源:otto.py


注:本文中的WConio.clreol方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。