def parse_bool(bool): if re.match(Conf.TRUTHY, bool): return True elif re.match(Conf.FALSEY, bool): return False else: util.errors( "invalid boolean constant: %s; " % bool, "expecting true/false, yes/no, on/off" )
def inner(self, thing=thing, fs_guard=fs_guard, cmd=cmd): if fs_guard and self.has_fullscreen(): return try: thing = getattr(self, thing)() except Exception as e: util.errors( "tried doing #<%s instance>.%s()" % (type(self).__name__, thing), "this is the instance: %s" % repr(thing), str(e)) if thing is not None: try: getattr(thing, cmd)(*args) except Exception as e: util.errors( "tried doing #<%s instance>.%s(%s)" % (type(thing).__name__, cmd, ", ".join(args)), str(e))
def inner(self, thing=thing, fs_guard=fs_guard, cmd=cmd): if fs_guard and self.has_fullscreen(): return try: thing = getattr(self, thing)() except Exception as e: util.errors( "tried doing #<%s instance>.%s()" % (type(self).__name__, thing), "this is the instance: %s" % repr(thing), str(e) ) if thing is not None: try: getattr(thing, cmd)(*args) except Exception as e: util.errors( "tried doing #<%s instance>.%s(%s)" % (type(thing).__name__, cmd, ", ".join(args)), str(e) )
def parse_bool(bool): if re.match(Conf.TRUTHY, bool): return True elif re.match(Conf.FALSEY, bool): return False else: util.errors("invalid boolean constant: %s; " % bool, "expecting true/false, yes/no, on/off")