Python curses.COLOR_YELLOW Examples
The following are 21
code examples of curses.COLOR_YELLOW().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
curses
, or try the search function
.
Example #1
Source File: interface.py From bitcoind-ncurses with MIT License | 8 votes |
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
Example #2
Source File: CLI.py From email_hack with MIT License | 7 votes |
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)
Example #3
Source File: app.py From toot with GNU General Public License v3.0 | 6 votes |
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
Example #4
Source File: lcd.py From bitnodes-hardware with MIT License | 6 votes |
def show(self, screen): self.screen = screen curses.init_pair(1, curses.COLOR_WHITE, curses.COLOR_BLACK) self.white = curses.color_pair(1) curses.init_pair(2, curses.COLOR_GREEN, curses.COLOR_BLACK) self.green = curses.color_pair(2) curses.init_pair(3, curses.COLOR_YELLOW, curses.COLOR_BLACK) self.yellow = curses.color_pair(3) curses.init_pair(4, curses.COLOR_RED, curses.COLOR_BLACK) self.red = curses.color_pair(4) curses.curs_set(0) self.addstr(1, 1, 'BITNODES HARDWARE', self.white) self.addstr(1, 19, 'LOADING', self.yellow) while True: time.sleep(self.update())
Example #5
Source File: __init__.py From py_cui with BSD 3-Clause "New" or "Revised" License | 6 votes |
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)
Example #6
Source File: ColorStreamHandler.py From emailhunter-clone with MIT License | 6 votes |
def __init__(self, use_colors): logging.Handler.__init__(self) self.use_colors = use_colors # Initialize environment curses.setupterm() # Get the foreground color attribute for this environment self.fcap = curses.tigetstr('setaf') #Get the normal attribute self.COLOR_NORMAL = curses.tigetstr('sgr0') # Get + Save the color sequences self.COLOR_INFO = curses.tparm(self.fcap, curses.COLOR_GREEN) self.COLOR_ERROR = curses.tparm(self.fcap, curses.COLOR_RED) self.COLOR_WARNING = curses.tparm(self.fcap, curses.COLOR_YELLOW) self.COLOR_DEBUG = curses.tparm(self.fcap, curses.COLOR_BLUE)
Example #7
Source File: raspcloud.py From RaspberryCloud with GNU General Public License v3.0 | 6 votes |
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
Example #8
Source File: cursesgui.py From ham2mon with GNU General Public License v3.0 | 5 votes |
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)
Example #9
Source File: menu_screen.py From botany with ISC License | 5 votes |
def define_colors(self): # TODO: implement colors # set curses color pairs manually curses.init_pair(1, curses.COLOR_BLACK, curses.COLOR_WHITE) curses.init_pair(2, curses.COLOR_WHITE, curses.COLOR_BLACK) curses.init_pair(3, curses.COLOR_GREEN, curses.COLOR_BLACK) curses.init_pair(4, curses.COLOR_BLUE, curses.COLOR_BLACK) curses.init_pair(5, curses.COLOR_MAGENTA, curses.COLOR_BLACK) curses.init_pair(6, curses.COLOR_YELLOW, curses.COLOR_BLACK) curses.init_pair(7, curses.COLOR_RED, curses.COLOR_BLACK) curses.init_pair(8, curses.COLOR_CYAN, curses.COLOR_BLACK)
Example #10
Source File: tui.py From wifiphisher with GNU General Public License v3.0 | 5 votes |
def gather_info(self, screen, info): """ Get the information from pywifiphisher and print them out :param self: A TuiMain object :param screen: A curses window object :param info: A namedtuple of printing information :type self: TuiMain :type screen: _curses.curses.window :type info: namedtuple :return: None :rtype: None """ # setup curses try: curses.curs_set(0) except curses.error: pass screen.nodelay(True) curses.init_pair(1, curses.COLOR_BLUE, screen.getbkgd()) curses.init_pair(2, curses.COLOR_YELLOW, screen.getbkgd()) curses.init_pair(3, curses.COLOR_RED, screen.getbkgd()) self.blue_text = curses.color_pair(1) | curses.A_BOLD self.yellow_text = curses.color_pair(2) | curses.A_BOLD self.red_text = curses.color_pair(3) | curses.A_BOLD while True: # catch the exception when screen size is smaller than # the text length is_done = self.display_info(screen, info) if is_done: return
Example #11
Source File: ui.py From NetEase-MusicBox with MIT License | 5 votes |
def __init__(self): self.screen = curses.initscr() # charactor break buffer curses.cbreak() self.screen.keypad(1) self.netease = NetEase() 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_YELLOW, curses.COLOR_BLACK)
Example #12
Source File: evilmaid.py From EvilAbigail with GNU General Public License v2.0 | 5 votes |
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
Example #13
Source File: predator_prey_env.py From IC3Net with MIT License | 5 votes |
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)
Example #14
Source File: traffic_junction_env.py From IC3Net with MIT License | 5 votes |
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)
Example #15
Source File: ui.py From musicbox with MIT License | 5 votes |
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
Example #16
Source File: monitor.py From foe-bot with MIT License | 5 votes |
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
Example #17
Source File: fm_cli.py From baidufm-py with MIT License | 5 votes |
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()
Example #18
Source File: recipe-577933.py From code with MIT License | 4 votes |
def getStats(scr): curses.init_pair(9, curses.COLOR_WHITE, curses.COLOR_BLACK) curses.init_pair(10, curses.COLOR_YELLOW, curses.COLOR_BLACK) curses.init_pair(11, curses.COLOR_RED, curses.COLOR_BLACK) curses.init_pair(12, curses.COLOR_GREEN, curses.COLOR_BLACK) (maxY, maxX) = scr.getmaxyx() while 1: try: display_time(scr) display_loadavg(scr) display_header(scr) #write(scr, 3, 0, '%-4s %-20s %-15s %-40s%s' % ('Slot', 'Remote Host', 'State', 'Filename', ' '*(maxX-83)), curses.A_BOLD) cnt = 5 try: for i in os.listdir(DISTCC_DIR+'/state'): data = struct.unpack('@iLL128s128siiP', open(DISTCC_DIR+'/state/'+i).readline().strip()) file = data[3].split('\x00')[0] or 'None' host = data[4].split('\x00')[0] or 'None' slot = int(data[5]) stte = states[int(data[6])] scr.move(cnt,0) scr.clrtoeol() if 'None' not in (file, host): write(scr, cnt, 0, '%s' % slot, curses.color_pair(9)) write(scr, cnt, 5, '%s' % host, curses.color_pair(9)) if int(data[6]) in (2,3): write(scr, cnt, 25, '%s ' % (stte), curses.color_pair(10)) elif int(data[6]) in (0,1): write(scr, cnt, 25, '%s ' % (stte), curses.color_pair(11)) elif int(data[6]) in (4,5): write(scr, cnt, 25, '%s ' % (stte), curses.color_pair(12)) elif int(data[6]) in (6,7): write(scr, cnt, 25, '%s ' % (stte), curses.color_pair(12)|curses.A_BOLD) else: write(scr, cnt, 25, '%s ' % (stte)) write(scr, cnt, 45, '%s' % file, curses.color_pair(9)) cnt += 1 except struct.error: pass except IOError: pass scr.refresh() time.sleep(0.75) scr.erase() scr.move(0,0) except KeyboardInterrupt: sys.exit(-1)
Example #19
Source File: __main__.py From asciidots with GNU Affero General Public License v3.0 | 4 votes |
def __init__(self, env, ticks, silent, debug, compat_debug, debug_lines, autostep_debug, output_limit): """ :param dots.environment.Env env: The env of the interpreter :param int ticks: The max number of ticks for the program :param bool silent: True to turn off all outputs :param bool debug: True to show the execution of the program :param bool compat_debug: True to show the debug with only builtin functions :param int debug_lines: The number of lines to show the debug :param float autostep_debug: The timebetween automatic ticks. 0 disables the auto ticks. :param int output_limit: The max number of outputs for the program """ super(DefaultIOCallbacks, self).__init__(env) # if it is zero or false, we don't want to stop self.ticks_left = ticks or float('inf') self.outputs_left = output_limit or float('inf') self.silent = silent self.debug = debug self.compat_debug = compat_debug self.debug_lines = debug_lines self.debug_cols = terminalsize.get_terminal_size()[0] - 1 self.autostep_debug = autostep_debug self.compat_logging_buffer = '' self.compat_logging_buffer_lines = terminal_lines - debug_lines - 1 self.first_tick = True if self.debug and not self.compat_debug: self.logging_loc = 0 self.logging_x = 1 self.stdscr = curses.initscr() 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_YELLOW, curses.COLOR_BLACK) curses.init_pair(4, curses.COLOR_BLUE, curses.COLOR_BLACK) curses.noecho() # hides the cursor curses.curs_set(False) # defining the two main parts of the screen: the view of the program self.win_program = curses.newwin(self.debug_lines, curses.COLS, 0, 0) # and pad for the output of the prog self.logging_pad = curses.newpad(1000, curses.COLS - 1) def signal_handler(signal, frame): self.on_finish() sys.exit(0) signal.signal(signal.SIGINT, signal_handler)
Example #20
Source File: top.py From python-alerta-client with Apache License 2.0 | 4 votes |
def main(self, stdscr): self.screen = stdscr curses.use_default_colors() curses.init_pair(1, curses.COLOR_RED, -1) curses.init_pair(2, curses.COLOR_MAGENTA, -1) curses.init_pair(3, curses.COLOR_YELLOW, -1) curses.init_pair(4, curses.COLOR_BLUE, -1) curses.init_pair(5, curses.COLOR_CYAN, -1) curses.init_pair(6, curses.COLOR_GREEN, -1) curses.init_pair(7, curses.COLOR_WHITE, curses.COLOR_BLACK) COLOR_RED = curses.color_pair(1) COLOR_MAGENTA = curses.color_pair(2) COLOR_YELLOW = curses.color_pair(3) COLOR_BLUE = curses.color_pair(4) COLOR_CYAN = curses.color_pair(5) COLOR_GREEN = curses.color_pair(6) COLOR_BLACK = curses.color_pair(7) self.SEVERITY_MAP = { 'security': ['Sec', COLOR_BLACK], 'critical': ['Crit', COLOR_RED], 'major': ['Majr', COLOR_MAGENTA], 'minor': ['Minr', COLOR_YELLOW], 'warning': ['Warn', COLOR_BLUE], 'indeterminate': ['Ind ', COLOR_CYAN], 'cleared': ['Clr', COLOR_GREEN], 'normal': ['Norm', COLOR_GREEN], 'ok': ['Ok', COLOR_GREEN], 'informational': ['Info', COLOR_GREEN], 'debug': ['Dbug', COLOR_BLACK], 'trace': ['Trce', COLOR_BLACK], 'unknown': ['Unkn', COLOR_BLACK] } self.screen.keypad(1) self.screen.nodelay(1) while True: self.update() event = self.screen.getch() if 0 < event < 256: self._key_press(chr(event)) else: if event == curses.KEY_RESIZE: self.update() time.sleep(2)
Example #21
Source File: rgcurses.py From rgkit with The Unlicense | 4 votes |
def _init_curses(self): # Colors and attributes colors_empty = 1 colors_obstacle = 2 colors_bot1 = 3 colors_bot2 = 4 # Selected colors_empty_s = 5 colors_obstacle_s = 6 colors_bot1_s = 7 colors_bot2_s = 8 # Other colors_text = 9 # (Color pair, Foreground, Background) cs.init_pair(colors_empty, cs.COLOR_WHITE, cs.COLOR_BLACK) cs.init_pair(colors_obstacle, cs.COLOR_BLACK, cs.COLOR_WHITE) cs.init_pair(colors_bot1, cs.COLOR_WHITE, cs.COLOR_RED) cs.init_pair(colors_bot2, cs.COLOR_WHITE, cs.COLOR_BLUE) cs.init_pair(colors_empty_s, cs.COLOR_WHITE, cs.COLOR_YELLOW) cs.init_pair(colors_obstacle_s, cs.COLOR_BLACK, cs.COLOR_YELLOW) cs.init_pair(colors_bot1_s, cs.COLOR_WHITE, cs.COLOR_MAGENTA) cs.init_pair(colors_bot2_s, cs.COLOR_WHITE, cs.COLOR_CYAN) cs.init_pair(colors_text, cs.COLOR_WHITE, cs.COLOR_BLACK) # Attributes attr_empty = cs.A_NORMAL attr_obstacle = cs.A_NORMAL attr_bot1 = cs.A_BOLD attr_bot2 = cs.A_BOLD attr_empty_s = cs.A_NORMAL attr_obstacle_s = cs.A_NORMAL attr_bot1_s = cs.A_BOLD attr_bot2_s = cs.A_BOLD attr_text = cs.A_NORMAL # **** Do not edit settings below this line *** cs.curs_set(0) self._attr_empty = cs.color_pair(colors_empty) | attr_empty self._attr_obstacle = cs.color_pair(colors_obstacle) | attr_obstacle self._attr_bot1 = cs.color_pair(colors_bot1) | attr_bot1 self._attr_bot2 = cs.color_pair(colors_bot2) | attr_bot2 self._attr_empty_s = cs.color_pair(colors_empty_s) | attr_empty_s self._attr_obstacle_s = cs.color_pair(colors_obstacle_s) \ | attr_obstacle_s self._attr_bot1_s = cs.color_pair(colors_bot1_s) | attr_bot1_s self._attr_bot2_s = cs.color_pair(colors_bot2_s) | attr_bot2_s self._attr_text = cs.color_pair(colors_text) | attr_text