def get_attr(self, *keys): """Returns the curses attribute for the specified keys Ready to use for curses.setattr() """ fg, bg, attr = self.get(*flatten(keys)) return attr | color_pair(get_color(fg, bg))
def color_at(self, y, x, wid, *keys): """Change the colors at the specified position""" keys = flatten(keys) attr = self.settings.colorscheme.get_attr(*keys) try: self.win.chgat(y, x, wid, attr) except _curses.error: pass
def color(self, *keys): """Change the colors from now on.""" keys = flatten(keys) attr = self.settings.colorscheme.get_attr(*keys) try: self.win.attrset(attr) except _curses.error: pass
def depends_on(*args): args = tuple(flatten(args)) def decorator(fnc): fnc.dependencies = args return fnc return decorator
def depends_on(*args): args = tuple(flatten(args)) def decorator(fnc): try: fnc.dependencies += args except: fnc.dependencies = args return fnc return decorator