def main(): args = Args() if args.signal: c = Control(args.port) if args.signal == u"start" : c.start() elif args.signal == u"stop" : c.stop() elif args.signal == u"restart" : c.restart() else: pool = Pool(Config.pool_size, init_worker) playlist = Playlist(args.port, pool) if args.query : try: print playlist.query() except IOError: pass # don't puke if quitting less(1) elif args.shuffle : print playlist.shuffle() elif args.repeat : print playlist.repeat() elif args.kontinue : print playlist.kontinue() elif args.next_album : print playlist.next_album() elif args.next_artist : print playlist.next_artist() else:
def run(self): args = sys.argv[1:] # Check inputs, if not correct set default values if len(args) != 3: args = [] args.append('180') # x_time args.append('5') # n_samples args.append('1') # t_threads self.show('Invalid Inputs, going to defaults') else: self.show('Inputs Valid') # Read list f = open(fp_list, 'r') fps = [line[:-1] for line in f] # Run for 3 days for i in range(3): control = Control(args, fps, ref_node, day_cycle=DAY_CYCLE) control.run()