#NEWLINE# def _dirGroup( self , direction , skip_empty = False , skip_managed = False ) : #NEWLINE# #INDENT# 'Find a group walking the groups list in the specified direction\n\n        Parameters\n        ==========\n        skip_empty :\n            skips the empty groups\n        skip_managed :\n            skips the groups that have a screen\n        ' #NEWLINE# def match( group ) : #NEWLINE# #INDENT# if ( group is self ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# if ( skip_empty and ( not group . windows ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if ( skip_managed and group . screen ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# return True #NEWLINE# #UNINDENT# groups = [ group for group in self . qtile . groups if match ( group ) ] #NEWLINE# index = ( ( groups . index ( self ) + direction ) % len ( groups ) ) #NEWLINE# return groups [ index ]