def sigtermhandler(signum, frame): # shutdown all running threads hub.notify(events.quit(), 100)
if config.network.enableserver: import network network.tcpserver(config.network.bind, config.network.port).start() if config.network.socketfile: import network network.unixserver(os.path.expanduser(config.network.socketfile)).start() # Now that the basic services have been started, we can initialize # the players. This has to be done last because the players # immediately start requesting a new song playerids = [services.player.initplayer("main", config.player.main), services.player.initplayer("secondary", config.player.secondary)] except: # if something goes wrong, shutdown all already running services hub.notify(events.quit(), 100) raise ############################################################################## # basic curses library setup... ############################################################################## def cursessetup(): # Initialize curses library stdscr = curses.initscr() # Turn off echoing of keys curses.noecho() # In keypad mode, escape sequences for special keys # (like the cursor keys) will be interpreted and
if config.network.socketfile: import network network.unixserver(os.path.expanduser( config.network.socketfile)).start() # Now that the basic services have been started, we can initialize # the players. This has to be done last because the players # immediately start requesting a new song playerids = [ services.player.initplayer("main", config.player.main), services.player.initplayer("secondary", config.player.secondary) ] except: # if something goes wrong, shutdown all already running services hub.notify(events.quit(), 100) raise ############################################################################## # basic curses library setup... ############################################################################## def cursessetup(): # Initialize curses library stdscr = curses.initscr() # Turn off echoing of keys curses.noecho() # In keypad mode, escape sequences for special keys
def quit(self, event): service.service.quit(self, event) self.songdbhub.notify(events.quit())