#NEWLINE# def advance( self , steps = 1 , mode = None , **kwargs ) : #NEWLINE# #INDENT# 'Advances a shot profile forward.\n\n        If this profile is at the last step and configured to roll over, it will\n        roll over to the first step. If this profile is at the last step and not\n        configured to roll over, this method has no effect.\n\n        ' #NEWLINE# profile_name = self . enable_table [ mode ] [ 'profile' ] #NEWLINE# profile = self . enable_table [ mode ] [ 'settings' ] #NEWLINE# player_var = profile [ 'player_variable' ] #NEWLINE# if self . debug : #NEWLINE# #INDENT# self . log . debug ( 'Advancing %s step(s). Mode: %s, Profile: %s, Current State: %s' , steps , mode , profile_name , self . player [ player_var ] ) #NEWLINE# #UNINDENT# if ( ( self . player [ player_var ] + steps ) >= len ( profile [ 'states' ] ) ) : #NEWLINE# #INDENT# if profile [ 'loop' ] : #NEWLINE# #INDENT# if self . debug : #NEWLINE# #INDENT# self . log . debug ( "Profile '%s' is in its final state based a player variable %s=%s. Profile setting for loop is True, so resetting to the first state." , self . active_settings [ 'profile' ] , player_var , self . player [ player_var ] ) #NEWLINE# #UNINDENT# self . player [ profile [ 'player_variable' ] ] = 0 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if self . debug : #NEWLINE# #INDENT# self . log . debug ( "Profile '%s' is in its final state based a player variable %s=%s. Profile setting for loop is False, so state is not advancing." , self . active_settings [ 'profile' ] , player_var , self . player [ player_var ] ) #NEWLINE# #UNINDENT# return #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if self . debug : #NEWLINE# #INDENT# self . log . debug ( 'Advancing player variable %s %s state(s)' , player_var , steps ) #NEWLINE# #UNINDENT# self . player [ player_var ] += steps #NEWLINE# self . update_current_state_name ( mode ) #NEWLINE# for group in self . groups : #NEWLINE# #INDENT# group . check_for_complete ( mode ) #NEWLINE# #UNINDENT# #UNINDENT# if ( self . active_settings [ 'profile' ] == profile_name ) : #NEWLINE# #INDENT# if self . debug : #NEWLINE# #INDENT# self . log . debug ( "Profile '%s' just advanced is the active profile" , profile_name ) #NEWLINE# #UNINDENT# self . _update_lights ( )