def __init__(self): Gtk.Application.__init__(self) self.connect("activate", self.on_activate) self.controller = AlienFXProber.get_controller() self.themefile = AlienFXThemeFile(self.controller) self.selected_action = None self.action_type = self.themefile.KW_ACTION_TYPE_FIXED self.theme_edited = False self.set_theme_done = True
def start(): """ Main entry point for the alienfx cli.""" controller = AlienFXProber.get_controller() if controller is None: logging.error("No supported Alien FX controllers found!") quit() themefile = alienfx_themefile.AlienFXThemeFile(controller) try: argparser = argparse.ArgumentParser( description="""AlienFX is a utility to control the lighting effects of your Alienware computer. Lighting effect configurations are stored in theme files.""" ) argparser.add_argument( "-l", "--log", help="write detailed logging information to LOG" ) argparser.add_argument( "-t", "--theme", help="set the lighting theme to THEME." ) argparser.add_argument( "-s", "--list", action="store_const", const=1, help="list all available lighting themes" ) argparser.add_argument( "-v", "--version", action="version", version="%(prog)s {}".format(alienfx.common.get_version()) ) args = argparser.parse_args() if args.log is not None: alienfx_logger.set_logfile(args.log) if args.list is not None: print "Available themes:" themes = themefile.get_themes() for t in themes: print "\t{}".format(t) elif args.theme is not None: themefile.load(args.theme) controller.set_theme(themefile) themefile.applied() except Exception as e: logging.error(e)
def start(): """ Main entry point for the alienfx cli.""" controller = AlienFXProber.get_controller() if controller is None: logging.error("No supported Alien FX controllers found!") quit() themefile = alienfx_themefile.AlienFXThemeFile(controller) try: argparser = argparse.ArgumentParser( description="""AlienFX is a utility to control the lighting effects of your Alienware computer. Lighting effect configurations are stored in theme files.""") argparser.add_argument( "-l", "--log", help="write detailed logging information to LOG") argparser.add_argument("-t", "--theme", help="set the lighting theme to THEME.") argparser.add_argument("-s", "--list", action="store_const", const=1, help="list all available lighting themes") argparser.add_argument("-v", "--version", action="version", version="%(prog)s {}".format( alienfx.common.get_version())) args = argparser.parse_args() if args.log is not None: alienfx_logger.set_logfile(args.log) if args.list is not None: print "Available themes:" themes = themefile.get_themes() for t in themes: print "\t{}".format(t) elif args.theme is not None: themefile.load(args.theme) controller.set_theme(themefile) themefile.applied() except Exception as e: logging.error(e)
def start(): """ Main entry point for the alienfx cli.""" print("You are running alienfx under Python-Version: " + sys.version) # You may switch the commenting of the following 2 lines to force zonescan-execution controller = AlienFXProber.get_controller( ) # DEBUG: you may comment this out for development of zonescanner # controller = None # DEBUG: you may uncomment this out for development of zonescanner if controller is None: logging.error( "No Alien FX controller, defined by a supported model, found!") logging.info("Asking user for zone probing...") # print("No Alien FX controller, defined by a supported model, found.") if askuser("Would you like to perform a zonescan?"): # User answered yes: Zonescan should be performed doZonescan() print("Zonescan finished") logging.info("Zonescan finished") return True else: # No Zonescan should be performed print("OK. Bye.") logging.info("Zonescanning not performed") quit() # Finish themefile = alienfx_themefile.AlienFXThemeFile(controller) try: argparser = argparse.ArgumentParser( description="""AlienFX is a utility to control the lighting effects of your Alienware computer. Lighting effect configurations are stored in theme files.""") argparser.add_argument( "-l", "--log", help="write detailed logging information to LOG") argparser.add_argument("-t", "--theme", help="set the lighting theme to THEME.") argparser.add_argument("-s", "--list", action="store_const", const=1, help="list all available lighting themes") argparser.add_argument("-v", "--version", action="version", version="%(prog)s {}".format( alienfx.common.get_version())) argparser.add_argument("-z", "--zonescan", action="store_true", help="starts a zonescan") args = argparser.parse_args() if args.zonescan is not None: if args.zonescan: doZonescan() return True if args.log is not None: alienfx_logger.set_logfile(args.log) if args.list is not None: print("Available themes:") themes = themefile.get_themes() for t in themes: print(("\t{}").format(t)) elif args.theme is not None: themefile.load(args.theme) controller.set_theme(themefile) themefile.applied() except Exception as e: logging.error(e)
def start(): """ Main entry point for the alienfx cli.""" print("You are running alienfx under Python-Version: "+sys.version) # You may switch the commenting of the following 2 lines to force zonescan-execution controller = AlienFXProber.get_controller() # DEBUG: you may comment this out for development of zonescanner # controller = None # DEBUG: you may uncomment this out for development of zonescanner if controller is None: logging.error("No Alien FX controller, defined by a supported model, found!") logging.info("Asking user for zone probing...") # print("No Alien FX controller, defined by a supported model, found.") if askuser("Would you like to perform a zonescan?"): # User answered yes: Zonescan should be performed doZonescan() print("Zonescan finished") logging.info("Zonescan finished") return True else: # No Zonescan should be performed print("OK. Bye.") logging.info("Zonescanning not performed") quit() # Finish themefile = alienfx_themefile.AlienFXThemeFile(controller) try: argparser = argparse.ArgumentParser( description="""AlienFX is a utility to control the lighting effects of your Alienware computer. Lighting effect configurations are stored in theme files.""" ) argparser.add_argument( "-l", "--log", help="write detailed logging information to LOG" ) argparser.add_argument( "-t", "--theme", help="set the lighting theme to THEME." ) argparser.add_argument( "-s", "--list", action="store_const", const=1, help="list all available lighting themes" ) argparser.add_argument( "-v", "--version", action="version", version="%(prog)s {}".format(alienfx.common.get_version()) ) argparser.add_argument( "-z", "--zonescan", action="store_true", help="starts a zonescan" ) args = argparser.parse_args() if args.zonescan is not None: if args.zonescan: doZonescan() return True if args.log is not None: alienfx_logger.set_logfile(args.log) if args.list is not None: print("Available themes:") themes = themefile.get_themes() for t in themes: print(("\t{}").format(t)) elif args.theme is not None: themefile.load(args.theme) controller.set_theme(themefile) themefile.applied() except Exception as e: logging.error(e)