#NEWLINE# @ gen . coroutine #NEWLINE# def add_user( self , user ) : #NEWLINE# #INDENT# 'Add a new user\n        \n        If self.create_system_users, the user will attempt to be created.\n        ' #NEWLINE# user_exists = ( yield gen . maybe_future ( self . system_user_exists ( user ) ) ) #NEWLINE# if ( not user_exists ) : #NEWLINE# #INDENT# if self . create_system_users : #NEWLINE# #INDENT# ( yield gen . maybe_future ( self . add_system_user ( user ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise KeyError ( ( 'User %s does not exist.' % user . name ) ) #NEWLINE# #UNINDENT# #UNINDENT# ( yield gen . maybe_future ( super ( ) . add_user ( user ) ) )