本文整理汇总了Python中curses.COLOR_CYAN属性的典型用法代码示例。如果您正苦于以下问题:Python curses.COLOR_CYAN属性的具体用法?Python curses.COLOR_CYAN怎么用?Python curses.COLOR_CYAN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类curses
的用法示例。
在下文中一共展示了curses.COLOR_CYAN属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: init_curses
# 需要导入模块: import curses [as 别名]
# 或者: from curses import COLOR_CYAN [as 别名]
def init_curses():
window = curses.initscr()
curses.noecho() # prevents user input from being echoed
curses.curs_set(0) # make cursor invisible
curses.start_color()
curses.init_pair(1, curses.COLOR_GREEN, curses.COLOR_BLACK)
curses.init_pair(2, curses.COLOR_CYAN, curses.COLOR_BLACK)
curses.init_pair(3, curses.COLOR_RED, curses.COLOR_BLACK)
curses.init_pair(4, curses.COLOR_MAGENTA, curses.COLOR_BLACK)
curses.init_pair(5, curses.COLOR_YELLOW, curses.COLOR_BLACK)
window.timeout(50)
window.keypad(1) # interpret arrow keys, etc
return window
示例2: init_curses
# 需要导入模块: import curses [as 别名]
# 或者: from curses import COLOR_CYAN [as 别名]
def init_curses(self):
"""Setup the curses"""
self.window = curses.initscr()
self.height, self.width = self.window.getmaxyx()
if self.width < 60:
self.too_small = True
return
self.window.keypad(True)
# self.window.nodelay(True)
curses.noecho()
curses.curs_set(False)
curses.cbreak()
curses.start_color()
curses.init_pair(1, curses.COLOR_RED, curses.COLOR_BLACK)
curses.init_pair(2, curses.COLOR_YELLOW, curses.COLOR_BLACK)
curses.init_pair(3, curses.COLOR_WHITE, curses.COLOR_BLACK)
curses.init_pair(4, curses.COLOR_GREEN, curses.COLOR_BLACK)
curses.init_pair(5, curses.COLOR_WHITE, curses.COLOR_CYAN)
示例3: main
# 需要导入模块: import curses [as 别名]
# 或者: from curses import COLOR_CYAN [as 别名]
def main():
screen = init_curses()
y, x = screen.getmaxyx()
# create green
curses.init_pair(1, curses.COLOR_GREEN, -1)
# create red
curses.init_pair(2, curses.COLOR_RED, -1) # -1 is default bcgd color
# create white
curses.init_pair(3, curses.COLOR_WHITE, -1)
# create cyan
curses.init_pair(4, curses.COLOR_CYAN, -1)
# create yellow
curses.init_pair(5, curses.COLOR_YELLOW, -1)
# create black on white
curses.init_pair(6, curses.COLOR_BLACK, curses.COLOR_WHITE)
# print the splash screen out!
splash_screen(screen, y, x)
# check and see if this program is being run by itself
# if so call the main function
示例4: _initialize_colors
# 需要导入模块: import curses [as 别名]
# 或者: from curses import COLOR_CYAN [as 别名]
def _initialize_colors(self):
"""Function for initialzing curses colors. Called when CUI is first created.
"""
# Start colors in curses
curses.start_color()
curses.init_pair(WHITE_ON_BLACK, curses.COLOR_WHITE, curses.COLOR_BLACK)
curses.init_pair(BLACK_ON_GREEN, curses.COLOR_BLACK, curses.COLOR_GREEN)
curses.init_pair(BLACK_ON_WHITE, curses.COLOR_BLACK, curses.COLOR_WHITE)
curses.init_pair(WHITE_ON_RED, curses.COLOR_WHITE, curses.COLOR_RED)
curses.init_pair(YELLOW_ON_BLACK, curses.COLOR_YELLOW, curses.COLOR_BLACK)
curses.init_pair(RED_ON_BLACK, curses.COLOR_RED, curses.COLOR_BLACK)
curses.init_pair(CYAN_ON_BLACK, curses.COLOR_CYAN, curses.COLOR_BLACK)
curses.init_pair(MAGENTA_ON_BLACK, curses.COLOR_MAGENTA, curses.COLOR_BLACK)
curses.init_pair(GREEN_ON_BLACK, curses.COLOR_GREEN, curses.COLOR_BLACK)
curses.init_pair(BLUE_ON_BLACK, curses.COLOR_BLUE, curses.COLOR_BLACK)
示例5: setup_palette
# 需要导入模块: import curses [as 别名]
# 或者: from curses import COLOR_CYAN [as 别名]
def setup_palette(class_):
curses.init_pair(1, curses.COLOR_WHITE, curses.COLOR_BLACK)
curses.init_pair(2, curses.COLOR_BLUE, curses.COLOR_BLACK)
curses.init_pair(3, curses.COLOR_GREEN, curses.COLOR_BLACK)
curses.init_pair(4, curses.COLOR_YELLOW, curses.COLOR_BLACK)
curses.init_pair(5, curses.COLOR_RED, curses.COLOR_BLACK)
curses.init_pair(6, curses.COLOR_CYAN, curses.COLOR_BLACK)
curses.init_pair(7, curses.COLOR_MAGENTA, curses.COLOR_BLACK)
curses.init_pair(8, curses.COLOR_WHITE, curses.COLOR_BLUE)
curses.init_pair(9, curses.COLOR_WHITE, curses.COLOR_RED)
class_.WHITE = curses.color_pair(1)
class_.BLUE = curses.color_pair(2)
class_.GREEN = curses.color_pair(3)
class_.YELLOW = curses.color_pair(4)
class_.RED = curses.color_pair(5)
class_.CYAN = curses.color_pair(6)
class_.MAGENTA = curses.color_pair(7)
class_.WHITE_ON_BLUE = curses.color_pair(8)
class_.WHITE_ON_RED = curses.color_pair(9)
class_.HASHTAG = class_.BLUE | curses.A_BOLD
示例6: setup
# 需要导入模块: import curses [as 别名]
# 或者: from curses import COLOR_CYAN [as 别名]
def setup(self, stdscr):
fm_log(logger, 'init baidufm fm cli')
self.stdscr = stdscr
# init color
curses.init_pair(1, curses.COLOR_CYAN, curses.COLOR_BLACK)
curses.init_pair(2, curses.COLOR_BLUE, curses.COLOR_BLACK)
curses.init_pair(3, curses.COLOR_YELLOW, curses.COLOR_BLACK)
curses.init_pair(4, curses.COLOR_GREEN, curses.COLOR_BLACK)
curses.init_pair(5, curses.COLOR_WHITE, curses.COLOR_BLACK)
curses.init_pair(6, curses.COLOR_BLACK, curses.COLOR_MAGENTA)
curses.init_pair(7, curses.COLOR_BLACK, curses.COLOR_GREEN)
curses.init_pair(8, curses.COLOR_MAGENTA, curses.COLOR_BLACK)
curses.init_pair(9, curses.COLOR_GREEN, curses.COLOR_BLACK)
curses.init_pair(10, curses.COLOR_RED, curses.COLOR_BLACK)
curses.start_color()
for i in range(0, curses.COLORS):
if i < 10:
continue
curses.init_pair(i + 1, curses.COLOR_BLACK, i)
self.player = choose_player()(self.footer, self.event)
self.stdscr.nodelay(0)
self.setup_and_draw_screen()
self.run()
示例7: __init__
# 需要导入模块: import curses [as 别名]
# 或者: from curses import COLOR_CYAN [as 别名]
def __init__(self, stdscr, args):
self._stdscr = stdscr
self._dbase = database.load_file(args.database,
encoding=args.encoding,
frame_id_mask=args.frame_id_mask,
strict=not args.no_strict)
self._single_line = args.single_line
self._filtered_sorted_message_names = []
self._filter = ''
self._compiled_filter = None
self._formatted_messages = {}
self._playing = True
self._modified = True
self._show_filter = False
self._queue = Queue()
self._nrows, self._ncols = stdscr.getmaxyx()
self._received = 0
self._discarded = 0
self._basetime = None
self._page = 0
stdscr.keypad(True)
stdscr.nodelay(True)
curses.use_default_colors()
curses.curs_set(False)
curses.init_pair(1, curses.COLOR_BLACK, curses.COLOR_GREEN)
curses.init_pair(2, curses.COLOR_BLACK, curses.COLOR_CYAN)
bus = self.create_bus(args)
self._notifier = can.Notifier(bus, [self])
示例8: run
# 需要导入模块: import curses [as 别名]
# 或者: from curses import COLOR_CYAN [as 别名]
def run(self):
"""
"""
self.setup()
# Clear screen
self.screen.clear()
#
curses.start_color()
curses.init_pair(1, curses.COLOR_CYAN, curses.COLOR_BLACK)
curses.init_pair(2, curses.COLOR_GREEN, curses.COLOR_BLACK)
curses.init_pair(3, curses.COLOR_MAGENTA, curses.COLOR_BLACK)
curses.init_pair(4, curses.COLOR_YELLOW, curses.COLOR_BLACK)
curses.init_pair(5, curses.COLOR_RED, curses.COLOR_BLACK)
curses.init_pair(6, curses.COLOR_WHITE, curses.COLOR_BLACK)
while True:
#
session.expire_all()
# TODO: Add some standard header to the top? (like interval time etc)
#
self.render()
#
self.increment.reset()
#
self.screen.refresh()
#
time.sleep(self.interval)
self.running += self.interval
return
示例9: __init__
# 需要导入模块: import curses [as 别名]
# 或者: from curses import COLOR_CYAN [as 别名]
def __init__(self):
self.screen = curses.initscr()
self.screen.timeout(100) # the screen refresh every 100ms
# charactor break buffer
curses.cbreak()
self.screen.keypad(1)
curses.start_color()
if Config().get("curses_transparency"):
curses.use_default_colors()
curses.init_pair(1, curses.COLOR_GREEN, -1)
curses.init_pair(2, curses.COLOR_CYAN, -1)
curses.init_pair(3, curses.COLOR_RED, -1)
curses.init_pair(4, curses.COLOR_YELLOW, -1)
else:
curses.init_pair(1, curses.COLOR_GREEN, curses.COLOR_BLACK)
curses.init_pair(2, curses.COLOR_CYAN, curses.COLOR_BLACK)
curses.init_pair(3, curses.COLOR_RED, curses.COLOR_BLACK)
curses.init_pair(4, curses.COLOR_YELLOW, curses.COLOR_BLACK)
# term resize handling
size = terminalsize.get_terminal_size()
self.x = max(size[0], 10)
self.y = max(size[1], 25)
self.startcol = int(float(self.x) / 5)
self.indented_startcol = max(self.startcol - 3, 0)
self.update_space()
self.lyric = ""
self.now_lyric = ""
self.post_lyric = ""
self.now_lyric_index = 0
self.tlyric = ""
self.storage = Storage()
self.config = Config()
self.newversion = False
示例10: init_curses
# 需要导入模块: import curses [as 别名]
# 或者: from curses import COLOR_CYAN [as 别名]
def init_curses(self):
"""Setup the curses"""
self.window = curses.initscr()
self.window.keypad(True)
curses.noecho()
curses.cbreak()
curses.start_color()
curses.init_pair(1, curses.COLOR_CYAN, curses.COLOR_BLACK)
curses.init_pair(2, curses.COLOR_BLACK, curses.COLOR_CYAN)
self.current = curses.color_pair(2)
self.height, self.width = self.window.getmaxyx()
示例11: init_curses
# 需要导入模块: import curses [as 别名]
# 或者: from curses import COLOR_CYAN [as 别名]
def init_curses(self):
"""Setup the curses"""
self.window = curses.initscr()
self.window.keypad(True)
curses.noecho()
curses.cbreak()
curses.start_color()
curses.init_pair(1, curses.COLOR_CYAN, curses.COLOR_BLACK)
curses.init_pair(2, curses.COLOR_BLACK, curses.COLOR_CYAN)
self.current = curses.color_pair(2)
示例12: init_curses
# 需要导入模块: import curses [as 别名]
# 或者: from curses import COLOR_CYAN [as 别名]
def init_curses(self):
self.stdscr = curses.initscr()
curses.start_color()
curses.use_default_colors()
curses.init_pair(1, curses.COLOR_RED, -1)
curses.init_pair(2, curses.COLOR_YELLOW, -1)
curses.init_pair(3, curses.COLOR_CYAN, -1)
curses.init_pair(4, curses.COLOR_GREEN, -1)
curses.init_pair(5, curses.COLOR_BLUE, -1)
示例13: init_curses
# 需要导入模块: import curses [as 别名]
# 或者: from curses import COLOR_CYAN [as 别名]
def init_curses(self):
self.stdscr = curses.initscr()
curses.start_color()
curses.use_default_colors()
curses.init_pair(1, curses.COLOR_RED, -1)
curses.init_pair(2, curses.COLOR_YELLOW, -1)
curses.init_pair(3, curses.COLOR_CYAN, -1)
curses.init_pair(4, curses.COLOR_GREEN, -1)
示例14: __init__
# 需要导入模块: import curses [as 别名]
# 或者: from curses import COLOR_CYAN [as 别名]
def __init__(self):
"""
Setup the main screen, progress bars and logging box
"""
self.screen = curses.initscr()
curses.curs_set(0)
curses.start_color()
curses.init_pair(1, curses.COLOR_RED, curses.COLOR_BLACK)
curses.init_pair(2, curses.COLOR_GREEN, curses.COLOR_BLACK)
curses.init_pair(3, curses.COLOR_MAGENTA, curses.COLOR_BLACK)
curses.init_pair(4, curses.COLOR_CYAN, curses.COLOR_BLACK)
curses.init_pair(5, curses.COLOR_BLUE, curses.COLOR_BLACK)
curses.init_pair(6, curses.COLOR_YELLOW, curses.COLOR_BLACK)
self.height, self.width = self.screen.getmaxyx()
self.screen.border()
self.preptotal()
self.prepcurrent()
self.preplog()
self.banner()
self.sig()
self.drives = len(glob.glob("/dev/sd?1"))
self.donedrives = 0
self.prevprogress = 0
self.loglines = []
self.idx = 1
示例15: setup_screen
# 需要导入模块: import curses [as 别名]
# 或者: from curses import COLOR_CYAN [as 别名]
def setup_screen(screen):
"""Sets up screen
"""
# Set screen to getch() is non-blocking
screen.nodelay(1)
# Define some colors
curses.init_pair(1, curses.COLOR_RED, curses.COLOR_BLACK)
curses.init_pair(2, curses.COLOR_GREEN, curses.COLOR_BLACK)
curses.init_pair(3, curses.COLOR_CYAN, curses.COLOR_BLACK)
curses.init_pair(4, curses.COLOR_MAGENTA, curses.COLOR_BLACK)
curses.init_pair(5, curses.COLOR_YELLOW, curses.COLOR_BLACK)
# Add border
screen.border(0)